• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Multiboard for 1 player?

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
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