StarCraft® II

How do i do this?

Posts: 77
Exemple : integerVariableBases[] having 12 spaces for each of the 12 players and using it like :

//Spawns human units for all players (player 1 to player 12) having chosen human race
For loop integerVariablePlayer = 1 to 12
if (integerVariableBases[integerVariablePlayer] == 1)
***Spawn X units of Human race for player integerVariablePlayer***
end if
End Loop
Reply Quote
Posts: 412
I'm a little confused with what you are trying to do by reading your code. That's only natural though as you are only just learning to "speak" this language. I think I understand what your intent is but just wanted to say sorry if I mis understand.

Players pick a unit and then every 20 seconds one of these units will appear at each players base. So you need to keep track of each players choice and you need to keep track of each players base location.

For this you can use the variables:
  • Base_Locations[12] which is of type "point"
  • Selected_Unit_Type[12] which is of type "unit type"

When a player selects what unit type they want (marine, hellion, roach, zealot stalker etcetc) then you need to set the Selected_Unit_type variable to be the unit type they want.

I don't know how you chose what each players base location will be but you could have some way for them to chose or you could set it in the map initialization trigger.

then in a periodic event:

Every 20 seconds
Player_Number (integer)
for each integer Player_Number = 1 to 12
create 1 Selected_Unit_Type[Player_Number] at location Base_Locations[Player_Number] for player Player_Number

Reply Quote

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Forums Code of Conduct

Report Post # written by

Explain (256 characters max)