Jump to content
PortalGunner

Variable from editor placed props [Solved]

Recommended Posts

Hi, I'm creating a mission parameter that deletes all pre-placed props (under Empty) in case our Zeus wants to change our spawns occasionally. 
So far this is what I have in the script:

Spoiler

 


getMissionLayerEntities "Extraneous" params[ "_objects", "_markers" ];
ExObj = (paramsArray select 9);

switch (ExObj) do {
	// Disabled
	case 0:
	{
		{
			deleteVehicle _x;
		} forEach _objects;
		{
			deleteMarker _x;
		} forEach _markers;
	};
	// Simulated
	case 1:
	{
		if (!isServer) exitWith {};
		enableDynamicSimulationSystem false;
	};
	// Dynamically Simulated
	case 2:
	{
		if (!isServer) exitWith {};
		enableDynamicSimulationSystem true;
	};
};

 

 

What would I need to set as _objects to detect props? And will it detect and remove objects I've checked "Simple Object" on as well (if so that would be great)?
I would like to be able to set a variable on objects in the editor to exclude them from this as well.
Any help is appreciated, thanks!

Edit: working code

Share this post


Link to post
Share on other sites

The easiest option is most probably to place all the objects that are removable onto a layer in the editor and get them all during runtime via getMissionLayerEntities.

 

 

Share this post


Link to post
Share on other sites
4 minutes ago, Larrow said:

The easiest option is most probably to place all the objects that are removable onto a layer in the editor and get them all during runtime via getMissionLayerEntities.

I never actually noticed layers were a thing.. You'd think I would have by now. Thanks.
Are objects I've checked "simple object" on in the editor removeable with my above script?

Share this post


Link to post
Share on other sites
2 minutes ago, PortalGunner said:

I never actually noticed layers were a thing.. You'd think I would have by now. Thanks.
Are objects I've checked "simple object" on in the editor removeable with my above script?

You can use allSimpleObjects .

Share this post


Link to post
Share on other sites
29 minutes ago, PortalGunner said:

Are objects I've checked "simple object" on in the editor removeable with my above script?

Yes

getMissionLayerEntities "LayerName" params[ "_objects", "_markers" ];
{
	deleteVehicle _x;
}forEach _objects;
{
	deleteMarker _x;
}forEach _markers;

 

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

×