Jump to content
Larrow

Eden Composition Spawning

Recommended Posts

Hy Larrow,

 

i hope you are doing well. 

I notice a problem since the last ARMA Updates. The Compositions we spawn are not working correct anymore.

All Vehicles will flip 45 Degress and the positions are not correct also. And some objects or triggers will not spawn.

Objects like buildings and other objects seems to spawn ok. At the moment we found just vehicles and triggers.

 

We use the following code to spawn

comphammer = ["Hammerschlag"] call LARs_fnc_spawnComp;

 

This spawn works 2 month ago without any problems.

 

Include in Composition

  • Units
  • Vehicles
  • Waypoints (move)
  • Trigger

Do you have any ideas how we can solve this?

 

ArmA_3_Screenshot_2020.05.11_-_10.39.12.

 

Kind regards

Baker

Share this post


Link to post
Share on other sites

Thanks @pierremgi

 

this code

this setVelocityModelSpace [0,0,0];

 

did it. With that code in init from each vehicle spawn will work fine again.

Many thanks.

Share this post


Link to post
Share on other sites
On 5/10/2020 at 6:52 PM, Cobra Commander said:

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


Yes you can spawn the comp in on server start but you wont get the results you want. Arma requires playable units to be defined in the mission file. Below are links to how to spawn your comp in on load. You can write your own script to identify the units from the comp that you want to replace with the mission created playable units. Copy the comp units loadouts and positions and then apply that to the playable units from the mission file. Players shouldn't know the difference.

This lists the files that allow you call scripts at specific times in the order of initialization.

https://community.bistudio.com/wiki/Initialization_Order
 

This is for registering functions and when they should be called. Search the page for "postInit".
https://community.bistudio.com/wiki/Arma_3_Functions_Library

 

 

Share this post


Link to post
Share on other sites

Sup Larrow! In first place, must say that this works like a charm.

 

I've noticed that if you have smoke or fire modules in the composition (from modules > effects on EDEN), they do not "start" upon composition placement. 

Found a workaround that want to share with you:

 

_compReference = [ .... ] call LARs_fnc_spawnComp;

{
	_x setvariable ["BIS_fnc_initModules_activate", true];
} forEach (nearestObjects [_compPosition, ["ModuleEffectsFire_F", "ModuleEffectsSmoke_F"], _compRadius, true]);

I hope it helps.
Thanks again for your work, man.


- edit -
Tested in SP and MP, and works.

Share this post


Link to post
Share on other sites
13 hours ago, kaleb c0d3 said:

I've noticed that if you have smoke or fire modules in the composition (from modules > effects on EDEN), they do not "start" upon composition placement. 

Found a workaround that want to share with you:

Strange, that should already be accounted for in fn_spawnLogic. Added note in my development branch to check out next time I do an update. Thanks for the heads up.

 

To save doing a nearestObjects around the composition area, which could possibly pick up other things not actually spawned via the composition, you can always use the utility function to get all spawned composition objects. Then check their type for the effect modules.

_compReference = [ .... ] call LARs_fnc_spawnComp;

{
	if ( toLowerANSI typeOf _x in [ "moduleeffectsfire_f", "moduleeffectssmoke_f" ] ) then {
		_x setVariable ["BIS_fnc_initModules_activate", true];
	};
} forEach ( _compReference call LARs_fnc_getCompObjects );

 

Share this post


Link to post
Share on other sites
On 10/8/2020 at 7:49 AM, Larrow said:

Strange, that should already be accounted for in fn_spawnLogic. Added note in my development branch to check out next time I do an update. Thanks for the heads up.

 

To save doing a nearestObjects around the composition area, which could possibly pick up other things not actually spawned via the composition, you can always use the utility function to get all spawned composition objects. Then check their type for the effect modules.


_compReference = [ .... ] call LARs_fnc_spawnComp;

