• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Code Problem - please have a look

Status
Not open for further replies.
Level 15
Joined
Nov 26, 2005
Messages
1,151
Here, I have a trigger that I don't know what's wrong with. It is supposed to skip to the 2nd If/then/else func. but It never does o_O


  • LP Death Trigger
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is in LifePower_units) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Dying unit) belongs to an enemy of (Load 2 of (Key (Dying unit)) in Hasttable_LP)) Equal to True
        • Then - Actions
          • Unit Group - Pick every unit in (Units within 350.00 of (Position of (Dying unit)) matching ((((Matching unit) belongs to an ally of (Owner of (Dying unit))) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is dead) Equal to False)))) and do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
              • Unit - Cause (Load 2 of (Key (Dying unit)) in Hasttable_LP) to damage (Picked unit), dealing ((Real((Level of Life Power for (Load 2 of (Key (Dying unit)) in Hasttable_LP)))) x 20.00) damage of attack type Spells and damage type Normal
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Dying unit) belongs to an ally of (Load 2 of (Key (Dying unit)) in Hasttable_LP)) Equal to True
        • Then - Actions
          • Unit Group - Pick every unit in (Units within 350.00 of (Position of (Dying unit)) matching ((((Matching unit) belongs to an enemy of (Owner of (Dying unit))) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) is dead) Equal to False)))) and do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the overhead of (Picked unit) using Abilities\Spells\Items\AIre\AIreTarget.mdl
              • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + ((Real((Level of Life Power for (Load 2 of (Key (Dying unit)) in Hasttable_LP)))) x 20.00))
        • Else - Actions
          • Do nothing
      • Special Effect - Destroy (Load 1 of (Key (Dying unit)) in Hasttable_LP)
      • Unit Group - Remove (Dying unit) from LifePower_units


Can you find anything wrong ?
 
Last edited:
Level 15
Joined
Nov 26, 2005
Messages
1,151
That was the first way I created it. But it did not work o_O
So I changed the structure to 2 seperate IF/then/Else funcs. But it still does not work...
It always triggers the first func [the damage uupon death]... That's odd
 
Level 15
Joined
Nov 26, 2005
Messages
1,151
Yes, the hastable is working. The other part of the spell is working perfectly. I am useing the same hastables and values as in the other part of my spell.

It just ... does not understand the IF condition o_O It always damages with the death coil effect instead of healing when the dying unit is allied :?
 
Level 15
Joined
Nov 26, 2005
Messages
1,151
Alies of the dying unit, IF it is an enemy of the caster (2 of Key(Dying Unit) in Hashtable is my caster)
Isn't tht right ? Or is there a mistake :?


I think I found my mistake... I was comparing to the DYING unit. And his allies are not always enemies of the caster... I will try and see what happens.
 
Status
Not open for further replies.
Top