Jump to content
Larrow

Eden Composition Spawning

Recommended Posts

_compReference call LARs_fnc_deleteComp;

_compReference holds the returned STRING.

However, you need to make sure _compReference is still valid, not nil, not gone out of scope. Maybe store it somewhere with setVariable or make it a global variable if it's the only comp you're dealing with.

  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, Larrow said:

_compReference call LARs_fnc_deleteComp;

_compReference holds the returned STRING.

However, you need to make sure _compReference is still valid, not nil, not gone out of scope. Maybe store it somewhere with setVariable or make it a global variable if it's the only comp you're dealing with.

So something like this?

//Random composition//
_random_comp = [ "Fire_Area", "Fire_Area_Big"] call BIS_fnc_selectRandom;
_fire_random = _random_comp;

//Spawn composition//
_random_fire_reference = [_fire_random, location1] call LARs_fnc_spawnComp;

missionNamespace setVariable ["random_fire", _random_fire_reference];

//***other code***//

//Delete composition//
missionNamespace getVariable "random_fire";
"random_fire" call LARs_fnc_deleteComp;
hint format ["Composition cancelled %1", random_fire];

Problem is that "_random_fire_reference" has a unique value and in the debug hint I get "Fire_Area_1" or "Fire_Area_Big_0" and the composition is not actually deleted. I would actually need the composition to be randomly chosen to be spawned and deleted every time the script is called.

Share this post


Link to post
Share on other sites
//Random composition//
_random_comp = selectRandom [ "Fire_Area", "Fire_Area_Big"];

//Spawn composition//
random_fire_reference = [_random_comp, location1] call LARs_fnc_spawnComp;

//***other code***//

//Delete composition//
random_fire_reference call LARs_fnc_deleteComp;
hint format ["Composition cancelled %1", random_fire_reference];

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks man you are a legend!

Quote

Feel I have helped you and would like to donate for my time you can Buy me a Beer here. 

thanks for your help.

  • Thanks 1

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

×