quakergamer 0 Posted August 8, 2003 Hello everyone! I wsa wondering if there is any way to create a missile that gets fired by a script. That's alll Thanks! Share this post Link to post Share on other sites
franze 196 Posted August 14, 2003 Theres a tutorial on ofpec on how to do artillery with real shells, have you looked at it? I checked it out with my rocket artillery once and it didn't work because the missiles were fired with momentum when they were summoned. Share this post Link to post Share on other sites
quakergamer 0 Posted August 14, 2003 Theres a tutorial on ofpec on how to do artillery with real shells, have you looked at it? I checked it out with my rocket artillery once and it didn't work because the missiles were fired with momentum when they were summoned. Ill check it out! Thank you! And BTW if this works, well we would be bale to spawn missiles from cars easil Share this post Link to post Share on other sites
Footmunch 0 Posted August 14, 2003 You can spawn them, the problem is telling the created missile what the target is. For arty, it just has to follow a parabolic path to the bombard point, but if you want to hit a specific moving target that the user has locked, things get more difficult. Share this post Link to post Share on other sites
quakergamer 0 Posted August 14, 2003 You can spawn them, the problem is telling the created missile what the target is. For arty, it just has to follow a parabolic path to the bombard point, but if you want to hit a specific moving target that the user has locked, things get more difficult. Could you post a code sample of the script ? Just spawn a missile that will hit randomly a target at 100 m away. Share this post Link to post Share on other sites
Footmunch 0 Posted August 15, 2003 I haven't got code to hand, but it would look something like: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _manpos =;Position of vehicle/person firing the missile _targetpos =;Position of target ; Create the missile _missile = "MyMissile" createvehicle[_manpos] ; Each velocity is set by the distance in each co-ord _velx = (_targetpos select 0) - (_manpos select 0) _vely = (_targetpos select 1) - (_manpos select 1) _velz = (_targetpos select 2) - (_manpos select 2) ; Push the missile in this direction _missile setvelocity[_velx, _vely, _velz] ; And point the missile to go here as well _missile setdir (atan (_vely/_velx)) You'll probably have to do some height coding as well for all situations, but if you try this on a nice, flat island, it may work. Share this post Link to post Share on other sites