{
	if ( toLowerANSI typeOf _x in [ "moduleeffectsfire_f", "moduleeffectssmoke_f" ] ) then {
		_x setVariable ["BIS_fnc_initModules_activate", true];
	};
} forEach ( _compReference call LARs_fnc_getCompObjects );

 

You're welcome.
Ok... maybe they do not start because my way of implementing it. I've made a dynamic mission objective module, wich do it's thing inside a function declared with postInit = 1 (where after some config data fetching, it calls LARs_fnc_spawnComp). As far as I understand, it should work ok, but Arma engine has it's own witchcraft. 
I will implement the getCompObjects call to make it right, but I'm not having that problem because I clean the area prior the placement (I've extended the composition definition config to add some parameters, for example the center offset and "clearArea=true").
An example:
 

class CfgCompositions {
	// ---- Base Compositions Classes [DO NOT EDIT THIS!] ---------------------
	class BaseComposition {
		enabled = true;               // Can this be used by DynamicOps module?
		compType = "none";            // Can be one of: none, roadblock, fob, ....
		aiAreaRadius = 50;            // Radius used to estimate the AI occupation zone.
		areaRadius = 20;              // Radius of the composition area. 
		centerOffset[] = {0, 0, 0};   // Center Offset for the composition
		hideExisting = false;         // Hide existing world objects inside composition area?
	};
    
    // ---- FOBs --------------------------------------------------------------
    class FOB_01 : BaseComposition {
		compType = "fob";
		areaRadius = 30; 
		hideExisting = true;
        #include "fob_01.sqe"
    };
};

 

Share this post


Link to post
Share on other sites

good evening everyone,

I wanted to spawn my compositions, on random locations: everything works perfectly ... except for the elevation.

 

the composition appears well at the place of the marker, in the right orientation, and correctly follow the curves of the terrain ... but it floats above the ground (more or less depending on the original Z of the sqe) ...

I tried the function on an object ... same thing: the z of the composition seems to add to that of the target

 

an idea ?

 

Thank you

 

example of sqe :

 

camp insurgé

base alpha_1

Share this post


Link to post
Share on other sites

Hey, Larrow.

 

I'm attempting to use this script, but I can't seem to spawn any compositions from triggers.

 

Any ideas?

 

Edit: Nvm. Figured it out. Thanks for the script!

Edited by duderide

Share this post


Link to post
Share on other sites

1. Great script, thanks Larrow for your hard work 

 

2. Anyway to diagnose what is specifically causing my "Bad vehicle type" error on compSpawn? Everything else is working fine. 

Share this post


Link to post
Share on other sites

I have a small composition that I'm trying to have spawn in front of the player on the first surface (Terrain or Building) but it just goes through the floor to the terrain. Any possible way to change that?

Share this post


Link to post
Share on other sites

Hey, Larrow. I wanted to thank you for making such a versatile system for spawning compositions. It has been super helpful.

 

I have run into an issue that has been stumping me for a while now though. It could just be user error, but it appears raised turret objects (class O_HMG_01_high_F) do not spawn in the same position as they were placed in the composition. I could be mistaken, but it almost looks like they spawn at their top-left corner instead of their center position. What tends to happen when I spawn them in a composition is the turret gets launched through the air (presumably because it clips into another object). Any ideas?

 

Here's a screenshot and the composition I am working with. I found testing it on Virtual Reality seems to regularly demonstrate the issue.

 

Here's a sample of the parameters I am using:

["CSAT_DEPOT_EXAMPLE", [1000, 1000, 0], 0, true] call LARs_fnc_spawnComp;

 

Thanks for all you've done to keep this project working!

 

Edit:

I have found a hacky fix to the issue. Temporarily disabling the turret's damage and physics simulation seems to work (and it spawns in the correct position, leading me to believe that might not actually be the issue). Then it's just a matter of re-enabling those object attributes and everything seems to be fine.

Edited by ClassyElm
Found a hacky solution to my problem

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

×