• 🏆 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!

Making a spell activate after you deactivate a other spell

Status
Not open for further replies.
Level 5
Joined
Mar 3, 2015
Messages
200
Hi everyone
Can someone please help me
You see I want to make it that if I deactivate Immolation, It will release fire spell around the caster and it will make the enemy's around the caster get fire damage.

If you need more detail tell me.
This is my first thread so I dont really know how to ask this, or what info I must get
 
Level 39
Joined
Feb 27, 2007
Messages
4,994
You can catch the order like so:
  • Events
    • Unit - A unit is issued an order with no target
  • Conditions
    • (issued order) equal to unimmolate
    • (Level of (your immolate ability) for (triggering unit)) greater than 0
  • Actions
    • -------- Do your explosion here --------
The event will not fire if the unit runs out of mana or otherwise passively deactivates immolation.
 
Level 5
Joined
Mar 3, 2015
Messages
200
dont seem to get the conditions right :(
cant find the things..this may take longer then I planned, will just need to search through everything in till I get it
unimmolate is well hidden, or I am just not looking right
 
Level 5
Joined
Mar 3, 2015
Messages
200
Is this right?
  • events.gif
    Events
    • joinbottom.gif
      unit.gif
      Unit - A unit is issued an order with no target
  • cond.gif
    Conditions
    • join.gif
      if.gif
      (Issued order) Equal to (==) (unimmolation)
    • joinbottom.gif
      if.gif
      (Level of Immolation for (Triggering unit)) Greater than (>) 0
 
Level 5
Joined
Mar 3, 2015
Messages
200
I get this :(

Line 115: Undeclared variable unimmolate
Line 115: Comparing two variables of different primitive types (except real and integer) is not allowed
 
Level 39
Joined
Feb 27, 2007
Messages
4,994
I tried it myself and I guess there's no way to get the issued order into an integer comparison. I was wrong that it could be detected with the "unimmolate" order, so I had to do this:
  • GUI
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
    • Actions
      • Custom script: if GetIssuedOrderId() == 852178 then
      • -------- Do your stuff here --------
      • Custom script: endif
 
Level 8
Joined
Jan 28, 2016
Messages
486
Is this right?
  • events.gif
    Events
    • joinbottom.gif
      unit.gif
      Unit - A unit is issued an order with no target
  • cond.gif
    Conditions
    • join.gif
      if.gif
      (Issued order) Equal to (==) (unimmolation)
    • joinbottom.gif
      if.gif
      (Level of Immolation for (Triggering unit)) Greater than (>) 0

It's literally unimmolate not unimmolation.

This is incorrect; the order string is in fact "unimmolation." His trigger also fails because he didn't convert the string into an order.


The following example works as intended and will display "unimmolation" when the order is given.

  • Unimmolation
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(unimmolation))
    • Actions
      • Game - Display to (All players) the text: (String((Issued order)))
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
  • Unimmolation
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(unimmolation))
    • Actions
      • Game - Display to (All players) the text: (String((Issued order)))
I just tried that trig.... it doesn't work

Hasn't anyone ever solved this problem before?

If you guys don't solve it, I'm claiming bragging rights for life!!!! and if I don't solve it

EPIC BRAGGING RIGHTS to however can


PERFECT I SOLVED IT FIRST!!!!!!
 
Last edited:
Level 5
Joined
Mar 3, 2015
Messages
200
base.gif
GUI
  • joinminus.gif
    events.gif
    Events
    • line.gif
      joinbottom.gif
      unit.gif
      Unit - A unit Is issued an order with no target
  • join.gif
    cond.gif
    Conditions
  • joinbottomminus.gif
    actions.gif
    Actions
    • empty.gif
      join.gif
      page.gif
      Custom script: if GetIssuedOrderId() == 852178 then
    • empty.gif
      join.gif
      comment.gif
      -------- Do your stuff here --------
    • empty.gif
      joinbottom.gif
      page.gif
      Custom script: endif

Bad news ThelordofChaos but this works, so you will not be the first. Thanks @Pyrogasm you are awesome
@TheLordOfChaos201 try his trigger it works perfect for the timing. I did not test it with a complete spell, but with a quick trigger to test if it works.

Hope me luck guys. I am struggling so that the spell does not dmg and kill me xD
poor demon Hunter died 11 time because of his own spell LOLZ
 
Level 19
Joined
Jul 2, 2011
Messages
2,162
Bad news ThelordofChaos but this works, so you will not be the first. Thanks @Pyrogasm you are awesome
@TheLordOfChaos201 try his trigger it works perfect for the timing. I did not test it with a complete spell, but with a quick trigger to test if it works.
Yeah I know, I was just Joshing.... Pyrogasm you are the Epic Cool, Bragging Boss.

