Results 1 to 8 of 8

Thread: Spawning "Compositions" with a name?

  1. #1
    Gunnery Sergeant LockJaw-65-'s Avatar
    Join Date
    Apr 3 2002
    Location
    Brighouse, West Yorkshire. (UK)
    Posts
    579

    Spawning "Compositions" with a name?

    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..

  2. #2
    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.

    Shit, i don┬┤t read that you tried this way. Shame on me!

  3. #3
    Master Gunnery Sergeant
    Join Date
    Oct 9 2008
    Location
    New york & Florida
    Posts
    1,104
    I don't think you can spawn compostions I have tryed with a few different ways no luck. Hope some knows how.
    AVIBIRD 1

    When playing this game, Keep Chuck Norris home!
    If they make this game, They will play!
    The truth is out there, If you look!

  4. #4
    Gunnery Sergeant LockJaw-65-'s Avatar
    Join Date
    Apr 3 2002
    Location
    Brighouse, West Yorkshire. (UK)
    Posts
    579
    Author of the Thread
    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.
    Last edited by LockJaw-65-; Apr 13 2012 at 19:56.

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


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

  6. #6
    Gunnery Sergeant LockJaw-65-'s Avatar
    Join Date
    Apr 3 2002
    Location
    Brighouse, West Yorkshire. (UK)
    Posts
    579
    Author of the Thread
    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?

  7. #7
    Master Gunnery Sergeant
    Join Date
    Oct 9 2008
    Location
    New york & Florida
    Posts
    1,104
    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 .
    Last edited by AVIBIRD 1; Apr 13 2012 at 20:52.

  8. #8
    Gunnery Sergeant LockJaw-65-'s Avatar
    Join Date
    Apr 3 2002
    Location
    Brighouse, West Yorkshire. (UK)
    Posts
    579
    Author of the Thread
    Quote Originally Posted by fencr0c View Post
    Assuming you know the location of the composition and the area it covers I've used the following in previous missions:


    Code:
    _cmpObj=call(compile(preprocessFileLineNumbers format["compositions\%1.sqf",name_of_composition_file_without_.sqf));
    {
        {
                deleteVehicle _x;
        } forEach (nearestObjects[location_of_composition,[_x select 0],radius_of_composition);
    } forEach _cmpObj;
    I have tried to use this but it comes up with errors. I assume you run the code via a trigger call?

Similar Threads

  1. CfgVehicles: overriding "accuracy", "camuflage" and "sensitivity"
    By fabrizio_T in forum ARMA 2 & OA : ADDONS - Configs & Scripting
    Replies: 4
    Last Post: Apr 18 2013, 19:21
  2. Spawning "Compositions"
    By bigshotking in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 29
    Last Post: Aug 2 2011, 01:04
  3. Replies: 21
    Last Post: Sep 13 2010, 09:28
  4. Aircraft spawning "Under" carrier? Help!
    By Aodan in forum ARMA 2 & OA : MISSIONS - Editing & Scripting
    Replies: 4
    Last Post: Mar 11 2010, 16:05
  5. Add "LAND", "Up" and "Down" actions to command menu
    By EricM in forum ARMA 2 & OA - SUGGESTIONS
    Replies: 4
    Last Post: Jul 4 2009, 19:01

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •