Well that's the thing. I'm not really sure where to begin. I've got a trigger that check ifs both players are ready when they press space down. and on the up of space an other trigger starting the round. The ball spawns in the middle but I'm not sure as to how to make it go in a random direction. My original thought was to make it spin on itself for 5 seconds and have it launch in a random direction.
Making it move with move unit instantly has not been successful. I got it to move with issue order but I can't make it go in a random direction and I'm not sure which functions I need to actually put the physics in play.
I've also been thinking a lot about how the ball is going to interact with the pads(pheonix).
I wanted to make it so that if the ball hits the middle section of the pad, it would bounce straight (or very close to straight) and if it hit either side that it would go in the appropriate direction. I know the concept. I'm just not sure how to put it in motion. Learning was the goal of this map. Its proving to be quite a headache. haha
You should start with making move at all first. Have a loop that runs forever with a 0.0 wait in it. In this loop, move the unit instantly by 0,1. This will get you started. When you get this to work, you should be able to figure out how to make it random.
Okay. Well I got that working. Thanks. Althought I think an x,y movement might be too static for a game like ping pong. I really think I have to figure out how to make it move with an angle so if it enters a region with an angle of 135 it bounces (sorta) and changes the angle to 55. I'm having a hard time figuring out how to put that problem into the editor. I'm still too unfamiliar with most of this.
Well I'm getting somewhere now. Ball is moving but the movement is kinda static. And I'm having a hard time figuring which i should multiply and which i should divide the x or the y. Haha. I suppose that all part of the testing phase. Thanks a bunch for the pointers. I'll be back once I've gathered more questions.
You don't need to divide anything. Just multiply the x velocity by -1 when it hits a vertical wall, and multiply the y velocity by -1 when it hits a horizontal wall.
For some reason the ball now stays in the middle of the map. Here is couple of the triggers I use for movement.
Ball X Velocity = ((Square root(2.0)) / 2.0) <Real>
Ball Y Velocity = ((Square root(2.0)) / 2.0) <Real>
Ball Enter's Play
Ball Spawn
P1 Ready UP
P2 Ready UP
Bounce system
Left side
Right side
Red Pad
Blue Pad
Ball Enter's Play
Events
Unit - Ball Enters Ball Spawn
Local Variables
Conditions
Game ON == true
Actions
General - Repeat (Actions) forever
Actions
General - Wait 0.05 Game Time seconds
Unit - Move Ball instantly to (Ball Position offset by (Ball X Velocity, Ball Y Velocity)) (No Blend)
Variable - Set Ball Angle = (Facing of Ball)
Trigger - Turn Ball Enter's Play Off
Ball Spawn
Events
UI - Player Any Player presses Space key Up with shift Allow, control Allow, alt Allow
Local Variables
Conditions
P1 Ready == true
P2 Ready == true
Actions
Variable - Set Game ON = true
Sound - Make the announcer say 5 at 100.0% volume for (All players)
General - Wait 1.0 Real Time seconds
Sound - Make the announcer say 4 at 100.0% volume for (All players)
General - Wait 1.0 Real Time seconds
Sound - Make the announcer say 3 at 100.0% volume for (All players)
General - Wait 1.0 Real Time seconds
Sound - Make the announcer say 2 at 100.0% volume for (All players)
General - Wait 1.0 Real Time seconds
Sound - Make the announcer say 1 at 100.0% volume for (All players)
General - Wait 1.0 Real Time seconds
Sound - Play Ping (Unnamed) for (All players) (at 100.0% volume, skip the first 0.0 seconds)
Unit - Create 1 Soccerball for player 0 at (Center of Ball Spawn) facing (Center of Ball Spawn) (No Options)
Variable - Set Ball = (Last created unit)
Variable - Set P1 Ready = false
Variable - Set P2 Ready = false
P1 Ready UP
Events
UI - Player 1 presses Space key Down with shift Allow, control Allow, alt Allow
Local Variables
Conditions
Game ON == false
Actions
Variable - Set P1 Ready = true
P2 Ready UP
Events
UI - Player 2 presses Space key Down with shift Allow, control Allow, alt Allow
Local Variables
Conditions
Game ON == false
Actions
Variable - Set P2 Ready = true
Left side
Events
Unit - Ball Enters Left Side
Local Variables
Conditions
Actions
Variable - Modify Ball Y Velocity: * -1.0
Right side
Events
Unit - Ball Enters Left Side
Local Variables
Conditions
Actions
Variable - Modify Ball Y Velocity: * -1.0
Red Pad
Events
Unit - Ball Enters a distance of 2.0 from Pads [15.00, 32.00]
Local Variables
Conditions
Actions
Variable - Modify Ball X Velocity: * -1.0
Blue Pad
Events
Unit - Ball Enters a distance of 2.0 from Pads [49.00, 32.00]
Local Variables
Conditions
Actions
Variable - Modify Ball X Velocity: * -1.0
Wait, is this pong or ping pong? Those are two very different things. Pong wouldn't use gravity, but ping pong would. And ping pong would require an angle as well, even if not using a polar coordinate system.
Sorry, I misunderstood the concept of this project. I thought it was being done in a 3D plane.
@TacoManStan: Go
Yes as I said. I understand the physics. I'm just not sure how to put it in practice in the editor.
@DarlD: Go
Could you please ask specific questions where you are stuck?
@Vexal: Go
Well that's the thing. I'm not really sure where to begin. I've got a trigger that check ifs both players are ready when they press space down. and on the up of space an other trigger starting the round. The ball spawns in the middle but I'm not sure as to how to make it go in a random direction. My original thought was to make it spin on itself for 5 seconds and have it launch in a random direction.
Making it move with move unit instantly has not been successful. I got it to move with issue order but I can't make it go in a random direction and I'm not sure which functions I need to actually put the physics in play.
I've also been thinking a lot about how the ball is going to interact with the pads(pheonix).
I wanted to make it so that if the ball hits the middle section of the pad, it would bounce straight (or very close to straight) and if it hit either side that it would go in the appropriate direction. I know the concept. I'm just not sure how to put it in motion. Learning was the goal of this map. Its proving to be quite a headache. haha
@DarlD: Go
You should start with making move at all first. Have a loop that runs forever with a 0.0 wait in it. In this loop, move the unit instantly by 0,1. This will get you started. When you get this to work, you should be able to figure out how to make it random.
@Vexal: Go
The ball just disappears.
@DarlD: Go
You're not supposed to move it TO 0,1. You're supposed to move it to "point with offest"
Move it to to "position of ball" with "offest point(0,1)"
Doing so will move it to the ball's original position plus a y offset of 1.
Though, that might be really fast. You should probably change it to an offset of .25 to start with just to make sure you don't miss it.
@Vexal: Go
Okay. Well I got that working. Thanks. Althought I think an x,y movement might be too static for a game like ping pong. I really think I have to figure out how to make it move with an angle so if it enters a region with an angle of 135 it bounces (sorta) and changes the angle to 55. I'm having a hard time figuring out how to put that problem into the editor. I'm still too unfamiliar with most of this.
@DarlD: Go
You don't need to do that. Try this.
Make a variable called 'xVelocity' and set it to the sqrt(2)/2. Make a variable called 'yVelocity' and set it to the sqrt(2)/2.
Set the offset point to be (xVelocity, yVelocity)
Now, when it hits a vertical wall, do "set xVelocity = xVelocity * -1"
When it hits a horizontal wall, do "set yVelocity = yVelocity* -1"
sqrt(2)/2 is just an example. This will work for any starting velocity. You can have it start with random x and y velocities.
@Vexal: Go
What does sqrt(2)/2 stand for? I'm sorry if this is a stupid question.
@DarlD: Go
The square root of 2 divided by 2.
It's 0.7071067811865475244008443621048490392848359376884740365883
@Vexal: Go
Well I'm getting somewhere now. Ball is moving but the movement is kinda static. And I'm having a hard time figuring which i should multiply and which i should divide the x or the y. Haha. I suppose that all part of the testing phase. Thanks a bunch for the pointers. I'll be back once I've gathered more questions.
@DarlD: Go
You don't need to divide anything. Just multiply the x velocity by -1 when it hits a vertical wall, and multiply the y velocity by -1 when it hits a horizontal wall.
@Vexal: Go
For some reason the ball now stays in the middle of the map. Here is couple of the triggers I use for movement.
Ball X Velocity = ((Square root(2.0)) / 2.0) <Real> Ball Y Velocity = ((Square root(2.0)) / 2.0) <Real>
Ball Enter's Play Ball Spawn P1 Ready UP P2 Ready UP
Bounce system Left side Right side Red Pad Blue Pad
Ball Enter's Play Events Unit - Ball Enters Ball Spawn Local Variables Conditions Game ON == true Actions General - Repeat (Actions) forever Actions General - Wait 0.05 Game Time seconds Unit - Move Ball instantly to (Ball Position offset by (Ball X Velocity, Ball Y Velocity)) (No Blend) Variable - Set Ball Angle = (Facing of Ball) Trigger - Turn Ball Enter's Play Off
Ball Spawn Events UI - Player Any Player presses Space key Up with shift Allow, control Allow, alt Allow Local Variables Conditions P1 Ready == true P2 Ready == true Actions Variable - Set Game ON = true Sound - Make the announcer say 5 at 100.0% volume for (All players) General - Wait 1.0 Real Time seconds Sound - Make the announcer say 4 at 100.0% volume for (All players) General - Wait 1.0 Real Time seconds Sound - Make the announcer say 3 at 100.0% volume for (All players) General - Wait 1.0 Real Time seconds Sound - Make the announcer say 2 at 100.0% volume for (All players) General - Wait 1.0 Real Time seconds Sound - Make the announcer say 1 at 100.0% volume for (All players) General - Wait 1.0 Real Time seconds Sound - Play Ping (Unnamed) for (All players) (at 100.0% volume, skip the first 0.0 seconds) Unit - Create 1 Soccerball for player 0 at (Center of Ball Spawn) facing (Center of Ball Spawn) (No Options) Variable - Set Ball = (Last created unit) Variable - Set P1 Ready = false Variable - Set P2 Ready = false
P1 Ready UP Events UI - Player 1 presses Space key Down with shift Allow, control Allow, alt Allow Local Variables Conditions Game ON == false Actions Variable - Set P1 Ready = true
P2 Ready UP Events UI - Player 2 presses Space key Down with shift Allow, control Allow, alt Allow Local Variables Conditions Game ON == false Actions Variable - Set P2 Ready = true
Left side Events Unit - Ball Enters Left Side Local Variables Conditions Actions Variable - Modify Ball Y Velocity: * -1.0
Right side Events Unit - Ball Enters Left Side Local Variables Conditions Actions Variable - Modify Ball Y Velocity: * -1.0
Red Pad Events Unit - Ball Enters a distance of 2.0 from Pads [15.00, 32.00] Local Variables Conditions Actions Variable - Modify Ball X Velocity: * -1.0
Blue Pad Events Unit - Ball Enters a distance of 2.0 from Pads [49.00, 32.00] Local Variables Conditions Actions Variable - Modify Ball X Velocity: * -1.0
@DarlD: Go
Are you positive the loop is running? Print out a textmessage from inside the loop just to make sure.
@Vexal: Go
Wait, is this pong or ping pong? Those are two very different things. Pong wouldn't use gravity, but ping pong would. And ping pong would require an angle as well, even if not using a polar coordinate system.
Sorry, I misunderstood the concept of this project. I thought it was being done in a 3D plane.
Great to be back and part of the community again!
@TacoManStan: Go
It is but not with the height. That's the original idea anyway.