Selecting a random player to be something?

Status
Not open for further replies.
Level 3
Joined
Jul 2, 2009
Messages
51
I'm not quite sure how to do this
But if you notice in maps like Parasite 2 at the start a player is randomly chosen to be alien/parasite
I'm assuming you need to use Integers however I don't have much experience with them
So basically I need there to be one player chosen as the 'infected one'
The infected one will have their main unit removed and replaced by an exact copy except that it has the transform ability
Any help? Also im using GUI
 
  • Melee Initialization
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set Temp_Force = (All players matching (((Matching Player)'s slot status Equal to Is playing) and (Matching Player) controller Equal to User)
    • Set Player1 = (Random Player from (Temp_Force))
    • Set Point1 = ((Player1)'s Start Location)
    • For each (Integer A) from to 10, do (Actions)
      • Loop - Actions
        • Unit - Create 1 Infected for (Player1) at Point1 facing default building degrees
    • Custom script: call RemoveLocation (udg_Point1)
Something like this?
 
  • Melee Initialization
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set Temp_Force = (All players matching (((Matching Player)'s slot status Equal to Is playing) and (Matching Player) controller Equal to User)
    • Set Player1 = (Random Player from (Temp_Force))
    • Set Point1 = ((Player1)'s Start Location)
    • For each (Integer A) from to 10, do (Actions)
      • Loop - Actions
        • Unit - Create 1 Infected for (Player1) at Point1 facing default building degrees
    • Custom script: call RemoveLocation (udg_Point1)
Something like this?

And this
  • Custom script: call DestroyForce (udg_Temp_Force)
 
Status
Not open for further replies.
Back
Top