Eden Composition Spawning
Been working my way through this problem every time i have 5 mins between other stuff.
Looking for testers willing to test out compositions. I have put it through some simple testing and the test mission comes with some examples as player actions.
DOWNLOAD
Save a composition in Eden and then in your profiles folder (usually MyDocuments\Arma 3\) in the compositions folder find its composition.sqe. Copy its .sqe and place it in your mission folder in a folder called Compositions and rename it to something remember-able.
Copy the LARs folder to your mission.
Add to your description.ext..
class CfgFunctions {
#include "LARs\spawnComp\functions\functions.cpp"
};
#include "compositions\compositions.cfg"
Create a file called compositions.cfg in your missions composition folder that you created above and add a class for your composition. e.g
//LARs_spawnComp_debug = 1; //1 = RPT output, 2 = RPT output and ingame visual positioning info
class CfgCompositions {
class Walk { //Name that the composition is spawned by
#include "walk.sqe" //Renamed composition.sqe
};
};
Then when you want to spawn a composition..
_compReference = [ COMP_NAME, POS_ATL, OFFSET, DIR, ALIGN_TERRAIN, ALIGN_WATER, IGNORE_ATLOFFSET ] call LARs_fnc_spawnComp;
Where..
COMP_NAME - Classname given to composition in CfgCompositions
POS_ATL( optional, default compositions saved position ) - Position to spawn composition
If not given or empty array passed then original saved composition position is used
Also accepts OBJECT, MARKER, LOCATION
OFFSET( optional, default none ) - ARRAY [ x, y, z ] ammount to offset composition, as a compositions base pos can vary from what you want when its saved
DIR( optional, deafault 0 ) - Direction to face composition in, If POS_ATL is of type OBJECT, MARKER, LOCATION passing TRUE for direction will use objects direction
ALIGN_TERRAIN( optional, default True ) - BOOL, Whether composition objects should align themselves to their positions surface normal
ALIGN_WATER( optional, default True ) - BOOL, If a composition objects position is over water should they align themselves to sea level
IGNORE_ATLOFFSET( optional, default False ) - BOOL, If True each item in the composition will ignore its ATLOffset that usually gets added to its Z(height)
!FUCNTIONALITY CHANGED!
The function call will also return a reference string for the composition. Which can be used with some of the provided utility functions.
[ _compReference ] call LARs_fnc_deleteComp;
Will delete the composition.
[ _compReference ] call LARs_fnc_getCompObjects
Will return an array of all the compositions items.
[ _compReference, _item ] call Lars_fnc_getCompItem
Passing an Object will return its composition ID or -1 if not found.
Passing an ID will return the object or objNull if not found.
[ _item ] call LARs_fnc_getItemComp
Will return a the reference to the composition the item belongs to or "".
Checking the RPT with LARs_spawnComp_debug = 1 set in the composition.cfg when spawning a composition will display info on the objects spawned. e.g
12:29:04 "spawning - Object B_Soldier_A_F - ID: 51, VarName target1"
Where it displays..
Type being Group, Object, Trigger, Logic, Marker or Waypoint
Classname of object ie B_Soldier_A_F
Composition ID 51
For Object, Trigger, Logic it will show its VehcileVarName if it was spawned with one.
For Group it will display the groupID
For Marker its given name
and Waypoints their waypointName ('identified' option in Eden)
Priority order of which composition items are spawned in.
You may need to get funky with object names, especially markers as they cannot exist twice and things like task names in modules.
Although you can use the utility functions to get a reference to objects and link out side resources yourself as another possible solution.
Again has been put through very limited testing.
As you can see by the examples I have a...
Camp Ant spawning with added foot patrol and a vehicle that executes a waypoint synced to one of the patrols waypoints.
A man that will cycle his route.
A working sector.
A simple task using modules.
A simple mission using modules, a random vehicle spawning at grouped markers with a unit init to moveIn and blowing it up via a trigger when it reaches a waypoint to complete task.
Set up Roadblock, if near a road will spawn a checkpoint aligned with the roads direction.
There are several others that i have written short description for in the CfgCompositions.
Most likely missed loads of stuff 😕 and I know I have not test trigger and waypoint effects.
So if you feel like testing it out and supplying feedback of what is/isnt working(a small example .sqe would be handy for tracking problems down) ... DOWNLOAD as I just do not have the time to test every conceivable permutation myself.
Updates: