Jump to content
Larrow

Eden Composition Spawning

Recommended Posts

Hey, Larrow. You did an awesome job!!
I have only one simple problem. The delete function doesn't delete the destroyed items :/. Is there any way to fix that?

Share this post


Link to post
Share on other sites
15 hours ago, JeyR said:

The delete function doesn't delete the destroyed items

Can you give me an example class? Are we talking buildings?

Share this post


Link to post
Share on other sites

Sorry for the late reply, I have been busy working on my mission with your awesome script.
There you go some class names that doesn't work: Land_HBarrierTower_F, Land_Device_assembled_F,Land_Campfire_F,Land_GarbageBarrel_01_english_F,Land_i_Shed_Ind_F, 
And the same goes for boxes. I didn't have the time to test everything.

I also have one more problem, maybe you can give me a suggestion,

I have this :
 


//_taskobjective is a classname randomly selected from array, 
_blockade = ["blockade1"] call LARs_fnc_spawnComp;
_comp = [_taskobjective,getPos _guard, [0,0,0], random 360, true, true ] call LARs_fnc_spawnComp;

... Later in code : 

[ _comp ] call LARs_fnc_deleteComp;
[_blockade] call LARs_fnc_deleteComp;

My problem: The "_comp" gets deleted, everything is working perfectly, but I get an error when It wants to delete the "_blockade".
 


13:26:56 Error in expression <
{
if ( !isNil "_x" && { _x select 0 == _compReference } ) exitWith { LARs_spawn>
13:26:56   Error position: <_compReference } ) exitWith { LARs_spawn>
13:26:56   Error Undefined variable in expression: _compreference
13:26:56 File LARs\functions\Utilities\fn_deleteComp.sqf [LARs_fnc_deleteComp], line 58
13:26:56 Error in expression <l" ];
params[ "_compReference" ];

if ( _compReference isEqualType objNull ) exi>
13:26:56   Error position: <_compReference isEqualType objNull ) exi>
13:26:56   Error Undefined variable in expression: _compreference
13:26:56 File LARs\functions\Utilities\fn_deleteComp.sqf [LARs_fnc_deleteComp], line 6
  
  [_blockade] call LARs_fnc_deleteComp;
} 
>
13:26:56   Error position: <_blockade] call LARs_fnc_deleteComp;
} 
>
13:26:56   Error Undefined variable in expression: _blockade


I am sure it is something very stupid that I forget to use, or something similar, so I would appreciate some help.

Share this post


Link to post
Share on other sites
10 hours ago, JeyR said:

There you go some class names that doesn't work: Land_HBarrierTower_F, Land_Device_assembled_F,Land_Campfire_F,Land_GarbageBarrel_01_english_F,Land_i_Shed_Ind_F, 

Ta Ill have a look when I can.

 

10 hours ago, JeyR said:

but I get an error when It wants to delete the "_blockade".

The error shows that _blockade is undefined even before you call my code.

[_blockade] call LARs_fnc_deleteComp;
} 
>
13:26:56   Error position: <_blockade] call LARs_fnc_deleteComp;
} 
>
13:26:56   Error Undefined variable in expression: _blockade

You would need to show the rest of your code for me to help you understand why your reference is undefined.

Share this post


Link to post
Share on other sites
if(current_task == "bigmarker6" || current_task == "smallmarker10") then
{	
	_blockade = ["blockade1"] call LARs_fnc_spawnComp;

	if(current_task == "bigmarker6") then {_null = []execVM "eos\blockade_rus.sqf"; } else{_null = []execVM "eos\blockade_ins.sqf";};
};

//current_task is a randomly selected marker

// this is in compositions.cfg: 
//////
class blockade1{
		#include "blockade1.sqe"
	};
//////

// later in the code : 

[_blockade] call LARs_fnc_deleteComp;

if you want the Whole script, then check out this link: https://pastebin.com/hADbqqch

I didn't want to post that here because it's quite big,

P.S : this is what I tried first instead of: [_blockade] call LARs_fnc_deleteComp --->
 

// copy the marker before changing it : 

_premarker = current_task;

//after the mission is completed: 

if(_pretaskmarker == "bigmarker6" || _pretaskmarker == "smallmarker10")then{ [ _blockade ] call LARs_fnc_deleteComp; };

 

Share this post


Link to post
Share on other sites

As _blockade is only set within the IF statements scope {} the variable is only defined within this scope. Once outside (further on in your code) it will be undefined (nil).

Easiest fix would be to private the variable at the top of your script, this will make it defined within the whole of your script, although still nil until it is set by the call in the IF statement.
 

private["_blockade"];

if(current_task == "bigmarker6" || current_task == "smallmarker10") then
{  
    _blockade = ["blockade1"] call LARs_fnc_spawnComp;

    if(current_task == "bigmarker6") then {_null = []execVM "eos\blockade_rus.sqf"; } else{_null = []execVM "eos\blockade_ins.sqf";};
};

//snip

[ _blockade ] call LARs_fnc_deleteComp;

 

Share this post


Link to post
Share on other sites

Hallo Larrow, thanks for the great stuff.

I have one problem with spawning a composition. I greate a composition with the new Praetorian 1C AAA (Mk-49 Spartan SAM or Mk-21 Centurion SAM). I create them empty and instead of a BLUFOR unit, I set in a OPFOR unit. Now the problem is when I want to creat it in my Mission, the OPFOR guy isn't inside the Praetorian 1C AAA (Mk-49 Spartan SAM or Mk-21 Centurion SAM). Everthing else work awsome. Mayby you know the problem what I'm doing wrong?

Share this post


Link to post
Share on other sites

Hey Larrow !

Thanks for this amazing script, works great.

 

I figured you would know a little something about compositions, I have a problem with the creation itself within the Eden Editor.

Sometimes when I create a new composition in the Editor, I save it as composition but after I place it again directly into the Editor (maybe to just look at it or to change some things)

some objects start to have weird offsets (in height) . So I place it, fix the floatin objects, save it, but they will float anyway again. Happend to Ais, to crates, sandbags ...

 

One example: I have shipping container and one Ai guard standing on top of it. When I spawn it in again (In the Editor, not via script) the Ai floats above the container (actually it floats above the container as high as the containers height, like it would add both heights). Then on a different sample it works greate again, but then the other Ai floats again and so on and so on.

 

There seems to be something going on while saving the actual compositions in the editor, something weird ....

Share this post


Link to post
Share on other sites

Is the Startis mission from dropbox the latest version of this script or is there a github repo or something similar where I can find updates?

Share this post


Link to post
Share on other sites

Hello,

Great tool, its awesome. I am having a few issues using it though. Im pretty sure its due to my lack of understanding of how all this arma 3 scripting works. When I spawn in a composition using the action menu or using a trigger, the elements that were in side of structures are dropping in from the roof or just hovering above the roof. how do i fix that.

 

also i wrote some script to randomly call my compositions. Each of the compositions has a trigger that when all opfor are dead then call my function and load in another composition. however when i spawn in the composition the trigger keeps firing and continuously spawning in compositions.

 

Another issue is that i cant figure out how to use your code to spawn the composition location from exactly where it was made at. I am using some very unpleasant methods, such as markers to create composition then load back and finds it cords using my mouse. not the best.

 

any help will be appreciated.

Again awesome tool, i just don't understand how to use it yet.

Share this post


Link to post
Share on other sites

I am using LARS compositions spawn-er and it has stopped working.

here is the error message

_wp |#|setWaypointCombatMode _mode;

_wp setWayp...

Error Foreign error: Unknown enum value: ""

File LaRs\Functions\fn_createComp.sqf [LaRs_fnc_createComp], line 1201

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

 

here is the code from LaRs\Functions\fn_createComp.sqf. Line 1201 is highlighted. Let me know if the whole file is required.

