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

computer controled units thinking

Status
Not open for further replies.

007

007

Level 6
Joined
May 3, 2009
Messages
175
how can i mkae that a unit or a hero controled by a computer is also using spells and doesnt just attack normaly?
 

007

007

Level 6
Joined
May 3, 2009
Messages
175
could you explain it a bit better? i dont really understand it. do i have to look in game interface?
 
Level 4
Joined
Apr 18, 2009
Messages
127
here is one way to do it:
  • Boss
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Life of (Attacked unit)) Less than or equal to (((Max life of (Attacked unit)) / 100.00) x 90.00)
    • Actions
      • Unit - Add Blizzard to (Attacked unit)
      • Unit - Order (Attacked unit) to Human Archmage - Blizzard (Position of (Attacking unit))
This will fire when the hp of the unit is 90%.


I also think it is possible by adding the spells to the "default active ability" in object editor
 

007

007

Level 6
Joined
May 3, 2009
Messages
175
isnt there a way to let the attacked unit do spells randomly?
 
Level 4
Joined
Apr 18, 2009
Messages
127
As I said, I also think it is possible by adding the spells to the "default active ability" in object editor

I believe it will cast them randomly.
 
Level 4
Joined
Apr 18, 2009
Messages
127
First open object editor > Units > your unit.

Now you will see this at the top:

rawrb.gif


And that is what you have to edit
 

007

007

Level 6
Joined
May 3, 2009
Messages
175
no it doesnt work.

{EDIT}
i will do it the other way with triggering. but i have a question for that: can i somehow make that the unit randomly uses one of the spells? i just find to make "else" but thats for conditions but i just want it to be selected randomly.
 
Last edited by a moderator:
Level 4
Joined
Apr 18, 2009
Messages
127
This will be used then. It might be leaking:

  • Boss
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacked unit) Equal to YOURUNITGOESHERE
      • (Life of (Attacked unit)) Equal to (Random real number between 0.00 and (Max life of (Attacked unit)))
    • Actions
      • Unit - Add Blizzard to (Attacked unit)
      • Unit - Order (Attacked unit) to Human Archmage - Blizzard (Position of (Attacking unit))
      • -------- You might want to wait or something, if the blizzard stops when it's removed. Don't know --------
      • Unit - Remove Blizzard from (Attacked unit)
      • -------- Eventually for random enemy within range: --------
      • Unit - Order (Attacked unit) to Human Archmage - Blizzard (Position of (Random unit from (Units within 800.00 of (Position of (Attacked unit)))))
 
Level 5
Joined
May 12, 2008
Messages
80
I'm sorry but it would be much harder work to create an english trigger. copy n paste is faster ;)


  • Set Variable
    • Ereignisse
      • Map initialization
    • Bedingungen
    • Aktionen
      • Set Ability[1] = Avatar
      • Set Ability[2] = Robo-Goblin
      • Set Ability[3] = Stampede
  • Trigger
    • Ereignisse
      • Einheit - A unit Wird angegriffen
    • Bedingungen
    • Aktionen
      • Set Rnd_Integer = (Random integer number between 1 and 3)
      • Einheit - Add Ability[Rnd_Integer] to (Attacked unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • Rnd_Integer Gleich 1
        • 'THEN'-Aktionen
          • Einheit - Order (Attacked unit) to Menschen-Bergkönig - 'Avatar' aktivieren
        • 'ELSE'-Aktionen
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • Rnd_Integer Gleich 2
        • 'THEN'-Aktionen
          • Einheit - Order (Attacked unit) to Neutraler Tüftler - 'Robo-Goblin aktivieren'
        • 'ELSE'-Aktionen
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • Rnd_Integer Gleich 3
        • 'THEN'-Aktionen
          • Einheit - Order (Attacked unit) to Neutraler Bestienmeister - 'Stampede' (Center of (Playable map area))
        • 'ELSE'-Aktionen
But pay attention on memory leaks!!
 

007

007

Level 6
Joined
May 3, 2009
Messages
175
i understand what you mean. just one problem: i dont know where to find everything like

Set Rnd_Integer = (Random integer number between 1 and 3)

or

Rnd_Integer Gleich 1

do i just have to look a bit better or...?
 
Status
Not open for further replies.
Top