• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Multiboard for 1 player?

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
GetLocalPlayer() returns an asyncrnious value.
WC3 is syncrnious, so what is calculated for 1 human playing the map should also be calculated for other humans playing in the same session.
An asyncrnious value is when the value is different between atleast 2 players in the same session.

GetLocalPlayer()
Returns an asyncrnious player object with value of the player a game client controls.
Only active human players have a game client so can be returned by it.
Player object returned is constant and unique for each game client.
Impossible to get null returned or values in the range of Player(12 to 15) (neutral players).

Using this unique behaviour combined with flow control structures you can run code locally for only specific players. This is great for HCI or graphics which do not affect gameplay but improve the interaction of players with the map. This should never be used to run anything that alters gameplay as it will cause an immediate game split.

Examples
good - Using it to play a sound only for a single player. The sound will only play for certain players.
bad - Using it as the desired owner of a unit. Multiplayer games will instantly disolve (everyone gets dropped from each other).

Sigh.... Somone should put this in a FAQ.
 
Status
Not open for further replies.
Top