Help..

massive

New Member
Reaction score
1
1.i am trying to make a trigger whereby when a specific unit's health gets below a value it will cast a spell.
2.how do i order a unit to cast a spell?(in triggers)
 

TomTTT

New Member
Reaction score
44
1. Pretty easy...
Trigger:
  • Order
    • Events
      • Unit - UNIT's life becomes Less than REAL
    • Conditions
    • Actions
      • -------- You actions here... --------

It's under the Event > Unit > Life
UNIT = the unit you want to make cast the spell
REAL = the life needed for it to trigger this trigger.
2. There are several ways, depending on the ability.
If it's a point-target ability (means you need to target a point in this ability) then use the actions:
Trigger:
  • Actions
    • Set Point = (Center of (Playable map area))
    • Unit - Order UNIT to Human Blood Mage - Flame Strike Point
    • Custom script: call RemoveLocation(udg_Point)

Point = a point variable, needed to be able to remove leaks.
UNIT = The unit you want
Custom Script = to remove leaks which cause lags.
If it's a unit-target ability (means you need to target a unit) then do:
Trigger:
  • Unit - Order UNIT to Human Mountain King - Storm Bolt UNIT

Simple enough, right?
If it's an instant, spells like War Stop or Thunder Clap, that instantly cast, use:
Trigger:
  • Unit - Order UNIT to Human Mountain King - Thunder Clap


Issue order targeting a point
Issue order targeting a unit
Issue order with No Target
 

massive

New Member
Reaction score
1
1. Pretty easy...
Trigger:
  • Order
    • Events
      • Unit - UNIT's life becomes Less than REAL
    • Conditions
    • Actions
      • -------- You actions here... --------

It's under the Event > Unit > Life
UNIT = the unit you want to make cast the spell
REAL = the life needed for it to trigger this trigger.
2. There are several ways, depending on the ability.
If it's a point-target ability (means you need to target a point in this ability) then use the actions:
Trigger:
  • Actions
    • Set Point = (Center of (Playable map area))
    • Unit - Order UNIT to Human Blood Mage - Flame Strike Point
    • Custom script: call RemoveLocation(udg_Point)

Point = a point variable, needed to be able to remove leaks.
UNIT = The unit you want
Custom Script = to remove leaks which cause lags.
If it's a unit-target ability (means you need to target a unit) then do:
Trigger:
  • Unit - Order UNIT to Human Mountain King - Storm Bolt UNIT

Simple enough, right?
If it's an instant, spells like War Stop or Thunder Clap, that instantly cast, use:
Trigger:
  • Unit - Order UNIT to Human Mountain King - Thunder Clap


Issue order targeting a point
Issue order targeting a unit
Issue order with No Target

For the first part,my units are created with triggers so how will i set Unit as a variable?because it is a specific unit type..
and for the second part,can the units only cast those spells?what about my custom spells?
thx
 

Ryushi

"I will stand, or I will fall. I will not sit."
Reaction score
59
For the first question,
Trigger:
  • trigger
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
      • (Unit-type of (Entering unit)) Equal to Your Unit Type
    • Actions
      • Trigger - Add to trigger 1 <gen> the event (Unit - (Entering unit)'s life becomes Less than Number)

Set Number to equal whatever amount of health you're looking for.
This trigger will add the event for any unit of your unit type that is created after initialization.

For the second question, to make a unit cast a custom spell, order the unit to cast the original spell the custom spell was based off of.
 

TomTTT

New Member
Reaction score
44
Yeah Ryushi beat me to it :D
in order to make a unit cast a custom spell, you need to order this unit to cast the spell that you based your custom spell on.
Let's say you made a custom spell based of Shockwave, changed what you wanted and those, now you need to order the unit to cast Shockwave, since it's the order string. You can take a look at it while editing.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top