• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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?
 
Level 6
Joined
Jan 27, 2007
Messages
208
  • 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.
Top