• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

[Trigger] [gui] Damage taken?!?

Status
Not open for further replies.
Level 3
Joined
Jul 19, 2008
Messages
39
first : My World Edit is in french so i will try to translate the triggers :p

Heres my prob, when i try to make to a variable to damage taken (as response to the event a unit is attacked), the variable always stays to 0

Heres a simple trigger that dont works:

-----------------------------------------------
Event:
A unit takes damage

Action:
Set [variable] to [damage taken]
------------------------------------------------------

and when i ask WE to show players wut is the variable it always show 0
And after all, i am like WTF? thats it :p

Sry for bad english, ive done my best (or near of it)
 
Level 5
Joined
Jul 14, 2008
Messages
121
There:

  • Damage Group
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to UnitGroup_Damage
          • Trigger - Add to Damage Detect <gen> the event (Unit - (Picked unit) Takes damage)
  • Add Unit
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Triggering unit) is in UnitGroup_Damage) Equal to False
    • Actions
      • Unit Group - Add (Entering unit) to UnitGroup_Damage
      • Trigger - Add to Damage Detect <gen> the event (Unit - (Triggering unit) Takes damage)
  • Damage Detect
    • Events
    • Conditions
    • Actions
      • Floating Text - Create floating text that reads (String((Damage taken))) above (Triggering unit) with Z offset 0.00, using font size 9.00, color (100.00%, 0.00%, 0.00%), and 20.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 120.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
Hope it help.
 
Level 3
Joined
Jul 19, 2008
Messages
39
Nope :( still dont works

Here are my (simplified) triggers ( i removed everythings that works fine and this is only the things that have a link to the problem trigger)


Trigger 1 : Set attacked unit to a variable
-----------------------------
Event :
A unit is attacked
Condition :
Attacked unit = [variable ] (It's an hero, it works fine)
Action :
Set attacked unit to [variable2]
Turn off [this trigger]
Wait 0.05 sec
Turn on [This trigger]
-----------------------------------------------


Trigger 2 : Add event
-----------------------------------------------
Event:
A unit learn a new ability
Condition :
Learned hero skill = [my skill]
Action :
Add the event [variable2] takes dmg to [trigger3]
Turn on [trigger1]
---------------------------------------------------


Trigger 3 : The WTF trigger
--------------------------------------------------
Event:

Condition:
Damage source = [variable]
Action :
Set [integrer2] to [integrer2]+[damage taken]
----------------------------------------------------

When i put [Variable] takes damage, it works fine

So WTF!!
 
Level 3
Joined
Feb 13, 2008
Messages
65
Your issue is that you're setting the unit being attacked (attacked unit) to the unit variable then you have the condition "Damage source = Variable" which means that the source of the damage is the variable, which in this case its not.
 
Level 3
Joined
Jul 19, 2008
Messages
39
Yay it works!

Heres my finished spell :D


Trigger 0 : (This spell is runned when the spell is learned)
------------------------------------------------------------------
  • Gardien Enchantements oublies temps
    • Event
    • Conditions
    • Actions
      • Set Gardien_Magies_Entiers[4] = 0
      • Wait 20.00 seconds
      • Set Gardien_Magies_Entiers[4] = 1

Trigger 1 :
  • << Gardien Enchantements oublies attaque >>
  • Event :
    • A unit is attacked
  • Conditions
    • (Attacking unit) Equal to* [Gardien_Magies_Unites[0]]
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si - Conditions
        • ((Attacked unit) is in Gardien_Magies_Groupes[1]) Egal to* TRUE
      • Alors - Actions
        • Unit group - Add (Triggering unit) to Gardien_Magies_Groupes[0]
      • Sinon - Actions
        • Unit group - Add (Triggering unit) to Gardien_Magies_Groupes[0]
        • Unit group - Add (Triggering unit) to Gardien_Magies_Groupes[1]
        • unit group - Pick every unit in Gardien_Magies_Groupes[0] and do (Actions)
          • Loop - Actions
            • Trigger - Add to Gardien Enchantements oublies degats subis <gen> the event (Unit - (Picked unit) takes damage)

Trigger 2 :
  • Gardien Enchantements oublies degats subis
  • Event:
  • Conditions
    • And - All (Conditions) are true
      • Conditions
        • (Damage source) Equal to* Gardien_Magies_Unites[0]
        • ((Triggering unit) is in Gardien_Magies_Groupes[0]) Equal to* TRUE
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • Si - Conditions
        • Gardien_Magies_Entiers[4] Equal to* 0
      • Alors - Actions
        • Set Gardien_Magies_Entiers[3] = (Gardien_Magies_Entiers[3] + (Integer((Damage taken))))
      • Sinon - Actions
        • Trigger - Run Gardien Enchantements oublies temps <gen> (ignoring conditions)
        • (create a dummy /w a autocast +expiration)
    • Unit group - Remove all units from Gardien_Magies_Groupes[0]
Trigger 3 :
  • Gardien Enchantements oublies magie soins
    • Events
      • Unit - Unit beging the effect of a ability (lol)
    • Conditions
      • (Ability being cast) Equal to* CASTEUR Enchantements
    • Actions
      • (some randorg spell triggering using Gardien_Magies_Entiers[3] )
      • Set Gardien_Magies_Entiers[3] = 0
      • Unit group - Remove all units from Gardien_Magies_Groupes[0]
Sry for french parts :p
 
Status
Not open for further replies.
Top