• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Vampire Hurts During the Day?

Status
Not open for further replies.
Level 4
Joined
Apr 23, 2011
Messages
88
Anyone know how to make a trigger that hurts a custom hero I made during the day per second (he's a vampire) and then stops at night?
 
  • Trigger 01
    • Events
      • Game - The in-game time of day becomes Equal to 6.00
    • Conditions
    • Actions
      • Trigger - Turn on (Trigger 03)
  • Trigger 02
    • Events
      • Game - The in-game time of day becomes Equal to 18.00
    • Conditions
    • Actions
      • Trigger - Turn off (Trigger 03)
  • Trigger 02
    • Events
      • TIme - Every 1.00 seconds of Game Time
    • Conditions
    • Actions
      • Unit - Set life of --HERO-- to (Life of(HERO)) - 1.00
 
He wants it PER SECOND...

it can be done in one trigger...

maybe I'll make a trigger form of my above post...

make sure you add the vamps to the group...

  • Events
    • Time - Every 1.00 seconds of game time
  • Actions
    • If-Then-Else
      • If - Conditions
        • Time of Day is less than 18.00
        • Time of Day is greater than or equal to 6.00
      • Then - Actions
        • Unit Group - Pick every unit in Vampires and do
          • Do - Actions
            • Unit - Set life of picked unit
            • -------Or you may want to cause some unit to deal damage------
      • Else - Actions
 
seriously, those three triggers are totally unneeded...

at least if you want to be able to turn it off, you could make it into just two... just add an if-then at the loop which checks if the time is already 18.00 and turn off the loop...

though using just equal might not work if the setting of time per day is pretty fast, it may skip the 18.00...
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
Whether it is the best depends on if the time of day event hooks are faster or slower than 2 jass written time comparision every second.

In any case it could probably be made faster by using problem scope reduction. If it is night time it can logically not start being night time again so that boundary need not be checked. Likewise if it is day time it can not start being day time again so that boundry need not be checked.
 
Level 14
Joined
Oct 16, 2010
Messages
749
You could not make a trigger at all. And just make it so that the Vampire unit has a negative health regeneration rate, then set it so he only regenerates (or degenerates) during the day. But doing this will make him not regenerate health at night either, unless he's a hero then his strength comes into it. Probably tiggers is better. Don't listen to what i say actually. OUT!
 
Status
Not open for further replies.
Top