• 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.

Very simple help needed

Status
Not open for further replies.
Level 37
Joined
Aug 14, 2006
Messages
7,614
Hey.

My brains are frozen once again. How do I make this so it won't kill anyone, but just leaves with 1 hit point?

  • HP and MANA REGE
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • Cinematic Equal to False
    • Actions
      • Set TempUnitArray[1] = AAAPhodom
      • Set TempUnitArray[2] = AAAFradz
      • Set TempUnitArray[3] = AAAGaleoth
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • -------- === HIT POINT REGENERATION === --------
          • Unit - Set life of TempUnitArray[(Integer A)] to ((Life of TempUnitArray[(Integer A)]) + ZValue_HPREGE[(Integer A)])
          • -------- === MANA REGENERATION === --------
          • Unit - Set mana of TempUnitArray[(Integer A)] to ((Mana of TempUnitArray[(Integer A)]) + ZValue_MANAREGE[(Integer A)])
 
That is HP regen, how can it kill someone? (unless it is negative) :p

Anyway, you would probably have to do something like this (untested):
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Life of (Triggering unit)) Greater than <Damage Amount>
    • Then - Actions
      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) - <Damage Amount>)
    • Else - Actions
      • Unit - Set life of (Triggering unit) to 1.00
 
Level 37
Joined
Aug 14, 2006
Messages
7,614
Yea it can be either positive or negative value depending how much vitality you have at the moment(another system).

Does this work? I go to test tomorrow(fucking long loading times).

  • HP and MANA REGE
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • Cinematic Equal to False
    • Actions
      • Set TempUnitArray[1] = AAAPhodom
      • Set TempUnitArray[2] = AAAFradz
      • Set TempUnitArray[3] = AAAGaleoth
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Life of TempUnitArray[(Integer A)]) Greater than ZValue_HPREGE[(Integer A)]
            • Then - Actions
              • -------- === HIT POINT REGENERATION === --------
              • Unit - Set life of TempUnitArray[(Integer A)] to ((Life of TempUnitArray[(Integer A)]) + ZValue_HPREGE[(Integer A)])
              • -------- === MANA REGENERATION === --------
              • Unit - Set mana of TempUnitArray[(Integer A)] to ((Mana of TempUnitArray[(Integer A)]) + ZValue_MANAREGE[(Integer A)])
            • Else - Actions
              • -------- === HIT POINT REGENERATION === --------
              • Unit - Set life of TempUnitArray[(Integer A)] to 1.00
              • -------- === MANA REGENERATION === --------
              • Unit - Set mana of TempUnitArray[(Integer A)] to ((Mana of TempUnitArray[(Integer A)]) + ZValue_MANAREGE[(Integer A)])
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • Untitled Trigger 006
    • Actions
      • Set r1 = -3.00
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Life of unit) + r1) Greater than 1.00
        • Then - Actions
          • Unit - Set life of unit to ((Life of unit) + r1)
        • Else - Actions
          • Unit - Set life of unit to 1.00
      • Unit - Set mana of unit to value
 
Level 37
Joined
Aug 14, 2006
Messages
7,614
Wat is your ZValue_HPREGE[(Integer A)] ?

About from -5000 to plus 2000.

  • Untitled Trigger 006
    • Actions
      • Set r1 = -3.00
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Life of unit) + r1) Greater than 1.00
        • Then - Actions
          • Unit - Set life of unit to ((Life of unit) + r1)
        • Else - Actions
          • Unit - Set life of unit to 1.00
      • Unit - Set mana of unit to value

Hmm... I didn't get that R1. Actually I didn't get the whole idea. Should this help me somehow?

You just check if the reheal would leave the unit with less than 1 life, and if so you set it to 1 life.

Yes, it may actually reheal it if the unit has 0.75 life but that is unimportant as most stuff will deal about 1 damage and the death point is 0.405.

Okay guys, speak very basic English now my brains are not frozen any longer and still I can't understand a thing. Help out the stupid guy and make some sense to me.

How am I gonna fix this? This is actually quite funny.
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Hmm... I didn't get that R1. Actually I didn't get the whole idea. Should this help me somehow?

The r1 I used is the regen variable in your trigger.

DSG basically explained my trigger, it checks whether the regen would leave the unit with less than 1 health or not. While the optimal value to check would be >0.405, it's really a non-issue.
 
Level 37
Joined
Aug 14, 2006
Messages
7,614
Oh yea, oh yea. Now I get it, it's very simple.

Like this?

  • HP and MANA REGE
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • Cinematic Equal to False
    • Actions
      • Set TempUnitArray[1] = AAAPhodom
      • Set TempUnitArray[2] = AAAFradz
      • Set TempUnitArray[3] = AAAGaleoth
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Life of TempUnitArray[(Integer A)]) + ZValue_HPREGE[(Integer A)]) Greater than 1.00
            • Then - Actions
              • -------- === HIT POINT REGENERATION === --------
              • Unit - Set life of TempUnitArray[(Integer A)] to ((Life of TempUnitArray[(Integer A)]) + ZValue_HPREGE[(Integer A)])
              • -------- === MANA REGENERATION === --------
              • Unit - Set mana of TempUnitArray[(Integer A)] to ((Mana of TempUnitArray[(Integer A)]) + ZValue_MANAREGE[(Integer A)])
            • Else - Actions
              • -------- === HIT POINT REGENERATION === --------
              • Unit - Set life of TempUnitArray[(Integer A)] to 1.00
              • -------- === MANA REGENERATION === --------
              • Unit - Set mana of TempUnitArray[(Integer A)] to ((Mana of TempUnitArray[(Integer A)]) + ZValue_MANAREGE[(Integer A)])
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • HP and MANA REGE
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • Cinematic Equal to False
    • Actions
      • Set TempUnitArray[1] = AAAPhodom
      • Set TempUnitArray[2] = AAAFradz
      • Set TempUnitArray[3] = AAAGaleoth
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Life of TempUnitArray[(Integer A)]) + ZValue_HPREGE[(Integer A)]) Greater than 1.00
            • Then - Actions
              • -------- === HIT POINT REGENERATION === --------
              • Unit - Set life of TempUnitArray[(Integer A)] to ((Life of TempUnitArray[(Integer A)]) + ZValue_HPREGE[(Integer A)])
            • Else - Actions
              • -------- === HIT POINT REGENERATION === --------
              • Unit - Set life of TempUnitArray[(Integer A)] to 1.00
          • -------- === MANA REGENERATION === --------
          • Unit - Set mana of TempUnitArray[(Integer A)] to ((Mana of TempUnitArray[(Integer A)]) + ZValue_MANAREGE[(Integer A)])
The mana is set anyway, so no need to have it in both then and else.
 
Status
Not open for further replies.
Top