• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Small Gui Problem

Status
Not open for further replies.
What I am trying:
I am trying to set the HP of a unit to somewhat I want.

So I made 5 spells which change the hp.

All spells have 9 levels (so maximum of 9X1*10^(1-5))
so for example first spell has the hp adding from 1-9
the second from 10 - 90. etc.

But with some reason my added abilities cannot be setted after.

  • CreepSpawn I Change HP
    • Events
    • Conditions
    • Actions
      • Set CS_HPChangers[1] = +Hp [1]
      • Set CS_HPChangers[2] = +Hp [10]
      • Set CS_HPChangers[3] = +Hp [100]
      • Set CS_HPChangers[4] = +Hp [1000]
      • Set CS_HPChangers[5] = +Hp [10000]
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop-Actions
          • Set CS_HPChanging_Levels[(Integer A)] = 0
      • Set CS_WantedHP = 30
      • Set CS_CurHP = (Integer((Max. Leben of Spinne 0078 <gen>)))
      • Set CS_HPtoAdd = (CS_WantedHP - CS_CurHP)
      • For each (Integer A) from 1 to 9, do (Actions)
        • Loop-Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Conditions
              • CS_HPtoAdd bigger or equal to 10000
            • 'THEN'-Actions
              • Set CS_HPtoAdd = (CS_HPtoAdd - 10000)
              • Set CS_HPChanging_Levels[5] = (CS_HPChanging_Levels[5] + 1)
            • 'ELSE'-Actions
      • For each (Integer A) from 1 to 9, do (Actions)
        • Loop-Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Conditions
              • CS_HPtoAdd bigger or equal to 1000
            • 'THEN'-Actions
              • Set CS_HPtoAdd = (CS_HPtoAdd - 1000)
              • Set CS_HPChanging_Levels[4] = (CS_HPChanging_Levels[4] + 1)
              • 'ELSE'-Actions
      • For each (Integer A) from 1 to 9, do (Actions)
        • Loop-Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Conditions
              • CS_HPtoAdd bigger or equal to 100
            • 'THEN'-Actions
              • Set CS_HPtoAdd = (CS_HPtoAdd - 100)
              • Set CS_HPChanging_Levels[3] = (CS_HPChanging_Levels[3] + 1)
              • 'ELSE'-Actions
      • For each (Integer A) from 1 to 9, do (Actions)
        • Loop-Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Conditions
              • CS_HPtoAdd bigger or equal to 10
            • 'THEN'-Actions
              • Set CS_HPtoAdd = (CS_HPtoAdd - 10)
              • Set CS_HPChanging_Levels[2] = (CS_HPChanging_Levels[2] + 1)
              • 'ELSE'-Actions
      • For each (Integer A) from 1 to 9, do (Actions)
        • Loop-Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Conditions
              • CS_HPtoAdd smaller as 10
              • CS_HPtoAdd bigger als 0
            • 'THEN'-Actions
              • Set CS_HPtoAdd = (CS_HPtoAdd - 1)
              • Set CS_HPChanging_Levels[1] = (CS_HPChanging_Levels[1] + 1)
              • 'ELSE'-Actions
      • Wait 0.30 seconds
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop-Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Conditions
              • CS_HPChanging_Levels[(Integer A)] bigger as 0
            • 'THEN'-Actions
              • Unit - Add CS_HPChangers[(Integer A)] to Spinne 0078 <gen>
            • 'ELSE'-Actions
      • Wait 0.30 seconds
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop-Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Conditions
              • CS_HPChanging_Levels[(Integer A)] bigger as 0
            • 'THEN'-Actions
              • Unit - Set level of CS_HPChangers[(Integer A)] for Spinne 0078 <gen> to CS_HPChanging_Levels[(Integer A)]
              • Game - Display to (All players) for 2.00 seconds the text: ((Name of CS_HPChangers[(Integer A)]) + ( : + (String(CS_HPChanging_Levels[(Integer A)]))))
              • 'ELSE'-Actions
 
  • Unit - Set life of <your unit> to ((Life of <your unit>) + (5.00 x (Real((Level <your ability> for <your unit>)))))
if we go like this:
you have a "base ability" that does nothing, its just leveled... so if laevel of the spell is 5 and trigger gives you 5 life = 25 life (how to set more hp for each level)

for ability i would sudgest for (each integer A) from 1 to xxx...

  • Unit - Add <your "heal" ability> to <your unit>
  • For each (Integer A) from 1 to (X * (<your ability for <your unit>)), do (Actions)
    • Loop - Actions
      • Wait X seconds
      • Unit - Set level of <your "heal" spell> for <your unit> to ((Level of <your "heal" spell> for <your unit>) +1)
  • Unit - Set level of <your "heal" spell> for <your unit> to ((Level of <your "heal" spell> for <your unit>) +1)
You probably looking for this

If this helps.
 
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Your condition
        • Then - Actions
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + 1000.00)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Your condition
        • Then - Actions
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + 1000000.00)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Your condition
        • Then - Actions
          • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + 100000000.00)
        • Else - Actions
edit:
hmmm... but use maximum life.
  • Unit - Set life of (Triggering unit) to ((Max life of (Triggering unit)) + 100000000.00)
use this action MAX LIFE
 
Yeah thanks for that it was raelly helpful but the main problem that my level don't want to be increases does not disappear :(

?
you want to increase and decrease level?

edit:
i think i get =what you are pointing at...
you are using permantent life gain(+50) ability with 9 levels?
than you have seted the life gain for each level, so when the spider spawns give him that ability, when he dont needs it any more remove it.
when you want to be level 5(ability) just give the ability to unit and use action Unit - set level of an ability) and set level, when you dont want to be level 5 any more use again Unit - set level of an ability) and set it to 6
This ability aplies itself when the units gets it (i think)
and when you remove it it comes back to 1, so you must set it for each level.
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Unit - Add Item Permanent Life Gain (+50) to (Triggering unit)
      • Unit - Set level of Item Permanent Life Gain (+50) for (Triggering unit) to 5
 
Status
Not open for further replies.
Top