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!
No, GetLocalPlayer() returns a single player. You can only compare it to other player expressions.
You can use
JASS:
if IsPlayerInForce(GetLocalPlayer(), GetPlayersAllies(Player(0))) then
...
endif
GetPlayersAllies creates a new force though, that should be removed or recycled. You can setup the force in GUI.
Also, the local block works that way that only players (clients) who match the condition execute what is inside. GetLocalPlayer returns a different player per client, that's why it causes an asynchronity. You have to be careful to only put stuff in these places that is not prone to cause net traffic and does not alter the gameplay.
No, GetLocalPlayer() returns a single player. You can only compare it to other player expressions.
You can use
JASS:
if IsPlayerInForce(GetLocalPlayer(), GetPlayersAllies(Player(0))) then
...
endif
GetPlayersAllies creates a new force though, that should be removed or recycled. You can setup the force in GUI.
Also, the local block works that way that only players (clients) who match the condition execute what is inside. GetLocalPlayer returns a different player per client, that's why it causes an asynchronity. You have to be careful to only put stuff in these places that is not prone to cause net traffic and does not alter the gameplay.
Stands for "whatever".
When you create a map and set the units etc, ANY player can be controlled by a human player. There are 11 available players out there for you to choose, which one is your "human controlled" player?
I wrote 0 because that's what OP asked for, Player(0) in jass is Player 1 (Red) in GUI. But I repeat that the GetPlayersAllies-function is available in GUI, so you can use a variable in the jass line instead.
It is evaluated from in to outside. The parenthesis behind a function name say to invoke this function and what's inside the parenthesis are the arguments to pass. So first the arguments have to be clear before the outer function can be called.
Therefore it's that execution order:
GetLocalPlayer() <-returns the local player (if the local client plays Player 1 (Red), it returns Player 1 (Red), if he/she plays Player 2 (Blue), it returns Player 2 (Blue) and so on)
Player(0) <-gets a player from its player number (Player 1 (Red) in this case)
GetPlayersAllies(<player>) <-creates a new force containing the allies of <player>
IsPlayerInForce(<player>, <force>) <-returns true if <player> is contained in <force>, else false
Check out a basic jass tutorial if you want to get a proper grasp.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.