//*****
//WAYPOINTS
//*****
private _fnc_spawnWaypoint = {
    private [ "_position", "_ATLOffset", "_placement", "_compRadius", "_mode", "_formation", "_speed", "_behaviour", "_description", "_condition" ];
    params[ "_cfg", "_group" ];

    _position = getArray( _cfg >> "position" );
    _ATLOffset = getNumber( _cfg >> "atlOffset" );
    //_position = [ _position, _ATLOffset ] call _fnc_getPosition;
    _position = [ objNull, _position, [0,0,0], _ATLOffset ] call _fnc_setPositionandRotation;
    _placement = getNumber( _cfg >> "placement" );
    _compRadius = getNumber( _cfg >> "completitionRadius" );
    _mode = getText( _cfg >> "combatMode" );
    _formation = getText( _cfg >> "formation" );
    _speed = getText( _cfg >> "speed" );
    _behaviour = getText( _cfg >> "combat" );
    _description = getText( _cfg >> "description" );
    _condition = [ ( _cfg >> "expCond" ), "TXT", "true" ] call _fnc_getCfgValue; //TODO: does this need defering

    private [ "_onAct", "_name", "_script", "_timeout", "_show", "_type" ];

    _onAct = getText( _cfg >> "expActiv" );
    _name = getText( _cfg >> "name" );
    _script = getText( _cfg >> "script" );
    _timeout = [ getNumber( _cfg >> "timeoutMin" ), getNumber( _cfg >> "timeoutMid" ), getNumber( _cfg >> "timeoutMax" ) ];
    _show = getText( _cfg >> "showWP" );
    _type = getText( _cfg >> "type" );

    private [ "_effectCondition", "_effectSound", "_effectVoice", "_effectSoundEnvironment", "_effectMusic", "_effectTitle", "_wp" ];

    _effectCondition = getText( _cfg >> "Effects" >> "condition" ); //TODO: does this need defering
    _effectSound = getText( _cfg >> "Effects" >> "sound" );
    _effectVoice = getText( _cfg >> "Effects" >> "voice" );
    _effectSoundEnvironment = getText( _cfg >> "Effects" >> "soundEnv" );
    _effectMusic = getText( _cfg >> "Effects" >> "track" );
    _effectTitle = getText( _cfg >> "Effects" >> "title" );

    _wp = _group addWaypoint[ ASLToATL _position, _placement, count waypoints _group, _name];
    _wp setWaypointType _type;
    _wp setWaypointCompletionRadius _compRadius;
    _wp setWaypointCombatMode _mode;
    _wp setWaypointFormation _formation;
    _wp setWaypointSpeed _speed;
    _wp setWaypointBehaviour _behaviour;
    _wp setWaypointDescription _description;
    _wp setWaypointStatements[ _condition, _onAct ];
    _wp setWaypointTimeout _timeout;
    _wp showWaypoint _show;
    _wp setWaypointScript _script;

 

    //TODO: Effects need testing
    _wp setEffectCondition _effectCondition;
    _wp setSoundEffect [ _effectSound, _effectVoice, _effectSoundEnvironment, "" ];
    _wp setMusicEffect _effectMusic;
    switch ( true ) do {
        case ( isClass( missionConfigFile >> "RscTitles" >> _effectTitle ) ) : {
            _wp setTitleEffect [ "RES", "", _effectTitle ];
        };
        case ( isClass( configFile >> "CfgTitles" >> _effectTitle ) ) : {
            _wp setTitleEffect [ "OBJECT", "", _effectTitle ];
        };
        default {
            if ( _effectTitle != "" ) then {
                _wp setTitleEffect [ "TEXT", "PLAIN", _effectTitle ];
            };
        };
    };

    _wp
};

//**********

 

Edited by LifeSnatcher
forgot to highlight line where error happens

Share this post


Link to post
Share on other sites

Hey all, hopefully i'm posting in the right area.  I mod DUWS-R into other mods like IFA3, FOW and UNSUNG.  I noticed a new bug since the last DLC update that returns an enum error -  Error Foreign error: Unknown enum Value "" line 11 or sometimes line 5 depending on what map I put DUWS-R onto.

Here is the script code

// _center = createCenter sideLogic;   un center existe déjà

 

// create && synchronize HC
_grplogic = createGroup sideLogic;
_hc_module = _grplogic createUnit ["HighCommand",[0,0,0] , [], 0, ""];
_hc_module synchronizeObjectsAdd [player];
// done,

 

// make 1 HC subordinate so that the player will not control all blufor forces
_grplogic = createGroup sideLogic;
_sub_module = _grplogic createUnit ["HighCommandsubordinate",[0,0,0] , [], 0, ""];          //- line 11          
_sub_module synchronizeObjectsAdd [_hc_module];

 

In DUWS you can spawn High command squads and now when you start the game you gain control of all forces on your side as tht HC subordinate part of the code is not working.  Strangely the bug doesn't occur all the time, the error message does every time but maybe 10-20% of the time you do not gain control of all squads from the start of the game.

 

