This spell trigger is driving me crasy! T.T

Magoiche

Member
Reaction score
20
Code:
MA Settings
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to (==) Mystical Axe 
        ((Triggering unit) is A Hero) Equal to (==) True
    Actions
        Set MA_Caster = (Triggering unit)
        Set MA_CasterOwner = (Owner of MA_Caster)
        Set MA_CasterPosition = (Position of MA_Caster)
        Set MA_RandomNumber = (Random integer number between 1 and 100)
        Set MA_RandomNumberOfAxes = (Random integer number between 2 and 3)
        Set MA_Chance = (33 x (Level of Mystical Axe  for MA_Caster))
        Set MA_Range = 700.00
        Trigger - Run MA Effects <gen> (ignoring conditions)
Code:
MA Effects
    Events
    Conditions
    Actions
         Do Multiple ActionsFor each (Integer MA_Loop) from 1 to MA_RandomNumberOfAxes, do (Actions)
            Loop - Actions
                 Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        MA_RandomNumber Less than or equal to (<=) MA_Chance
                    Then - Actions
                        Unit Group - Pick every unit in (Units within MA_Range of MA_CasterPosition matching ((((Matching unit) belongs to an enemy of MA_CasterOwner) Equal to (==) True) and (((Matching unit) is alive) Equal to (==) True))) and do (Actions)
                            Loop - Actions
                                Unit Group - Add (Picked unit) to MA_PossibleTargets
                        Unit - Create 1 Dummy Unit for MA_CasterOwner at MA_CasterPosition facing 0.00 degrees
                        Set MA_Dummy = (Last created unit)
                        Unit - Add a 2.00 second Generic expiration timer to MA_Dummy
                        Unit - Add Mystical Axe  to MA_Dummy
                        Unit - Set level of Mystical Axe  for MA_Dummy to (Level of Mystical Axe  for MA_Caster)
                        Unit - Order MA_Dummy to Human Mountain King - Storm Bolt (Random unit from MA_PossibleTargets)
                    Else - Actions
                        Do nothing
Whem i cast the spell the WC crashes. Not much to say.
I am with this problem for 2 days and can't solve it T.T
 

vypur85

Hibernate
Reaction score
803
> You're right.

Er... Is the problem solved?


The problem with the trigger could be infinite loop (which is the usual cause of crash).

Code:
Unit - Add Mystical Axe  to MA_Dummy
Unit - Set level of Mystical Axe  for MA_Dummy to (Level of Mystical Axe  for MA_Caster)

You add the same spell to the dummy and order the dummy to cast the spell. So the first trigger will fire repeatedly every time your dummy casts the spell. And this continues infinitely. So crash :). I think.... Unless your actual ability has the exact same name as the dummy ability.


Edit (for below post):
Ignoring condition should work fine. It only ignores the main condition, but not the if then else.
 

Curo

Why am I still playing this game...?
Reaction score
109
What vypur said. Also:

Trigger - Run MA Settings <gen> (ignoring conditions)

I don't think you want to ignore the conditions.
 

Magoiche

Member
Reaction score
20
vypur.
I put a condition that only accepts if a hero casts.
See in he first trigger =P

But the problem is already solved xD
 
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