Risk-Style trigger help?

Shadows

New Member
Reaction score
2
As far as I am concerned, this trigger should work. Basically, I'm testing it with the situation of an enemy controlled circle of power with one defender. When I enter the region, it will print "1, 2". Which makes sense. However, after it is done counting, and I re-enter the region it still prints the same answer instead of the one I would prefer. Any ideas?

Code:
Azzuer T2
    Events
        Unit - A unit enters T02 <gen>
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Owner of (Entering unit)) Equal to Player 1 (Red)
                (Owner of (Entering unit)) Equal to Player 2 (Blue)
                (Owner of (Entering unit)) Equal to Player 3 (Teal)
                (Owner of (Entering unit)) Equal to Player 4 (Purple)
                (Owner of (Entering unit)) Equal to Player 5 (Yellow)
                (Owner of (Entering unit)) Equal to Player 6 (Orange)
                (Owner of (Entering unit)) Equal to Player 7 (Green)
                (Owner of (Entering unit)) Equal to Player 8 (Pink)
    Actions
        Set EnmCounter = 0
        Unit Group - Pick every unit in (Units within 750.00 of (Center of T02 <gen>)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Owner of (Picked unit)) Equal to (Owner of Territory (Norm Territory) 0005 <gen>)
                    Then - Actions
                        Set EnmCounter = (EnmCounter + 1)
                        Game - Display to (All players) the text: (String(EnmCounter))
                    Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                EnmCounter Less than or equal to 1
            Then - Actions
                Unit - Change ownership of Territory (Norm Territory) 0005 <gen> to (Owner of (Entering unit)) and Change color
            Else - Actions

Thanks for any help.
 

Charapanga

New Member
Reaction score
46
Code:
        Set EnmCounter = 0
Maybe that? It sets it to 0 every time you enter
for integers, 0 is set when the game starts
 

Shadows

New Member
Reaction score
2
I'm reusing the same integer as a tempary integer and resetting it every time that it runs. It it was actually resetting it, then I would be very happy with it. However, it seems to keep the amount. (Ex, in my situation, even when I kill the defender, it retains the value of 2).
 

Charapanga

New Member
Reaction score
46
Then do another trigger...
E
Unit is killed
C
Unit type of killed unit equal to defender
A
set EnmCount = EnmCount -1
Display to all players the thext ....

If that's what you want, that trigger only runs when a unit enters a region, and EnmCount stays the same as it is set
 

Shadows

New Member
Reaction score
2
New revised trigger.

Code:
Azzuer T2
    Events
        Unit - A unit Dies
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Owner of (Killing unit)) Equal to Player 1 (Red)
                (Owner of (Killing unit)) Equal to Player 2 (Blue)
                (Owner of (Killing unit)) Equal to Player 3 (Teal)
                (Owner of (Killing unit)) Equal to Player 4 (Purple)
                (Owner of (Killing unit)) Equal to Player 5 (Yellow)
                (Owner of (Killing unit)) Equal to Player 6 (Orange)
                (Owner of (Killing unit)) Equal to Player 7 (Green)
                (Owner of (Killing unit)) Equal to Player 8 (Pink)
        Or - Any (Conditions) are true
            Conditions
                (Unit-type of (Dying unit)) Equal to Armed Peasant
                (Unit-type of (Dying unit)) Equal to Ranged Peasant
    Actions
        Set EnmCounter = 0
        Unit Group - Pick every unit in (Units within 750.00 of (Center of T02 <gen>)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Owner of (Picked unit)) Equal to (Owner of Territory (Norm Territory) 0005 <gen>)
                    Then - Actions
                        Set EnmCounter = (EnmCounter + 1)
                    Else - Actions
        Set EnmCounter = (EnmCounter - 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                EnmCounter Equal to 0
            Then - Actions
                Unit - Change ownership of Territory (Norm Territory) 0005 <gen> to (Owner of (Killing unit)) and Change color
            Else - Actions
 
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