Jump to content
Sign in to follow this  
jaaxxxxon

XmedSys on spawned units

Recommended Posts

Hello all,

So I'm working on a training map for my group, and part of this map entails a medical training area for XmedSys. Instead of shooting each other, my idea was to have AI victims to practice on.

I'm using the Murkspawn script to spawn in an AI via a addaction option on a laptop (got this to work) but what I can't get to work is initializing the XmedSys on a spawned AI. The function that does it "this call X39_MedSys_fnc_initializeUnit;" running on in the unit's init. I've tested this, and it works on placed units - however, with murkspawn (and any dynamically placed units) adding this to the init field does nothing.

My questions are:

1 - Is there a way to use this function on dynamically spawned units?

2 - Can it be used with murkspawn?

3 - If it can't be used with murkspawn, are there any alternatives?

Share this post


Link to post
Share on other sites

the reason no body has answered is because not everyone uses xmed ...

anyway all I can suggest is this

put it in your init.sqf

[] spawn 
{
while {true} do 
{
	{
		if (!(isPlayer _x) && (_x == vehicle _x) && (isNil {_x getVariable "xmed39_added"})) then {_x call X39_MedSys_fnc_initializeUnit; _x setVariable ["xmed39_added",true,true];};
	}forEach allUnits;
	sleep 5;
};
};

EDIT #1

Optional other way

[] spawn 
{
private "_x39_countCurrentUnits";
while {true} do 
{
	{
		if (!(isPlayer _x) && (_x == vehicle _x) && (isNil {_x getVariable "xmed39_added"})) then {_x call X39_MedSys_fnc_initializeUnit; _x setVariable ["xmed39_added",true,true];};
	}forEach allUnits;
	_x39_countCurrentUnits = allUnits;
	waitUntil {allUnits != _x39_countCurrentUnits};
};
};

also this will be applied on ALL AI units. (didn't state this before) (and yes this is dynamic including the other one although the last one is more of a instant action)

also I have not tested either

Edited by Lala14

Share this post


Link to post
Share on other sites

Just to expand on what Lala said about answers to this thread, another main reason for no response is that this should have been asked in xMed's BIS forum thread, not here.

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
Sign in to follow this  

×