Hope me luck guys. I am struggling so that the spell does not dmg and kill me xD
poor demon Hunter died 11 time because of his own spell LOLZ

Why you got to pick on a demon hunter, what did he ever do to you.

*Looks up at user name* 'WrathBringer'

Are you a demon!!!!! :eek:!!!
 
Level 11
Joined
May 16, 2016
Messages
730
Hi everyone
Can someone please help me
You see I want to make it that if I deactivate Immolation, It will release fire spell around the caster and it will make the enemy's around the caster get fire damage.

If you need more detail tell me.
This is my first thread so I dont really know how to ask this, or what info I must get
Don't use triggers like "A unit Is issued an order", because when Immolation fades while hero is out of mana and you wouldn't get an action you want. Here is a template for you which allows to do action while hero cancelled it without your order.
In this map Demon Hunter has low mana and the hero had to cancel it without your order.
If you are using "A unit Is issued an order", then in this case trigger wouldn't see it.
 

Attachments

  • Immolation Fading Effect.w3x
    13.3 KB · Views: 41
Level 39
Joined
Feb 27, 2007
Messages
4,994
Here are triggers from the map:
  • EVERY 001
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set temp_group = (Units in (Playable map area) matching (((Matching unit) is alive) Equal to True))
      • Unit Group - Pick every unit in temp_group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff IMMOLATION) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Dummy Spell 0 for (Picked unit)) Equal to 0
                • Then - Actions
                  • Unit - Add Dummy Spell 0 to (Picked unit)
                • Else - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Dummy Spell 0 for (Picked unit)) Greater than 0
                • Then - Actions
                  • Unit - Remove Dummy Spell 0 from (Picked unit)
                  • Set temp_unit = (Picked unit)
                  • Trigger - Run DO ACTION <gen> (checking conditions)
                • Else - Actions
      • Custom script: call DestroyGroup( udg_temp_group )
  • DO ACTION
    • Events
    • Conditions
    • Actions
      • -------- ENTER HERE ACTION (TRIGGERING UNIT IS temp_unit) --------
      • Floating Text - Create floating text that reads BOOM above temp_unit with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
  1. This method will work, but IMO it's not good coding practice. First off 0.01 seconds is far too quick, and too many concurrent low-timeout timers can be a real pain; generally speaking you never want to put a periodic timer below ~0.0325, which is about 30 runs per second. In this case you could get away with 0.25 or 0.5 seconds with no real downside.
  2. No reason to track which units using a dummy ability; it's better to just use a unit group and check if the unit is in the group. Additionally you did not disable the dummy ability for all players at map init so it would have been visible on the units.
  3. Always avoid "every X seconds... pick all units in playable map area" if you can; in this case we can again filter the number of units we have to check by making a trigger to automatically add the correct units to a different group and loop through them every time the trigger runs.
I re-wrote the code to be (IMO) better:
  • Register
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(immolation))
      • (Level of Immolation for (Triggering unit)) Greater than 0
      • ((Triggering unit) is in Immo_Group) Equal to False
    • Actions
      • Unit Group - Add (Triggering unit) to Immo_Group
  • Per Second
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Immo_Group and do (Actions)
        • Loop - Actions
          • Set temp_unit = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (temp_unit has buff IMMOLATION) Equal to True
              • (temp_unit is in Immo_On_Group) Equal to False
            • Then - Actions
              • Unit Group - Add temp_unit to Immo_On_Group
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (temp_unit is in Immo_On_Group) Equal to True
              • (temp_unit has buff IMMOLATION) Equal to False
            • Then - Actions
              • Unit Group - Remove temp_unit from Immo_On_Group
              • Trigger - Run DO ACTION <gen> (checking conditions)
            • Else - Actions
  • Clear
    • Events
      • Time - Every 600.00 seconds of game time
    • Conditions
      • (Immo_On_Group is empty) Equal to True
    • Actions
      • Unit Group - Pick every unit in Immo_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to False
            • Then - Actions
              • Unit Group - Remove (Picked unit) from Immo_Group
              • Unit Group - Remove (Picked unit) from Immo_On_Group
            • Else - Actions
  • DO ACTION
    • Events
    • Conditions
    • Actions
      • -------- ENTER HERE ACTION (TRIGGERING UNIT IS temp_unit) --------
      • Floating Text - Create floating text that reads BOOM above temp_unit with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
The Clear trigger is really not super necessary, but it can be good practice to clear the groups of unnecessary (dead) units after a while.
 
Status
Not open for further replies.
Top