• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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 13
Joined
Nov 4, 2006
Messages
1,239
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