OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Kronzky on 07 Oct 2002, 23:28:14

Title: Find out whether unit is human or AI
Post by: Kronzky on 07 Oct 2002, 23:28:14
Is there a way to determine within a script whether a particular unit is a human player or AI?
Title: Re:Find out whether unit is human or AI
Post by: sussmori on 08 Oct 2002, 03:29:11
One way to do it is by creating an array with the names of all players. Each player's machine can add the name of its 'player' to a publicVariable array.

Then it's just a matter of seeing if a unit's name is in the array or not
Title: Re:Find out whether unit is human or AI
Post by: Black_Feather on 08 Oct 2002, 04:23:05
I think you can use this too

?unitname == player : dosomething
Title: Re:Find out whether unit is human or AI
Post by: Kronzky on 08 Oct 2002, 06:26:35
The ?unitname == player : dosomething did the trick! And so elegantly...

Thanks a bunch!