Jump to content
Larrow

Eden Composition Spawning

Recommended Posts

04/12/2018 - Fixed spawning of modules due to changes in module framework for A3 1.86

  • Thanks 3

Share this post


Link to post
Share on other sites

I am having a few issues with this script currently. First, if I let the comp spawn on its original spawn position, I get the error of "Error Zero Divisor" and nothing spawns.

If I define a marker it throws an error on getCompPosition line 12.

If I define coords it throws an error on line 41 of getCompPosition.

No matter what I do to designate a location, it will not spawn. Any ideas? thanks.

Share this post


Link to post
Share on other sites

Show me your calls to LARs_fnc_spawnComp for each mentioned above.

Share this post


Link to post
Share on other sites

Hey @Larrow  could you make it so that the spawner also looks for comps in configfile so we can store them in an addon?

Share this post


Link to post
Share on other sites
40 minutes ago, Mr H. said:

Hey @Larrow  could you make it so that the spawner also looks for comps in configfile so we can store them in an addon?

Sure I have it already done via BIS_fnc_loadClass, will be in next release.

I'm currently in the middle of caching compositions into a data array either at mission init by CfgComposition value or on first use, to eliminate config lookups.

Have several other things going on so soon™.

  • Like 3

Share this post


Link to post
Share on other sites

You are just the perfect man @Larrow and thanks to you I have just learnt about BIs_fnc_loadClass which will change my life for the better in the future! 😉

Share this post


Link to post
Share on other sites

There is any update available of this script?

 

update  26/05/2019

Look's like no.

 

Look like the LARs_fnc_deleteComp do not delete active mines, or I miss something?

Share this post


Link to post
Share on other sites

Hellow Larrow, I found an intersting function BIS_fnc_3DENExportSQF in Eden editor. It works like your script with some difference (link: https://community.bistudio.com/wiki/BIS_fnc_3DENExportSQF). I cant figure out how to use black list units or layers. Mabye you know how to do it ? For example I have mission with layers witn names BASE and MISSION. How I can convert to sqf only MISSION layer and not convert BASE layer. Code: [ true, true, [0,0,0], true ] call BIS_fnc_3DENExportSQF;. Thanks.

Share this post


Link to post
Share on other sites

Hey Larrow, what is your repackaging rules with this script? Is credit enough or is there anything else I am missing? Thanks.

Share this post


Link to post
Share on other sites
54 minutes ago, 1LT D. Repo said:

Hey Larrow, what is your repackaging rules with this script? Is credit enough or is there anything else I am missing? Thanks.

On 7/13/2016 at 8:37 PM, Larrow said:

Of course you are welcome to use it however you like, a mention is always welcome. Now wheres the WTFYL(What The F*** You Like) license i saw some one use the other day,made me laugh. 

 

 

Share this post


Link to post
Share on other sites

i'm having an issue where my placement of objects is not always being respected. I am using your most recent code source. If you could tell me what configuration settings im applying wrong when calling the function i would be most grateful. Ive tried a variation of combinations but none seem to place my object correctly.
here is what it looks like.
https://imgur.com/Zx3oz3a
 

we have your spawn er in our server side addon. we use it to spawn full missions, everything but this works great. we have been avoiding placing objects in complex positions in our 100+ missions up until now. we would really like to be able to place objects freely if possible.

we have tried this combination in many different ways

//spawn missoin and get comosition id

private _compRef = 

[

    _mission_name,

    [],

    [0,0,0],

    0,

    false,

    false,

    false

] call LARs_fnc_spawnComp;

Share this post


Link to post
Share on other sites

We use this spawner as an essential part of our framework to spawn our missions on our multiplayer server. With out it we would be screwed. Having said that we have some difficulties with it that we could use some help understanding.
In the current downloadable source only the .stratis mission has file changes from December of 2018.

But there is a changes.txt file that says to refrence the .vr mission for the new changes.
But the .vr mission does not have file changes in it from December 2018

But the .vr mission file does use a Boolean for setting the "//TRUE to use positions( OBJECT ) direction" and does not throw errors when used with the Boolean.

The .stratis mission does have a comment in it for using Boolean for direction but does not use it.
we tried to use the following code with both the source from the .stratis mission and the .vr mission but it produces and error provided below.

private _compRef = 

[

    _mission_name,  //Composition to spawn

    [],             //position to spawn, passed OBJECT

    [0,0,0],        //Calculated offset

    true,           //TRUE to use positions( OBJECT ) direction

    false,          //Do NOT align with surface normal

    false,          //Do NOT align with water

    false           //Ignore composition items ATL offset <<NEW parameter see fn_createComp.sqf and fn_setPositionAndRotation.sqf

] call LARs_fnc_spawnComp;
 

We get this error


_cfgOffset = [ _cfgOffset, 360 - _compRot ] call BIS_fnc_rotateVector2D>
  Error position: <- _compRot ] call BIS_fnc_rotateVector2D>
  Error -: Type Bool, expected Number,Array,Not a Number
File \AltisJSOC\LARs\spawnComp\functions\fn_setPositionAndRotation.sqf [LARs_fnc_setPositionAndRotation]..., line 35

 

further more in all three mission the comments describing the available initial function call parameters do not match.
all of this causes us confusion when deciding which code and parameters to use in our framework.
We have been keeping our missions very simple because of some issues we have encountered but we would like to start creating more complex missions using this spawner.

There are more than a few big issues we have encountered so far.
One, we cant use complex way points. its not the end of the world so we keep it simple and rely on our framework to do complex stuff.
Two, when spawning AI in vehicles they dont always execute their simple move way points. We found that this is because the squad leader inst in the right seat. This could be a multiplayer Arma issue. we had to write a fix for this.
Three, when spawning in a lot of ai in vehicles over/in water there is lag and they seem to fall from the sky and die. no fix for this currently
Four, we can not for the life of us figure out the right combination of spawn settings to ensure our objects are where we placed them in the Eden editor. We have to take great care to snap objects in the eden editor but still this dosent always work. it effects both AI and objects.

We love this script but we could use some enlightenment so that we can expand our capabilities on our framework and continue to use this awesome script.

Share this post


Link to post
Share on other sites

I was able to solve the problem with vehicles not executing their way points. I did this by checking each vehicle with a squad leader in it and making the driver/commander/or gunner the squad leader. if anyone needs this code just message.

regarding aircraft crashing after spawn. It occurs when there are alot of units to spawn so lag. what i did was modified the spawner to put planes at 2k or 3k altitude after spawn and helicopters at 700 meters.

 

regarding spawning items issues i found that it was in part because of my misunderstanding of the spawner settings and also i had to put a line of code in the spawn when spawning big objects to align to terrain.

Share this post


Link to post
Share on other sites

@lifeSnatcher. Depending on mods you're using. Some of them don't sim aircraft with velocity when you spawn them. You need to use setVelocityModelSpace on them, right after spawning them (I guess you already have a crew, of course). Something like _yourVeh setVelocityModelSpace [0,150,0]; It's better than spawning them at high altitude, hoping they have time to run the engine and pull on the stick before crash.

Share this post


Link to post
Share on other sites

@pierremgi we have no thirdparty mods. Im simply letting others know of solutions for working with this mission spawner. i know how to spawn things in. Using this awesome spawner though i try not to mess with its code. the slight adjustments allow us to spawn compositions with 300 AI and tons of objects and waypoints. its great now.

Share this post


Link to post
Share on other sites

Hey @Larrow, after downloading this it looks like the example in your instructions :

On 6/22/2016 at 3:11 PM, Larrow said:

 


class CfgFunctions {
    #include "LARs\LARs_spawnComp.cpp"
};

#include "compositions\compositions.cfg"

 

 

Should read:

class CfgFunctions {
	#include "LARs\spawnComp\functions\functions.cpp"
};

#include "compositions\compositions.cfg"

 

Caught that one after I was crashed back to Windows 😄

 

Edit: Also, it's not picking up a unit's goggles/eyewear.

  • Like 1

Share this post


Link to post
Share on other sites
7 hours ago, beno_83au said:

Hey @Larrow, after downloading this it looks like the example in your instructions :

Should read:

Ta, forgot to update posts instructions when I changed the layout of the package.

 

8 hours ago, beno_83au said:

Edit: Also, it's not picking up a unit's goggles/eyewear.

Not seeing this. You can load up the test mission and use the addAction "Inventories" which spawns a "B_Soldier_A_F" with modified goggles, hmd and headgear and they are all applied correctly.

  • Like 2

Share this post


Link to post
Share on other sites
3 hours ago, Larrow said:

Not seeing this. You can load up the test mission and use the addAction "Inventories" which spawns a "B_Soldier_A_F" with modified goggles, hmd and headgear and they are all applied correctly.

 

To be fair, I had a couple of mods running, so I'll revisit it clean. 

Share this post


Link to post
Share on other sites

