Detecting Defend

vypur85

Hibernate
Reaction score
803
Code:
Event
 A unit is issued an order with no target
Condition
Actions
 If then else conditions
   If - Conditions
     Issued order Equal to String(defendon)
   Then - Actions
     -Do your stuff-
   Else
 If then else conditions
   If - Conditions
     Issued order Equal to String(defendoff)
   Then - Actions
     -Do your stuff-
   Else

I've forgotten what's the exact order string for Defend. But basically the detection is detected via issued order event.
 

Sirroelivan

Gunnerkrigg Court
Reaction score
95
I tried it, but it's not working. These are my triggers.

Code:
Creature Card Played
    Events
        Unit - Deck Master 0001 <gen> Uses an item
        Unit - Deck Master 0002 <gen> Uses an item
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Item-type of (Item being manipulated)) Equal to Chillspawn Dragon
                (Item-type of (Item being manipulated)) Equal to Ragefire Dragon
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Bol_Summon_Type[(Player number of (Owner of (Hero manipulating item)))] Equal to False
            Then - Actions
                Set Point = (Random point in Reg_Defender[(Player number of (Owner of (Hero manipulating item)))])
                Unit - Create 1 Unt_Type_Creature[(Integer((Current life of (Item being manipulated))))] for (Owner of (Hero manipulating item)) at Point facing Facing[(Player number of (Owner of (Hero manipulating item)))] degrees
                Custom script:   call RemoveLocation(udg_Point)
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Bol_Summon_Type[(Player number of (Owner of (Hero manipulating item)))] Equal to True
            Then - Actions
                Set Point = (Random point in Reg_Attacker[(Player number of (Owner of (Hero manipulating item)))])
                Unit - Create 1 Unt_Type_Creature[(Integer((Current life of (Item being manipulated))))] for (Owner of (Hero manipulating item)) at Point facing Facing[(Player number of (Owner of (Hero manipulating item)))] degrees
                Unit - Set the custom value of (Last created unit) to 1
                Custom script:   call RemoveLocation(udg_Point)
            Else - Actions
                Do nothing

Code:
Change Summon Type
    Events
        Unit - A unit Is issued an order with no target
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Issued order) Equal to (Order(defend))
            Then - Actions
                Set Bol_Summon_Type[(Player number of (Owner of (Ordered unit)))] = True
            Else - Actions
                Do nothing
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Issued order) Equal to (Order(undefend))
            Then - Actions
                Set Bol_Summon_Type[(Player number of (Owner of (Ordered unit)))] = False
            Else - Actions
                Do nothing

It doesn't matter if i use defend with the deckmaster, the units keep being created in regdefender.
 

Sirroelivan

Gunnerkrigg Court
Reaction score
95
doesn't work. But I'll think i'll do it differently. I'll make two version of the deck master, only different in the editor, and detect what version of the deck master used the item to determine in which region to spawn.
 
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