Hi, im creating new map and dont know how to use player variable there is no option in editor, what i want to achieve is to assing the owner of unit to the respective player.
EG:
-Owner of killing unit == Player 1 or player variable 1.
Players are represented as integers (int) in StarCraft II. Anything that returns a player returns an int. Anything that takes a player takes an int. Some natives take or return player group which represents one or more players. Some actions and natives which take a player can be passed the value of -1 to represent "any player".
This is very convenient as you can use player values as array indices directly as well as compute player values directly.
Hi, im creating new map and dont know how to use player variable there is no option in editor, what i want to achieve is to assing the owner of unit to the respective player.
EG:
-Owner of killing unit == Player 1 or player variable 1.
Need info, can you help me..
its not really clear what you are trying to do ...
(please be more explicit if you can and want additional help).
but in triggers you would do it like this:
. identify the units you want to change ownership of (however you want to do that.)
. stick them in a unit group (easier if only one).
. issue change ownership with the target players player number;
This example takes all the units current selected by a players, and changes ownership to that player when he/she types "-mine" into chat.
( yes, you will want a different method of selecting units to change ).
Hi, im creating new map and dont know how to use player variable there is no option in editor, what i want to achieve is to assing the owner of unit to the respective player.
EG:
-Owner of killing unit == Player 1 or player variable 1.
Need info, can you help me..
Players are represented as integers (int) in StarCraft II. Anything that returns a player returns an int. Anything that takes a player takes an int. Some natives take or return player group which represents one or more players. Some actions and natives which take a player can be passed the value of -1 to represent "any player".
This is very convenient as you can use player values as array indices directly as well as compute player values directly.
its not really clear what you are trying to do ... (please be more explicit if you can and want additional help).
but in triggers you would do it like this:
This example takes all the units current selected by a players, and changes ownership to that player when he/she types "-mine" into chat. ( yes, you will want a different method of selecting units to change ).