Forum Jump :

Author Message


Posts: 31
Rank:


Level: Member

Country: be
Location: Flanders
Occupation: student
Age:
In-game name:

 
#1 Posted at 2016-08-03 17:15        
     
I'm looking for a revive script that works for AI. I've already looked in the script section but the only one I've found was "Thorfinn SP Revive" script and that one is bugged. Anyone know a script that I could use?

If you're going through hell,
keep going! -W. Churchill

Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 58
In-game name: Kobayashi Maru

 
#2 Posted at 2016-08-03 19:22        
     
SP or MP? All AIs or just those in your group? side?

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Advertisement


Author Message


Posts: 31
Rank:


Level: Member

Country: be
Location: Flanders
Occupation: student
Age:
In-game name:

 
#3 Posted at 2016-08-04 09:37        
     
SP, the AI in my group but if possible all AI. And blufor (US army, RHSusf mod). And all ai in my group are playable

This post was edited by gg1gamer (2016-08-04 09:43, 745 days ago)

If you're going through hell,
keep going! -W. Churchill

Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 58
In-game name: Kobayashi Maru

 
#4 Posted at 2016-08-04 19:43        
     
Here is an example I made. You can change the: forEach (allUnits select {side _x == west}) by what you want:
allUnits;
switchableUnits;
(allUnits select {group _x == group player});

As you can see, you need a loop to add the event Handler "killed" on each unit, at start or created when someone die.
I didn't manage the #number (unit 1, unit 2...) of the unit inside a group. Groups are OK but unit's #number grows.
Units repawn after 10 seconds. You can change that of course.

I you need the unit to "respawn" with the exact loadout and ammos as when he died, just tell me. It's a little bit more tricky.
Keep on mind, the more respawnable units, the more messy on ground. You should consider to delete _unit (in eventHandler) to have a cleaner field.

while {true} do {
  sleep 0.5;
  {
    if !(_x getVariable ["treated",false]) then {
      _x setVariable ["treated",true];
      _x setVariable ["side",side _x];
      _x setVariable ["switchable", _x in switchableUnits];
      _x setVariable ["type",typeOf _x];
      _x spawn {while {alive _this} do {sleep 2; _this setVariable ["grp", group _this]}};
      _x addEventHandler ["killed", {
      _unit = _this select 0;
      _unit spawn {
        params ["_unit"];
        uisleep 10;
        _newUnit = (_unit getVariable "grp") createUnit [(_unit getVariable "type"), Position _unit, [], 0, "FORM"];
        if (_unit getVariable "switchable") then {addSwitchableUnit _newUnit};
     }
   }]
  }} forEach (allUnits select {side _x == west});
}

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Author Message


Posts: 31
Rank:


Level: Member

Country: be
Location: Flanders
Occupation: student
Age:
In-game name:

 
#5 Posted at 2016-08-05 09:43        
     
It would be nice to have them respawn with the loadout they had when they died.

If I understand this script correctly when the unit dies, after 10 sec the script creates a new unit on the same spot. But no FAK has to be used to revive him. Is it possible to add this or is that too much scripting?

Anyway thanks already for this script

If you're going through hell,
keep going! -W. Churchill

Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 58
In-game name: Kobayashi Maru

 
#6 Posted at 2016-08-05 10:06        
     
What FAK you want to use? I figured you wanted a respawn script for AI in SP. That's the reason why I create a new unit.
If you want a revive system, it's totally different (management of hits and unit never die but falls incapacitated). Perhaps someone could script that. So respawn = new unit after death, revive = no death but FAK system for incapacitated AI unit.

(not for tonight)

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Author Message


Posts: 31
Rank:


Level: Member

Country: be
Location: Flanders
Occupation: student
Age:
In-game name:

 
#7 Posted at 2016-08-05 11:44        
     
A revive script would be better for the story but if that is too much work your respawn script will do the trick too.

If you're going through hell,
keep going! -W. Churchill





Tags: Revive, Script, Sp