OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Demoniac on 02 Sep 2002, 18:38:48
-
Can anybody tell me how to detect units which have respawned, so I can remove the stupid M16 with only 30 shots and give them some real weapons? I've found a way for it in a simple deathmatch (giving them a negative rating changes their side to ENEMY so only units that have just respawned will activate the trigger, and then the trigger will run a script so all the units in its list are given a negative rating) but I don't know how to detect only the units that have just respawned in a team battle. When you just put a unit into a variable, they will no longer be linked when the unit has respawned :(
-
If you use a trigger with the condition:
alive unit
it will activate every time unit respawns.
You could have a trigger for every unit, or you could have just one trigger with the condition line:
alive player
which will activate on each clients computer when they respawn. You could use this trigger to rearm the players soldier. I recently used it in conjunction with a script to rearm the player to have the exact loadout they had at the start of the mission (this based on the name of the players unit).
Anyway, there's a couple of ideas. I'm sure you can work out which works best for your particular situation ;)
-
Sui, can you figure this one out for me then:
I have a mission with a civilian man and a west soldier. Respawn is enabled and the civilian guy respawns nicely as he is supposed to. I have put this exec "RSTest.sqs" in the initialization field. Where RSTest.sqs contains this:
@(!alive _this)
hint "The civilian died"
@(alive _this)
hint "The civilian respawned"
When the civilian dies and then respawns the poor guy is no longer quite himself, so the @(alive _this) waits for ever.
Can the respawned unit be detected by the script or do I have to make the references to him by name (instead of variable this)?
-
Hmmm...
From what I've seen the 'designation' of a unit changes when it is killed...
You could try using it's name. I think that would work ;)