Trigger Giving Error

Leazy

You can change this now in User CP.
Reaction score
50
Hello, I made a trigger that is suppose to cast a spell at units on a special terrain type (in this case Lava Bricks). However, the trigger gives me error.
This is the trigger:

Code:
Take Damage On Lava
    Events
        Time - Every 0.10 seconds of game time
    Conditions
    Actions
        Set UnitGroup[1] = (Units in (Playable map area))
        Unit Group - Pick every unit in UnitGroup[1] and do (Actions)
            Loop - Actions
                Set Point[1] = (Position of (Picked unit))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        And - All (Conditions) are true
                            Conditions
                                (Terrain type at Point[1]) Equal to Dungeon - Lava Cracks
                                ((Picked unit) has buff Lava ) Equal to False
                    Then - Actions
                        Unit - Create 1 Dummy Unit for (Player((Custom value of (Picked unit)))) at Point[1] facing Default building facing degrees
                        Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                        Unit - Add Damage on Lava  to (Last created unit)
                        Unit - Order (Last created unit) to Undead Necromancer - Unholy Frenzy (Picked unit)
                    Else - Actions
        Custom script:   call RemoveLocation (udg_Point[1])
        Custom script:   call DestroyGroup(udg_UnitGroup[1])
 

R@i_no_Wyrm

New Member
Reaction score
43
Code:
Take Damage On Lava
    Events
        Time - Every 0.10 seconds of game time
    Conditions
    Actions
        Set UnitGroup[1] = (Units in (Playable map area))
        Unit Group - Pick every unit in UnitGroup[1] and do (Actions)
            Loop - Actions
                Set Point[1] = (Position of (Picked unit))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        And - All (Conditions) are true
                            Conditions
                                (Terrain type at Point[1]) Equal to Dungeon - Lava Cracks
                                ((Picked unit) has buff Lava ) Equal to False
                    Then - Actions
                        Unit - Create 1 Dummy Unit for (Player((Custom value of (Picked unit)))) at Point[1] facing Default building facing degrees
                        Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                        Unit - Add Damage on Lava  to (Last created unit)
                        Unit - Order (Last created unit) to Undead Necromancer - Unholy Frenzy (Picked unit)
                    Else - Actions
        [del]Custom script:   call RemoveLocation (udg_Point[1])[/del]<-- Put it so it loops as the picked unit loops
        Custom script:   call DestroyGroup(udg_UnitGroup[1])

Does all units in the map have custom value?
 

Leazy

You can change this now in User CP.
Reaction score
50
I added two conditions to clear it up, thanks for all the help. The trigger is now working and looking like this:

Code:
Take Damage On Lava
    Events
        Time - Every 0.10 seconds of game time
    Conditions
    Actions
        Set UnitGroup[1] = (Units in (Playable map area) matching (((Matching unit) is alive) Equal to True))
        Unit Group - Pick every unit in UnitGroup[1] and do (Actions)
            Loop - Actions
                Set Point[1] = (Position of (Picked unit))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        And - All (Conditions) are true
                            Conditions
                                (Terrain type at Point[1]) Equal to Dungeon - Lava Cracks
                                ((Picked unit) has buff Lava ) Equal to False
                    Then - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Custom value of (Picked unit)) Greater than or equal to 1
                                (Custom value of (Picked unit)) Less than or equal to 12
                            Then - Actions
                                Unit - Create 1 Dummy Unit for (Player((Custom value of (Picked unit)))) at Point[1] facing Default building facing degrees
                            Else - Actions
                                Unit - Create 1 Dummy Unit for Neutral Hostile at Point[1] facing Default building facing degrees
                        Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
                        Unit - Add Damage on Lava  to (Last created unit)
                        Unit - Order (Last created unit) to Undead Necromancer - Unholy Frenzy (Picked unit)
                    Else - Actions
                Custom script:   call RemoveLocation (udg_Point[1])
        Custom script:   call DestroyGroup(udg_UnitGroup[1])
 
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