• 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.

Ordering spawned units to randomly attack players

Status
Not open for further replies.
Level 3
Joined
May 12, 2008
Messages
42
I want to make a similar map to that, how can i make it so that spawned units in a region will randomly attack random players?

Guys please! I need a answear for my map! I tryed using map inilization and run melee ai for computer player but the units spawned for the computer player just stay at the place they were spawned
 
Last edited by a moderator:
Level 8
Joined
Dec 29, 2006
Messages
359
Guys please! I need a answear for my map! I tryed using map inilization and run melee ai for computer player but the units spawned for the computer player just stay at the place they were spawned

Dude, chill, it hasnt even been a day yet, ppl on the hive have other things to do than sit at the computer in the fetal position rocking back and forth waiting for somebody to post so they can read and reply, give people some time to answer, also, dont double post, i can almost guarantee that your gonna get told this same thing by about for other members.
 
Level 14
Joined
Nov 4, 2006
Messages
1,241
use variables, make a integer variable called attackvariable (or whatever you like)
in my example player 12 is the attacking player; 1-11 are attacked


  • Events
    • Unit - A Unit enters <your region>
  • Conditions
    • triggering unit is owned by player 12
    • choose any
  • Actions
    • set <attackvariable> random integer number between 1 and 11
    • if attackvariable equal to 1 order triggering Unit to attack player1
    • if attackvariable equal to 2 order triggering Unit to attack player2
    • ....
player1 and player2 can be regions or buildings or sth that should be attacked
 
Level 5
Joined
Jul 11, 2007
Messages
152
I'm assuming you mean variables in general, and you do that via the yellow X in the trigger editor.

BTW: If you are making a map like mine, please give me the credit :)
 
Status
Not open for further replies.
Top