Sign in to follow this  
Followers 0
lockjaw-65-

Spawning "Compositions" with a name?

8 posts in this topic

Im having to start a new thread because ive looked through all the compositon threads and not found an answer.

I want to spawn a compostion (this is not a problem) but I need it to have a name so that I can delete it from mission when needed to save performance. I have tried to do it the same way as spawning a vehicle with name but it does not work?

If there is an other way to do this I would be greatful to know..

Share this post


Link to post
Share on other sites

Should be something like:

yourname="yourstuff" createVehicle getMarkerPos "Marker1"

This way it works with all single objects,

yourname
is ofcourse the name you gave. Can be used in scripts and triggers.

:o Shit, i don´t read that you tried this way. Shame on me!

Share this post


Link to post
Share on other sites

I don't think you can spawn compostions I have tryed with a few different ways no luck. Hope some knows how.

Share this post


Link to post
Share on other sites

I have them spawning fine (if you want I can let you know) its just removing them thats the problem?

---------- Post added at 20:15 ---------- Previous post was at 19:48 ----------

This is how I do it. Create a marker on map call it comp1 for example.

then create a trigger that is activated by west present (this can of course be whatever you want)

in the activation field put:

nul = [] execvm "mission1.sqf";

now make a script called mission1,sqf

in the script:

newObjs = [getmarkerpos "comp1", 260, "smallbase"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));

if you want multiple compositions just add more markers and add more code:

newObjs = [getmarkerpos "comp2", 160, "AntiAir1_RU"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));

newObjs = [getmarkerpos "comp3", 160, "Firebase1_RU"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));

You can put the class names to whatever composition you want.

if you want them to be manned by ai put another marker called tr90 very close and add this line to your script:

_group = [getmarkerpos "tr90", EAST, ["RU_Soldier_SL", "RU_Soldier_AA", "RU_Soldier_HAT", "RU_Soldier_HAT", "RU_Soldier_GL", "RU_Soldier_GL", "RU_Soldier_MG", "RU_Soldier_MG", "RU_Soldier_Marksman", "RU_Soldier_LAT", "RU_Soldier_Medic"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;

_patrol = [_group, getmarkerpos "tr90", 100] call BIS_fnc_taskDefend;

the ai will man static weapons.

make sure you have function module placed on map. Also one east man or create centre.

Edited by LockJaw-65-

Share this post


Link to post
Share on other sites

Assuming you know the location of the composition and the area it covers I've used the following in previous missions:

_cmpObj=call(compile(preprocessFileLineNumbers format["compositions\%1.sqf",[b][i]name_of_composition_file_without_.sqf[/i][/b]));
{
   {
           deleteVehicle _x;
   } forEach (nearestObjects[[b][i]location_of_composition[/i][/b],[_x select 0],[b][i]radius_of_composition[/b][/i]);
} forEach _cmpObj;

Share this post


Link to post
Share on other sites

Sounds intresting, im using a trigger over the area where the composition is and it is activated by east not present with a countdown of 600. This is to allow west to be well away from area when deleted. Im not sure how I would incorparate your post into this?

Share this post


Link to post
Share on other sites

thanks for the input I will give that a go. my issue is I use a script that allows me to recruit any object within the game. then I can load it up into containers place it into a truck transport them anywhere on the map to build multiple fire bases. when I am done I have the option to either put them back into the cargo containers or just delete them from the map . I could never get the compositions to spawn in using my script .

Edited by AVIBIRD 1

Share this post


Link to post
Share on other sites
Assuming you know the location of the composition and the area it covers I've used the following in previous missions:

_cmpObj=call(compile(preprocessFileLineNumbers format["compositions\%1.sqf",[b][i]name_of_composition_file_without_.sqf[/i][/b]));
{
   {
           deleteVehicle _x;
   } forEach (nearestObjects[[b][i]location_of_composition[/i][/b],[_x select 0],[b][i]radius_of_composition[/b][/i]);
} forEach _cmpObj;

I have tried to use this but it comes up with errors. I assume you run the code via a trigger call?

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  
Followers 0