Jump to content
Sign in to follow this  
Oleg-Russia

Need help, ai respawn in a vehicle and truck respawn with custom ammo load

Recommended Posts

Hi ,

I`ve added a custom ammo into a truck:

"truck_resupply.sqf"

----------------------------------------

#include "x_setup.sqf"

_vec = _this select 0;
waitUntil {X_Init};
clearMagazineCargo _vec;
clearWeaponCargo _vec;

_vec addweaponcargo ["VSS_vintorez",2];
_vec addmagazinecargo ["20Rnd_9x39_SP5_VSS",10];
_vec addweaponcargo ["SVD_CAMO",2];
_vec addmagazinecargo ["10Rnd_762x54_SVD",30]; 
_vec addweaponcargo ["JAVELIN",1];
_vec addmagazinecargo ["JAVELIN",14];
_vec addweaponcargo ["MetisLauncher",1];
_vec addmagazinecargo ["AT13",10];
_vec addweaponcargo ["Igla",2]; 
_vec addmagazinecargo ["Igla",10];
_vec addmagazinecargo ["Pipebomb",10];
_vec addweaponcargo ["Laserdesignator",2];
_vec addmagazinecargo ["Laserbatteries",5];

After i`ve added a command to a truck in initalization box

nul = [this] execVM "truck_resupply.sqf";

Everything works fine i get my ammo into a truck ,but till the time i gets destroyed ,after first respawn i get a crazy list of ammunition in my truck (all kind of sh$% wich i dont even need), how can i fix it so the truck spawns with ammo as in the list above

And second thing, i do want to add a group/squadron of 2 "A-10"`s (looks cool) wich must be controlled by Enemy AI,i`ve added to the mission 2 "A-10"`s unit ,grouped ,made them "fly" , have placed waypoint to patrol,added to each "A-10" a command in initializing box to make them respawn each time they`ve been shot.

veh = [this, 30, 120, 0, FALSE, FALSE] execVM "vehicle.sqf"

But after 30 second they do not appear in the sky,i do know probably they are getting spawned somewhere in the air but without a pilot which control them,is there any way to fix it?

Plz help

Share this post


Link to post
Share on other sites

The vehicle respawn script is for empty vehicles, not respawning flying vehicles. :)

Share this post


Link to post
Share on other sites

Well i`ve added a Su-25 for example training on the airfield as standing on the ground then i have added a pilot wich will spawn near this plane and get in the jet, the problem is after he gets shut down and for some reasons pilot survives he is not running back to the jet .

I`ve tried to combine some codes.

pilot:

nul = [this, 3, 10, "east_spawn","East_WP.sqf", "Su25"] execVM "AI_respawn\AI_respawn_init.sqf"; onrespawn = [this moveindriver Su25]; oneject = [this moveindriver Su25];

Su-25:

veh = [this, 20, 20, 0, FALSE, FALSE] execVM "vehicle.sqf"

Maybe i should let him go first to the marker near the jet after he ejects and then let him enter the vehicle.Or just write if this command exist ,like "oneject = this makesuicide" :) so he can spawn again ,help plz with some code command wich i can use:)

i have also a problem with spawn of pilot at the marker have done as in readme , doesn`t work

http://forums.bistudio.com/showthread.php?t=77886&highlight=note+alive+unit

Edited by Oleg-Russia

Share this post


Link to post
Share on other sites

You should write a script that spawns the planes and their waypoints or whatever. Then have a trigger that detects if they are destroyed and runs the script again. Trying to use the empty vehicle respawn for this kind of thing isn't really worth it.

Share this post


Link to post
Share on other sites

Is there any example of such trigger because i cant figure them out have spen last 2 days and cant get further,i`m stuck with triggers.

So i need actually 2 examples/scripts

1-script of respawning enemy or script that spawns enemy each 20 minutes

2-example of the trigger

Edited by Oleg-Russia

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  

×