Triggered Spell

Manwe_Sulimo

New Member
Reaction score
0
I have problems with this spell, i worked for hours on this (it is just for fun purposes only)
sense of it: when paladin casts a dummy spell 4/7/10 units (allied non-undead, or enemy undead) in 450 range are healed / damaged by holy light

the weird thing is that it doesn't work properly (either no holy light is done, or just once)

note that the dummy unit i use has 0 spell animation and the spell has no cooldown or mana cost
Trigger:
  • Mass Heal
    • Events
      • Unit - Paladin 0004 <gen> Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mass Holy Light
    • Actions
      • Set PA1[1] = (1 + (3 x (Level of Mass Holy Light for Paladin 0004 <gen>)))
      • Set PA3 = (Position of Paladin 0004 <gen>)
      • Set PA2[1] = (Units within 450.00 of PA3 matching (((((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is Undead) Equal to True) and (((Matching unit) is alive) Equal to Tr
      • Unit - Create 1 Dummy for Player 1 (Red) at PA3 facing Default building facing (270.0) degrees
      • Set PA4[1] = (Last created unit)
      • Unit - Add Mass Holy Light (target) to PA4[1]
      • Unit Group - Pick every unit in PA2[1] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PA1[2] Less than or equal to PA1[1]
            • Then - Actions
              • Unit - Order PA4[1] to Human Paladin - Holy Light (Picked unit)
              • Wait 0.01 game-time seconds
              • Animation - Change (Picked unit)'s size to (300.00%, 300.00%, 300.00%) of its original size
            • Else - Actions
              • Do nothing
          • Set PA1[2] = (1 + PA1[2])
      • Unit - Add a 0.01 second Generic expiration timer to PA4[1]
      • Unit Group - Pick every unit in PA2[1] and do (Actions)
        • Loop - Actions
          • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 0.00%, 0.00%) with 0.00% transparency
          • Wait 5.00 game-time seconds
          • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
      • Custom script: call RemoveLocation(udg_PA3)


the weird thing is mainly that the first loop does hardly work at all (a text message i used to test showed but the holy light and so on makes problems), while thee second one does work slightly better (the tinting is done, only the retinting is not done)

any one got a clue where the problem is?
 

Tyrulan

Ultra Cool Member
Reaction score
37
Can you post with WC3 tags, not the Code? I could read it better like that.
 

Sneakster

Active Member
Reaction score
24
Could be the generic expiration timer. Seems like it deletes the unit while you still are editing its values.
 

Naga'sShadow

Ultra Cool Member
Reaction score
49
Trigger:
  • Mass Heal
    • Events
      • Unit - Paladin 0004 <gen> Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mass Holy Light
    • Actions
      • Set PA1[1] = (1 + (3 x (Level of Mass Holy Light for Paladin 0004 <gen>)))
      • Set PA3 = (Position of Paladin 0004 <gen>)
      • Set PA2[1] = (Units within 450.00 of PA3 matching (((((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is Undead) Equal to True) and (((Matching unit) is alive) Equal to Tr
      • Unit - Create 1 Dummy for Player 1 (Red) at PA3 facing Default building facing (270.0) degrees
      • Set PA4[1] = (Last created unit)
      • Unit - Add Mass Holy Light (target) to PA4[1]
      • Unit Group - Pick every unit in PA2[1] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PA1[2] Less than or equal to PA1[1]
            • Then - Actions
              • Unit - Order PA4[1] to Human Paladin - Holy Light (Picked unit)
              • Wait 0.01 game-time seconds
              • Animation - Change (Picked unit)'s size to (300.00%, 300.00%, 300.00%) of its original size
            • Else - Actions
              • Do nothing
          • Set PA1[2] = (1 + PA1[2])
      • Unit - Add a 0.01 second Generic expiration timer to PA4[1]
      • Unit Group - Pick every unit in PA2[1] and do (Actions)
        • Loop - Actions
          • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 0.00%, 0.00%) with 0.00% transparency
          • Wait 5.00 game-time seconds
          • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
      • Custom script: call RemoveLocation(udg_PA3)


Here's the code in war 3 tags. Your problem is that the dummy can't do all of that at once. Place the create dummy in your loop order it to cast and then get rid of it. That way the dummy will cast for each. Is there a reason for the array variables, as you index them all by 1 rather than by something unique to the spell.
 

Nivius

TH.net Regular
Reaction score
5
barrage should give u a hand maybe?

attack friendly's whit 0 dmg within range,
give attacked unit a buff
if any user have buff give holy light~

?
 

Manwe_Sulimo

New Member
Reaction score
0
oh sry, didn't know about that, rarely use this forum

hmm tried around now a bit it still doesn't work properly, what about this (btw does last created unit and picked unit leak?)
Trigger:
  • Mass Heal
    • Events
      • Unit - Paladin 0004 <gen> Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Mass Holy Light
    • Actions
      • Set PA1[1] = (1 + (3 x (Level of Mass Holy Light for Paladin 0004 <gen>)))
      • Set PA3 = (Position of Paladin 0004 <gen>)
      • Set PA2[1] = (Units within 450.00 of PA3 matching (((((Matching unit) belongs to an enemy of Player 1 (Red)) Equal to True) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is Undead) Equal to True) and (((Matching unit) is alive) Equal to Tr
      • Unit Group - Remove Paladin 0004 <gen> from PA2[1]
      • Unit - Add Mass Holy Light (target) to PA4[1]
      • Unit Group - Pick every unit in PA2[1] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PA1[2] Less than or equal to PA1[1]
            • Then - Actions
              • Set PA1[2] = (1 + PA1[2])
              • Unit - Create 1 Dummy for Player 1 (Red) at PA3 facing Default building facing (270.0) degrees
              • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
              • Unit - Order (Last created unit) to Human Paladin - Holy Light (Picked unit)
            • Else - Actions
              • Do nothing
      • Unit Group - Pick every unit in PA2[1] and do (Actions)
        • Loop - Actions
          • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 0.00%, 0.00%) with 0.00% transparency
      • Wait 5.00 game-time seconds
      • Unit Group - Pick every unit in PA2[1] and do (Actions)
        • Loop - Actions
          • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
      • Custom script: call RemoveLocation(udg_PA3)
      • Set PA1[2] = 0
 

Tyrulan

Ultra Cool Member
Reaction score
37
You need to come up with more descriptive names for your global variables. Using PA1,2,3,4 etc (Point Array?) is very confusing and causes me trouble when trying to understand the nature of spell. Rename these to something more readable and I will gladly help you debug your spell.

**Remember, the length of a variable name has NO effect on the how fast the game will run, don't be afraid to make em longer!**
 

Defi4nc3

Developer of DORPG
Reaction score
20
PA4[1] where is this being declared? I do not see it.

Remove taking the paladin out of the unit group, your not a enemy of yourself. Unless your emo.

Your not adding the ability to your dummy, its trying to cast something it doesn't have... Unless PA4[1] is a pre-created dummy but than your trigger would make no sense...

Trigger:
  • Unit - Add Mass Holy Light (target) to Last Created Unit


After you create your dummy.
 

Manwe_Sulimo

New Member
Reaction score
0
rofl, ye i forgot to change that when i was adapting it to last version, it works perfectly fine it seems to even work somehow that it only picks damaged units to heal although i havent put a check for that in it

paladin could heal himself which i do not intend, thats why he is removed from the group

btw there are some other mistakes in the spell (it checks buildings in the group ^^), which i don't care though it's just for testing purposes

anyways thanks for the help

longer variables don't increase mapsize? (by a minimum amount but if you have like 150 variables in a big map?) what about arrays, is 1 variable with 2 arrays got better performance than 2 variables with no array?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top