Jump to content
Sign in to follow this  
Weapon-Fetish

Tigger give Group member init

Recommended Posts

Hi all sorry im again :D

 

I would Give a unit a init over this trigger below when he join my group.

 

The Condition of the trigger are : 

 

({alive _x} count units mygroup) < 2

 

And in on Activation i would give the group member this in the init :

 

dummy = [this, units (group this)] execVM "automedic.sqf";

 

 

 

 

This is for a script that force ACE 3 Ais  to revive me . I know i can normally set :dummy = this ............. in the init field of my group member BUT the group member existing not before , i recuit them with the Ravage recuit script and want to give them the init when he joining me.

 

Its that possible to make that over this Way ?  I only found ways to spawn units with a init but nothing over joing player goup .

 

Tanks again for Reading and hopfully try to help me ! :)

 

 

Edited by Weapon-Fetish

Share this post


Link to post
Share on other sites
1 hour ago, Weapon-Fetish said:

Hi all sorry im again :D

 

I would Give a unit a init over this trigger below when he join my group.

 

The Condition of the trigger are : 

 

({alive _x} count units mygroup) < 2

 

And in on Activation i would give the group member this in the init :

 

dummy = [this, units (group this)] execVM "automedic.sqf";

 

 

 

 

This is for a script that force ACE 3 Ais  to revive me . I know i can normally set :dummy = this ............. in the init field of my group member BUT the group member existing not before , i recuit them with the Ravage recuit script and want to give them the init when he joining me.

 

Its that possible to make that over this Way ?  I only found ways to spawn units with a init but nothing over joing player goup .

 

Tanks again for Reading and hopfully try to help me ! :)

 

 

 

You can run a small loop to check for new members and run the automedic script on them once, like this:

//initPlayerLocal.sqf

_automedic = [] spawn {

	TAG_fnc_addAutoMedic = true;
	while {TAG_fnc_addAutoMedic} do {
		_toHandle = units player select {!(_x getVariable ["TAG_fnc_isAutoMedic",false])};//will select units that are not already automedics
		{
			[_x, units player] execVM "automedic.sqf";//turn unit into autoMedic
			_x setVariable ["TAG_fnc_isAutoMedic",true];//set a flag to mark the unit as autoMedic so it will only be added once
		} forEach _toHandle;
		sleep 5;
	};
};

This will add the automedic to all units that aren't already designated automedics, every 5 seconds. If you want to stop the loop from adding automedic functionality simply set TAG_fnc_addAutoMedic to false.

 

Cheers

  • Thanks 1

Share this post


Link to post
Share on other sites

Wow Thx man !  But i have a question to this, how can i exclude a player (me ) this automedic script hard force the heal /revive procces ,so when im the automedic and i go uncounces ,its heal myself and can't really die . its a script issue but for squad member works it good so i dont have to delete ace medic und use AIS revive for this .

Share this post


Link to post
Share on other sites

Replace this line:

_toHandle = units player select {!(_x getVariable ["TAG_fnc_isAutoMedic",false])};

with this:

_toHandle = units player select {!(_x getVariable ["TAG_fnc_isAutoMedic",false]) AND !isPlayer _x};

Cheers

  • Thanks 1

Share this post


Link to post
Share on other sites
53 minutes ago, Grumpy Old Man said:

Replace this line:


_toHandle = units player select {!(_x getVariable ["TAG_fnc_isAutoMedic",false])};

with this:


_toHandle = units player select {!(_x getVariable ["TAG_fnc_isAutoMedic",false]) AND !isPlayer _x};

Cheers

And again Thank you Grumpy !!

  • Thanks 1

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  

×