Jump to content
Sign in to follow this  
braincrush

spawning granade/missile (not explosion)

Recommended Posts

ok heres the question : is it possible to spawn granade (with actual visible model) right after pin was removed (few seconds to explosion)? and missile eg. sidewinder in flight , like second after launch ?

Share this post


Link to post
Share on other sites

That happens automatically when you throw a grenade or launch a sidewinder. What exactly are you trying to do?

Share this post


Link to post
Share on other sites

As kylania as unless we need to know more.

This will spawn a static missile and if you place bomb enablesimulation true in a trigger it will fire.

bomb = "M_Sidewinder_AA" createVehicle [(getpos player select 0)-4,(getpos player select 1)-4,1];bomb attachto[player]; bomb enablesimulation false;detach bomb

The code for a handgrenade would be a little different. To see the grenade use "grenadehand" instead of "M_Sidewinder_AA". However it will never explode as it's only a graphic and will only exist for around 10secs once bomb enablesimulation true is used.

Share this post


Link to post
Share on other sites

Well , imagine I want to add action for player riding a car as a passenger ,when he activate the option the granade will spawn outside of the car (simulating a granade thrown out of the vehicle) , now that u mentioned the model of granade I'm thinking of delayed explosion on the position of granade model (at least i think that should work ), the missile in flight was for future reference

Share this post


Link to post
Share on other sites

Forget what I said abot the handegrenade not exploding it does it just need a bit of height or velocity which makes things easier.

bomb = "grenadehand" createVehicle [(getpos player select 0)-4,(getpos player select 1)-4,2];bomb setvelocity [0,-10,4]

This will chuck a grenade, for it to work best you will need to use some trig to work out the correct directions to chuck it though. and then use the result in setvelocity to give it the direction.

Share this post


Link to post
Share on other sites

Thank you sir , I'll test it tonight !

checked it and all working fine , now the tweaks , thank you.

Edited by braincrush

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×