Jump to content
Sign in to follow this  
roguetrooper

Disconnetion counts as death (?)

Recommended Posts

When a human player jip-joins a game and takes control of a soldier that has not been A.I. before he joined (i.e. the unit was not present on the map), then seemingly the disconnection of that player counts as a death of that unit somehow.

I have triggers for every playable unit that execute a script when they die. This script is also executed when a player jip-joins and leaves the game in the way described above.

The triggers are

condition: not alive player1
execution: [player1] exec "script.sqf"; 

script.sqf starts with the following code to prevent the execution when the unit is not present in the game any more:

_man = _this select 0;
if ( (isNil "_man") or !(lifestate _man == "DEAD") ) then { exit };

But it doesn't work. Either the death-script is not executed at all when a player dies or it counts disconnecting players as dead players.

Any solutions?

Share this post


Link to post
Share on other sites

Anyone a workaround for disconnecting players not triggering triggers with condition not alive playerX ?

I've been fumbling around with lifestate and many other things for many hours. No use. Disconnection is considered as death.

Share this post


Link to post
Share on other sites

Doesn't work. I have tried that condition before:

!alive playerX and ((isPlayer playerX) or !(isPlayer playerX))

When you check a non-existing unit (e.g. player999) with isPlayer or !isPlayer, then it is recognized as not existing (i.e. both isPlayer and !isPlayer return a negative value).

I also thought lifeState == "dead" would be better, since it returns only true (?), when the unit is existing but dead (without a deletion causing death-report). But that causes some trouble with locality.

For some reason the engine does not differentiate between a non-life-status caused by death and a non-life-status caused by disconnection.

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  

×