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

Detecting immolation insufficient mana

Status
Not open for further replies.
Level 8
Joined
Jan 8, 2010
Messages
493
hello! can anyone help me how to detect an immolation deactivation when the hero or unit has insufficient mana?

i'm basing a triggered spell based on immolation, where the trigger will turn on when the immolation is activated, and turn off when immolation is deactivated. but i can't seem to solve the problem when the unit has insufficient mana to continue immolation. i'm having problems with "Add to Trigger this Event" actions because it doesn't detect the unit at all (when i use it) when using a variable for the Specific Unit events.
 
Level 5
Joined
May 31, 2009
Messages
122
You could use a periodic timer event or a generic event (if you have a dummy buffer, like if its an attack specific thing)

Otherwise just use the periodic event timer, and under actions:

If - Unit has buff (immolation) equal to true, then
else if - unit has buff (immolation equal to false, then.

I ran into a similar problem when working on my map, and I decided that immolation would be too much of a hassle.
 
Level 8
Joined
Jan 8, 2010
Messages
493
Hi guys!

Just out of curiosity, what is the ability? if I have an idea of what it is, i could maybe think of another to go about it.

Is that question for me? Anyway, the ability I used was something like when the ability (based on Immolation) is activated, the attacks of that unit becomes splashed, not the Orb of Fire splash, but deals a certain amount of damage to units near the attacked damage. That's the triggered part.

I'll now be checking the periodic timer if it's possible.
 
Level 5
Joined
May 31, 2009
Messages
122
Hi guys!



Is that question for me? Anyway, the ability I used was something like when the ability (based on Immolation) is activated, the attacks of that unit becomes splashed, not the Orb of Fire splash, but deals a certain amount of damage to units near the attacked damage. That's the triggered part.

I'll now be checking the periodic timer if it's possible.

Wow. Perfect!!! I actually created something like that for my map, except with a corrupting attack.


Create a separate ability, for the orb of fire attack, and make it an item ability (so it doesnt appear)
Just do:

Activating it
  • Event
    • Unit - a unit is attacked
  • Conditions
    • Unit - Unit type of attacking unit = (that kind of unit)
    • Unit - Attacking Unit has (Buff:immolation) = true
    • Integer - Mana of attacking unit is greater than or equal to (3 mana?)
  • Actions
    • Unit - Add (Firesplash damage ability)
    • -------- You can add this thing to cause attacks to drain additional mana, or gain health, etc.
    • Unit - set (mana of attacking unit )to (mana of attacking unit - x)
Deactivating it
  • Event
    • Unit - a unit is attacked
  • Conditions
    • Or:
    • Unit - Unit type of attacking unit = (that kind of unit)
    • Unit - Attacking Unit has (Buff:immolation) = false
    • Integer - Mana of attacking unit is less than or equal to (3 mana?)
  • Actions
    • Unit - Remove (Firesplash damage ability)
The extra thing at the end allows you to add other bonuses if you want, such as more mana drain when attacking, etc.



I proposed the periodic timer thing at first because i thought you might have had a different kind of ability, such as aoe heal or something like that.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Does an automatic deactivation of Immolation not trigger the "unit is issued an immediate order" event?

Nope, seems like it doesn't. Why use a timer though? If you have a specific unit (who uses immolation) then you can register the event "Unit life/mana less than X". You can't use a unit-variable when you're adding the event in GUI, but if you're registering the event via triggers in the actions then you can use custom unit variables. No need for a timer.

But yes, as VestriDeus said, you can just check to see if the "attacker" has the buff given when a unit has an active Immolation.
 
Level 8
Joined
Jan 8, 2010
Messages
493
You can't use a unit-variable when you're adding the event in GUI.

oh, i see. so that's why it's not detecting the unit that uses the ability. i thought you can use variables when adding events to a trigger. woo. D:

and i can't use the specific unit event Unit mana less than X because the hero that uses it is created in-game, thus preventing me the use of specific unit events for them.

and yeah, i like VestriDeus' idea of reducing mana whenever the unit attacks. it looks better :D

thanks guys!
+rep for the information :D
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Well in GUI certain unit-specific events don't allow you to input a variable field, instead its either "No unit" or a pre-placed unit. For example, trying adding the "Event - Unit takes damage" event and using a unit-variable to register the event.

Now go into actions, and find: "Trigger - Add Event ..." and then do the same thing, you'll notice you have an extra field.

ronojales said:
and i can't use the specific unit event Unit mana less than X because the hero that uses it is created in-game, thus preventing me the use of specific unit events for them.

Look:

  • Untitled Trigger 001
    • Events
      • Unit - No unit Takes damage
      • Unit - No unit's mana becomes Less than 50.00
    • Conditions
    • Actions
      • Trigger - Add to (This trigger) the event (Unit - DummyUnit Takes damage)
      • Trigger - Add to (This trigger) the event (Unit - DummyUnit's mana becomes Less than 50.00)
See what I mean? Only pre-placed units and "No unit" is available in the events category, but once you add the event "externally" to that category it now allows you the use of unit variables.
 
Level 8
Joined
Jan 8, 2010
Messages
493
so like, i can only use Trigger - Add Event actions to the same trigger? this is what i actually did. is it wrong that's why it's not detecting the unit?

Making the hero ingame
  • Make Hero
    • Events
      • Unit - A unit enters HeroSelectShockWarper <gen>
    • Conditions
    • Actions
      • Unit - Create 1 Shock Warper for (Owner of (Triggering unit)) at ((Owner of (Triggering unit)) start location) facing Default building facing degrees
      • Set PlayerHero[(Player number of (Owner of (Triggering unit)))] = (Last created unit)
      • Trigger - Add to Lightning Shock Check <gen> the event (Unit - PlayerHero[(Player number of (Owner of (Triggering unit)))]'s mana becomes Less than 25.00)
is Add to Trigger this Event action applicable only to adding to "this trigger" and not to another trigger?
 
Level 8
Joined
Jan 8, 2010
Messages
493
i use the Add To Trigger event in that Make Hero trigger to make the variable PlayerHero(1) be the unit for the event Unit - Mana., so that it can detect the PlayerHero(1)'s mana when it is less than 25.

wait, if what i understood in your example is right, am i supposed to add the event "Unit - No Unit takes damage" and make the specific unit a No Unit first to the trigger Lightning Shock before i can use the Add To Trigger action?

EDIT: i don't know why, i tried your example in this computer (i am at a computer shop) and it worked perfectly. i was even able to detect if a particular trigger is turned off if the mana of the unit is less than a certain value. but when i tried it at home last night it doesn't work. oh well. :( i guess i'll check if my variables are correct when i get home.

Thanks Berbanog! +rep for helping through. :)
 
Status
Not open for further replies.
Top