OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: ModestNovice on 28 May 2009, 22:23:36

Title: Strange Killed Thing...
Post by: ModestNovice on 28 May 2009, 22:23:36
Well, not sure what else I can call this. But its quite annoying.

In my map iv'e got lists (combo boxes that show people who are (!isNull) and alive. But when the people die, it seems to not recognize that the player has respawned is now alive again.

so no the person does not show in the list again.

Now, I have hide the body when they die, and even renamed the repspawning person back their vehicleVarName (like Civ1 renamed to Civ1) and it still doesnt detect that they are alive.

Any ideas?

Thanks,
DaChevs  :-[
Title: Re: Strange Killed Thing...
Post by: Spooner on 28 May 2009, 23:47:27
Not sure why this is happening, since I haven't a clue how to you are getting the player objects. However, if you take a reference to the

e.g. what is commonly done is this:
Code: (init.sqf) [Select]
// Put all the player objects at the START OF THE MISSION into the global array, 'players'.
players = [p1, p2, p3, p4];
When the first player respawns, then the first element of players array will be first dead (corpse object), then null (corpse disappears). This is because you are recording the initial objects, not the objects as they are when you want to actually use them. Instead you should record them just before you want to use them:
Code: (updateplayerlist.sqf) [Select]
// Put all the player objects, at this VERY MOMENT into the global array, 'players'
players = [p1, p2, p3, p4];

... update the GUI ...

Title: Re: Strange Killed Thing...
Post by: ModestNovice on 29 May 2009, 02:17:54
yea you were right. Ive fixed it like this:

Code: [Select]
myArray = ["Civ1","Civ2","Civ3",...etc];

if (alive (call compile _x)) then
{
};

Thanks Spooner :)
Title: Re: Strange Killed Thing...
Post by: Spooner on 29 May 2009, 02:40:59
Yep, that is the other way to do it ;)
Title: Re: Strange Killed Thing...
Post by: Rommel92 on 29 May 2009, 11:39:17
Well that explains some errors a while back...  :whistle: