I need help with my custom spell with triggers

world23wc3

Member
Reaction score
6
Hi!
I'm currently trying to create a custom ability now that i've became better at doing triggers.
Still I encounter parts that I cannot solve myself and therefore I need your help.

This is my trigger called "True power of ice".
There are some variables in this trigger aswell.
true_power_of_ice_array = Special Effect Array[10]
true_power_of_ice_integer = An integer that keeps which "array value" special effects should be saved to. I need to save each effects so that I'm able to remove it when I want to.
true_power_of_ice_unit_group = A unit group that adds every unit that is "600.00" when the ability is used.

Now what the trigger should be doing(but it doesn't in this case because it contains errors).
Events: Trigger starts when a unit uses an effect
Conditions: The effect or ability must be "Ice Moon Power"
Actions:
1) It adds all units to a unit group.
2) It adds a special effect at every unit and sets each created special effect to an special effect array.
3) Waits for five seconds until it removes the effect. -----This does not work-----

I'm not done with my trigger, and it felt useless to add stuff like deal damage and more effect etc. until I know how I fix this.

Trigger:
  • True power of ice
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ice Moon Power(c)
    • Actions
      • Unit Group - Pick every unit in (Units within 600.00 of (Position of (Triggering unit))) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to true_power_of_ice_unit_group
          • Unit Group - Remove (Triggering unit) from true_power_of_ice_unit_group
          • For each (Integer A) from 0 to (Number of units in true_power_of_ice_unit_group), do (Actions)
            • Loop - Actions
              • Special Effect - Create a special effect attached to the chest of (Picked unit) using Abilities\Spells\Human\AerialShackles\AerialShacklesTarget.mdl
              • Set true_power_of_ice_array[true_power_of_ice_integer] = (Last created special effect)
              • Game - Display to (All players) the text: (String(true_power_of_ice_integer))
              • Set true_power_of_ice_integer = (true_power_of_ice_integer + 1)
          • Wait 5.00 seconds
          • For each (Integer A) from 0 to (Number of units in true_power_of_ice_unit_group), do (Actions)
            • Loop - Actions
              • Special Effect - Destroy true_power_of_ice_array[true_power_of_ice_integer]
              • Set true_power_of_ice_integer = (true_power_of_ice_integer - 1)
              • Game - Display to (All players) the text: ((String(true_power_of_ice_integer)) + removed)


All help is much appreciated!
THANKS!
 

PrisonLove

Hard Realist
Reaction score
78
Your problem is that you're using the for loops and the wait in the Unit Group loop. Move the loops and the waits out of the Unit group loop and see how that goes.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top