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

Mines expiration timer

Status
Not open for further replies.
Level 10
Joined
Mar 17, 2012
Messages
579
Hi there! My hero has a spell "Nuclear Mushrooms" it works like Goblin Land Mines... Places a mushroom that will explode...
But I want them to last only 5 minutes... I set duration 300, but they still last forever... I also tried this:

  • Nuclear Mushroom Summon
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Nuclear Mushroom level 1
        • Then - Actions
          • Unit - Add a ((Real((Intelligence of Nuclear_Mushroom_Caster (Include bonuses)))) + 300.00) second Generic expiration timer to (Last created unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to Nuclear Mushroom level 2
            • Then - Actions
              • Unit - Add a ((Real((Intelligence of Nuclear_Mushroom_Caster (Include bonuses)))) + 300.00) second Generic expiration timer to (Last created unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Triggering unit)) Equal to Nuclear Mushroom level 3
                • Then - Actions
                  • Unit - Add a ((Real((Intelligence of Nuclear_Mushroom_Caster (Include bonuses)))) + 300.00) second Generic expiration timer to (Last created unit)
                • Else - Actions
but still forever lasting mushrooms -_-

Little help please :vw_sad:
 
Level 10
Joined
Mar 17, 2012
Messages
579
Try "Unit - A unit Spawns a summoned unit" event.

What about condition? Unit type of Triggering unit???

Wait, what is "Nuclear_Mushroom_Caster"? You didn't set it to be the unit enters the map, so... it doesn't work?
Special for you)))
  • Nuclear Mushroom Caster
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Nuclear Mushroom
    • Actions
      • Set Nuclear_Mushroom_Caster = (Casting unit)
 
Level 6
Joined
May 4, 2012
Messages
187
If I still have a good badass memory, last created unit has no relationship with enters playable playable map area event. But who knows.
 
Level 10
Joined
Dec 15, 2012
Messages
650
  • Conditions
    • Or
      • (Unit-type of (Triggering unit)) Equal to Nuclear Mushroom level 1
      • (Unit-type of (Triggering unit)) Equal to Nuclear Mushroom level 2
      • (Unit-type of (Triggering unit)) Equal to Nuclear Mushroom level 3
Maybe this help you to shorter the actions ?
 
Level 10
Joined
Mar 17, 2012
Messages
579
Have your test Using Water Elemental and such abilities that have time limits? Maybe Works

Water Elemental can't be placed on a point...

  • Conditions
    • Or
      • (Unit-type of (Triggering unit)) Equal to Nuclear Mushroom level 1
      • (Unit-type of (Triggering unit)) Equal to Nuclear Mushroom level 2
      • (Unit-type of (Triggering unit)) Equal to Nuclear Mushroom level 3
Maybe this help you to shorter the actions ?

Good idea xD
 
Level 16
Joined
Jul 31, 2012
Messages
2,217
I think the best way is this.... if your trigger didn't work
  • Untitled Trigger 003
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Nuclear Mushroom
    • Actions
      • Set temp_location = (Target Point of Ability being Cast)
      • Unit - Create 1 Mushroom[Level of (Ability being cast) for (temp_Unit)] for temp_Player at temp_location facing Default building facing degrees
      • Unit - Add a 300.00 second Generic expiration timer to (Last created unit)
      • Custom Script - call RemoveLocation(udg_temp_location)
Mushroom[X] is a variable that is storing the muchrooms unit type
Ability is Channel with point target
:grin:
 
Last edited:
Level 6
Joined
May 4, 2012
Messages
187
If this is not yet solved, I think I must give some of my ideas.

First of all, I observed your trigger and didn't see any unit created. Maybe you can change the 'Last created unit' to Triggering Unit (or Entering unit) so that it will 'fit' to your event. (Your event is enter playable map area)

~iChaos the Opti Hatur
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
I think the best way is this.... if your trigger didn't work
  • Untitled Trigger 003
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Nuclear Mushroom
    • Actions
      • Set temp_Unit = (Triggering Unit)
      • Set temp_Player = owner of (Triggering Unit)
      • Set temp_location = (Target Point of Ability being Cast)
      • Unit - Create 1 Mushroom[Level of (Ability being cast) for (temp_Unit)] for temp_Player at temp_location facing Default building facing degrees
      • Unit - Add a 300.00 second Generic expiration timer to (Last created unit)
      • Custom Script - call RemoveLocation(udg_temp_location)
      • Custom Script - set temp_Unit = null
      • Custom Script - set temp_Player = null
Mushroom[X] is a variable that is storing the muchrooms unit type
Ability is Channel with point target
:grin:

Im confused. Why on earth is there any need for creating variables in this trigger (other than point variable)? Why do you store triggering unit if it is only going to be referenced once straight away? Additionally, summoned units can be detected by using "A unit Enters playable map area".

This trigger should work:

  • Land Mine
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Goblin Land Mine
          • (Unit-type of (Triggering unit)) Equal to Goblin Land Mine
          • (Unit-type of (Triggering unit)) Equal to Goblin Land Mine
    • Actions
      • Unit - Add a ((Real((Intelligence of MushroomCaster (Include bonuses)))) + 300.00) second Generic expiration timer to (Triggering unit)
Like said above, you need to use "Triggering Unit". There is no "Last created Unit" in the original post's trigger.
 
Status
Not open for further replies.
Top