This is really cool.  I could use some help though.  I built a FARP that I want to have assigned to a container (add action) and have the player interact with it to spawn the FARP.  I got that working but not the removal part.

 

For the removal I get the following error:

Spoiler

'...target",

"_caller",

"_id",

File LARs\sawnComp\functions\utility\fn_deleteComp.sqf

[LARs_fnc_deleteComp]..., line 43

"_args"

];

[ |#|_FARP ] call LARs_fnc_deleteComp;

Error Undefined variable in expression

 

 

Here is my code:

FARPBOX addAction [ "Build the FARP", 
			{params
			[
			"_target",
			"_caller",
			"_id",
			"_args"
			];
			private["_FARP"];
			_FARP = ["WFARP",getPosATL FARPBOX,[0,0,-1.5],5,false,true,true ] call LARs_fnc_spawnComp;
			[ _FARP ] call LARs_fnc_spawnComp;
			},
	[],
  	1.5, 
 	true, 
  	true, 
    	"",
    	"true", // _target, _this, _originalTarget
    	50,
    	false,
    	"",
    	""
		];
FARPBOX addAction [ "Dismantle the FARP", 
			{params
			[
			"_target",
			"_caller",
			"_id",
			"_args"
			];
			[ _FARP ] call LARs_fnc_deleteComp;
			},
	[],
	1.5, 
	true, 
	true, 
	"",
	"true", // _target, _this, _originalTarget
    	50,
    	false,
    	"",
    	""
		];

Thanks

Share this post


Link to post
Share on other sites
4 hours ago, woulffman said:

_FARP = ["WFARP",getPosATL FARPBOX,[0,0,-1.5],5,false,true,true ] call LARs_fnc_spawnComp;
[ _FARP ] call LARs_fnc_spawnComp;

 

Why do you call the spawn comp function twice? Just remove the second one.

 

The reason it will not delete is becuase _farp is a local variable that is only defined inside the "build farp" actions codes scope, so is undefined inside the "dismantle farp" actions code.

Instead save the reference to the spawned comp in a variable on the box, and retreive it from the box when deleting it.

Spoiler

FARPBOX addAction[ "Build the FARP", {
		params[ "_target", "_caller", "_id", "_args" ];
		
		_FARP = [ "WFARP", getPosATL _target, [0,0,-1.5], 5, false, true, true ] call LARs_fnc_spawnComp;

		//Store reference to farp on box
		_target setVariable[ "FARP", _FARP ];
	},
	[],
	1.5, 
	true, 
	true, 
	"",
	//Only show action if farp has not yet been built
	"isNil { _target getVariable 'FARP' }",
	5
];

FARPBOX addAction [ "Dismantle the FARP", {
		params[ "_target", "_caller", "_id", "_args" ];
		
		//Retrieve farp reference from box
		_FARP = _target getVariable "FARP";

		[ _FARP ] call LARs_fnc_deleteComp;

		//Reset stored variable
		_target setVariable[ "FARP", nil ];
	},
	[],
	1.5, 
	true, 
	true, 
	"",
	//Only show the action if the farp has already been built
	"!isNil { _target getVariable 'FARP' }",
	5
];

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for the great scripts and help!  I posted a quick video of the finished product.

FARP

Share this post


Link to post
Share on other sites

Larrow,

 

I have my script working in single and was moving to server.  I changed the "isServer" to what you mentioned earlier in the thread.

Spoiler

if !( isServer ) exitWith {
    //RE function on server
    _this remoteExec[ "LARs_fnc_spawnComp", 2 ];

};

The composition builds fine but now does not delete.  Can you help with what I'm missing?

 

Thanks

Share this post


Link to post
Share on other sites

Is it possible to have a delay between each component of a composition being spawned?

 

Thanks

Share this post


Link to post
Share on other sites
22 hours ago, woulffman said:

The composition builds fine but now does not delete.

See this previous post that covers a similar problem.

Your remoteExecuting spawnComp without saving the comp reference. The comp reference will only be known by the script where spawned( server ), so deleting from else where will not work.

 

1 hour ago, woulffman said:

Is it possible to have a delay between each component of a composition being spawned?

Possible yes, but not without rewriting parts of the script, and even then the sqe could possibly need manipulating dependant on the order components need to be spawned. Too much to go into in a forum post and not something I have the time to cover, sorry.

  • Like 1

Share this post


Link to post
Share on other sites

Is there anyway to get this script to act before players load in? Not sure how to describe what I am asking. Essentially the composition I am using has our playable slots and I am hoping there is a way to init the script before players hit the lobby screen so they can slot.

Thanks

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

×