Jump to content
Sign in to follow this  
ringoray

Add respawn script to dynamic spawned helo

Recommended Posts

Hey guys, I have created a base using the objectgrabber method. Question is, how would I attach a script to these spawned helos/units/objects? For instance, I want to attach a re-spawn script to the helicopters spawned in at the mission start. Thanks in advance for any help given.

Share this post


Link to post
Share on other sites

Well, how is the respawn script used/called in the first place?

BIS_fnc_objectsMapper returns all the spawned objects, so you would need to do something like:

_objects = [/*objectsGrabber info*/] call BIS_fnc_objectsMapper; 
{[_x] execVM "respawnScript.sqf";} forEach _objects;

Share this post


Link to post
Share on other sites
Well, how is the respawn script used/called in the first place?

BIS_fnc_objectsMapper returns all the spawned objects, so you would need to do something like:

_objects = [/*objectsGrabber info*/] call BIS_fnc_objectsMapper; 
{[_x] execVM "respawnScript.sqf";} forEach _objects;

like this in vehicle init

0 = [this,5] execVM "vehicle_respawn.sqf"

Share this post


Link to post
Share on other sites

Take that and replace:

[_x] execVM "respawnScript.sqf";

With yours (replacing "this" with "_x"):

0 = [_x,5] execVM "vehicle_respawn.sqf";

Keep in mind, this will be applied to all your objects (fortifications, vehicles, etc.), so if you want to limit it to certain things, such as only vehicles, you will need to check the object before applying the script.

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  

×