Is there a fix for this?  Its doing my head in.  I guess the script that defines what squad spawns may need some changing as well.....not sure, I'm more of a modder to code than a coder.  Would like to fix this soon as I'm making a new WW2 version set in the Pacific as a Christmas present to my subscribers.

Share this post


Link to post
Share on other sites
On 6/12/2017 at 4:51 AM, LifeSnatcher said:

I am using LARS compositions spawn-er and it has stopped working.

here is the error message

_wp |#|setWaypointCombatMode _mode;

Bump! Same error here :(

 

The composition process is ok, but sometimes, some objects moves sideways! For example, a lorry tips on a side.

 

Thank you.

Share this post


Link to post
Share on other sites

Hey I can spawn compositions alright and it works like a charm, but the deleting function doesn't work. I've tried it with very simple test compositions including a small group of AIs and a marker. The composition spawns as expected but won't get deleted. Are you still supporting this awesome script?
EDIT: the deleting function DOES work properly I was just not using it properly, my bad.
Markers won't get spawned properly though, only the text will show, not the marker pic.

Share this post


Link to post
Share on other sites

@davidoss objects grabber and objects mapper aren't anywhere as efficient as this script is.

After further testing:
Triggers have some issues, condition "NOT PRESENT" is not passed "PRESENT" is set instead.
Trigger owners are not recorded. @Larrow commented his code on this.
Trigger timeout is not set. (though from my testing its correctly grabbed from the sqe)

Share this post


Link to post
Share on other sites
3 hours ago, Mr H. said:

@davidoss objects grabber and objects mapper aren't anywhere as efficient as this script is.

After further testing:
Triggers have some issues, condition "NOT PRESENT" is not passed "PRESENT" is set instead.
Trigger owners are not recorded.

Yes, far too old functions (Arma 2).  3den did some improvements from then. Good enough to place some empty objects.

Share this post


Link to post
Share on other sites
18 minutes ago, pierremgi said:

Yes, far too old functions (Arma 2).  3den did some improvements from then. Good enough to place some empty objects.

 

I cant agree.

I am spawning whole bases and other compositions with.

What is not there are alignment to the ground.

This can be achieved by snipped as function are returning objects array.

Share this post


Link to post
Share on other sites

yes but the script also grabs triggers and their parameters, units and their waypoints & loadouts, init scripts; in short EVERYTHING. You can use it to spawn whole missions, which is what I'm using it for, and objectsgrabber just won't do that

  • Like 1

Share this post


Link to post
Share on other sites

I am very impressed by the power of this script. I am using it for a quick and easy way of locally spawning AI on the HC machine, getting around any of the numerous issues with setowner transfer between server and HC.

The only thing is that for live spawning the performance is quite poor due to direct cfg reads. Wouldn't the script would be much faster and less intensive to run if the cfg data was stored in arrays (server or HC local) so that the spawning portion of the script read only from other sqf and missionconfigfile data instead of sqe every time? Or is there a way to preload sqe data to make it quicker to access I am missing?

Share this post


Link to post
Share on other sites

30/10/2018 - All new refactor of code...

  • Some changes to positional calculations
  • Added missing unit attribute for stance
  • Added AI Radar use
  • Added remote sensor attributes
  • Fixed errors from BI enumeration changes
  • Fixed trigger and waypoint effect errors in console
  • Added missing trigger isServer attribute
  • Like 2
  • Thanks 2

Share this post


Link to post
Share on other sites
On 30/10/2018 at 1:15 PM, Larrow said:

30/10/2018 - All new refactor of code...

  • Some changes to positional calculations
  • Added missing unit attribute for stance
  • Added AI Radar use
  • Added remote sensor attributes
  • Fixed errors from BI enumeration changes
  • Fixed trigger and waypoint effect errors in console
  • Added missing trigger isServer attribute

Thank you Larrow! Did you feel guilty in the last few days? hahah :P

Share this post


Link to post
Share on other sites

01/11/2018

    Added new parameter to LARs_fnc_spawnComp to allow ignoring of composition items ATLOffset to enable spawning of building decors.

    See included example map test_houseFurniture.VR for setup

  • Like 2

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

×