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

Generic Expiration Last created unit(?)

Status
Not open for further replies.
Level 2
Joined
Apr 7, 2009
Messages
8
I'm quite new to the world editor, and have been experimenting with some
triggered spells, recently i made a dummy and forgot to set food used to 0
(it was at 1) and after using my spell a few times, i noticed my food just
kept increasing the logical reaction was "oh, i forgot to add an expiration
timer to my dummy" i checked trough my trigger and found that i actually
had added the "add a 1 second generic expiration timer to last created
unit" on the first line after i created the dummy what have i done wrong?
any help is greatly appreciated.

//Sarastrasza

  • Ultimate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Clap
    • Actions
      • Set int_level_1 = (Level of (Ability being cast) for (Triggering unit))
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and (((Matching unit) belongs to an enemy of (Triggering player)) Equal to True))) and do (Actions)
        • Loop - Actions
          • Set Unit_ulti_1 = (Picked unit)
          • Set point_ulti_1 = ((Position of (Picked unit)) offset by (0.00, 250.00))
          • Unit - Create 1 Flying Dummy for (Triggering player) at point_ulti_1 facing 0.00 degrees
          • Unit - Add Ultimate to (Last created unit)
          • Unit - Set level of Ultimate for (Last created unit) to int_level_1
          • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning Unit_ulti_1
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation ( udg_point_ulti_1 )
 
Level 3
Joined
Jun 23, 2008
Messages
22
Try this it leaves your options wider

  • Ultimate
  • Events
  • Unit - A unit Starts the effect of an ability
  • Conditions
  • (Ability being cast) Equal to Thunder Clap
  • Actions
  • Set int_level_1 = (Level of (Ability being cast) for (Triggering unit))
  • Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and (((Matching unit) belongs to an enemy of (Triggering player)) Equal to True))) and do (Actions)
  • Loop - Actions
  • Set Unit_ulti_1 = (Picked unit)
  • Set point_ulti_1 = ((Position of (Picked unit)) offset by (0.00, 250.00))
  • Unit - Create 1 Flying Dummy for (Triggering player) at point_ulti_1 facing 0.00 degrees
  • Unit - Add Ultimate to (Last created unit)
  • Unit - Set level of Ultimate for (Last created unit) to int_level_1
  • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning Unit_ulti_1
  • Wait 1.00 seconds
  • Unit - do whatever the hell you want
  • Custom script: call RemoveLocation ( udg_point_ulti_1 )
sorry for the lack of organisation
 
Level 2
Joined
Apr 7, 2009
Messages
8
can a unit still take up food even if it has died? if not how come none has realized UnitApplyTimedLife isnt working at all in all this time? :S both options seems weird, so what is really going on here
 
Level 6
Joined
Oct 26, 2005
Messages
190
You can set Max HP to 1 and a regeneration of -1 alternatively so it lasts one second alive :) It's kinda the same since it's a dummy that cannot raise nor decay.

And for spells that require a dummy to stay longer, just create a different dummy with no negative regen. That's how I do it, and works pretty well.

Oh, and if you just want to know why the timer doesn't work, why don't you try with "Last created unit group"?
 
Status
Not open for further replies.
Top