UGX-Mods

Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: nabaro on February 15, 2015, 10:12:40 am

Title: Physics Launch a Player
Post by: nabaro on February 15, 2015, 10:12:40 am
I am trying to fling a player using Physics Launch, but it does nothing. I'm not sure that I understand the parameters of Physics Launch fully. Here is the code:

Code Snippet
Plaintext
player PhysicsLaunch( player.origin, 20 );

Thanks in advance!
Title: Re: Physics Launch a Player
Post by: BluntStuffy on February 15, 2015, 01:10:05 pm
Code Snippet
Plaintext
PhysicsLaunch( contact_point, initial_force );

you need to specify the force as a vector though, so like:  ( x,y,z ) but this only works for script_models i think. Try using launch() or setvelocity().
Prob the last one will give the best result.

http://ugx-mods.com/script/#core.Entity.launch (http://ugx-mods.com/script/#core.Entity.launch)

http://ugx-mods.com/script/#core.Player.setVelocity (http://ugx-mods.com/script/#core.Player.setVelocity)
Title: Re: Physics Launch a Player
Post by: nabaro on February 15, 2015, 02:56:14 pm
I'm still a bit unsure what a vector is. Let's say I set the vector to (50, 30, 10), will the launched object/person go to that point on the coordinate grid, or will they move 50 on the x axis, 30 on the y axis, and 10 on the z axis. Pretty much, is it a specific position or a distance relative from the player/object?
Title: Re: Physics Launch a Player
Post by: BluntStuffy on February 15, 2015, 03:07:26 pm
vector's arent my strongest point either. it's the direction of the force applied ( ? i think ), it's def not the coordinate's. Look in the scripting reference for some functions you can use related to vector's, or ask someome who understands them, lol.
Title: Re: Physics Launch a Player
Post by: JBird632 on February 15, 2015, 04:17:56 pm
You might want to take into consideration the fact that you can't play the phsyicslaunch function on a player as it doesn't seem to do anything. The best way I have found (that is the way Treyarch made the flinger) was to link a player to a struct and physicslaunch the struct.
Title: Re: Physics Launch a Player
Post by: nabaro on February 16, 2015, 02:28:40 am
Thank you,

Code Snippet
Plaintext
setvelocity(x,y,z);

works!
Title: Re: Physics Launch a Player
Post by: MakeCents on February 16, 2015, 01:35:52 pm
Vector:
Vector Despicable Me (http://www.youtube.com/watch?v=KbrEBpCw3Ag#)

lol.

This may be helpful?
http://www.mathwarehouse.com/vectors/ (http://www.mathwarehouse.com/vectors/)