If Problem

Rllulium

New Member
Reaction score
10
Here is the beginning of a Agility to Evasion system I was building for my map. It works the way it should, except that the second If function in the second trigger ALWAYS goes to "Else - Actions" no matter what. And having the spellbook removed, added and disabled every time the trigger fires is not that great. (It closes the skill leveling menu for example.)

Trigger:
  • Attribute Setup
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Sold unit) is A Hero) Equal to True
    • Actions
      • Set AttributeHero[AttributeIndex] = (Sold unit)
      • Set AttributeIndex = (AttributeIndex + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AttributeIndex Greater than or equal to (Number of players)
        • Then - Actions
          • Set AttributeIndex = 0
          • Trigger - Turn on Evasion <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions

Trigger:
  • Evasion
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set AttributeIndex = (AttributeIndex + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AttributeIndex Greater than or equal to (Number of players)
        • Then - Actions
          • Set AttributeIndex = 0
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AttributeAgility[AttributeIndex] Equal to (Agility of AttributeHero[AttributeIndex] (Include bonuses))
        • Then - Actions
          • Skip remaining actions
        • Else - Actions
          • Unit - Remove Evasion +90% (book) from AttributeHero[AttributeIndex]
          • Unit - Remove Evasion +45% (book) from AttributeHero[AttributeIndex]
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Agility of AttributeHero[AttributeIndex] (Include bonuses)) Greater than or equal to 90
              • Then - Actions
                • Unit - Add Evasion +90% (book) to AttributeHero[AttributeIndex]
                • Player - Disable Evasion +90% (book) for (Owner of AttributeHero[AttributeIndex])
                • Skip remaining actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Agility of AttributeHero[AttributeIndex] (Include bonuses)) Greater than or equal to 45
              • Then - Actions
                • Unit - Add Evasion +45% (book) to AttributeHero[AttributeIndex]
                • Player - Disable Evasion +45% (book) for (Owner of AttributeHero[AttributeIndex])
                • Skip remaining actions
              • Else - Actions
      • Set AttributeAgility[AttributeIndex] = (Agility of AttributeHero[AttributeIndex] (Include bonuses))
 

Executor

I see you
Reaction score
57
Well use some debug messages and compare the condition for yourself to check whats wrong
 

Rllulium

New Member
Reaction score
10
Well use some debug messages and compare the condition for yourself to check whats wrong

I was actually already at work with this. It seems that the variable AttributeAgility[AttributeIndex] is always set to 0. I have no idea why.
 

Rllulium

New Member
Reaction score
10
Turns out that this line:
Trigger:
  • Set AttributeAgility[AttributeIndex] = (Agility of AttributeHero[AttributeIndex] (Include bonuses))

is doing nothing at all. I have even tried setting the variable to alot of oher values; none will stick.
Eventually, I ran a second trigger at the same interval, always right after the first. Defining the variable there is no problem whatsoever.
How can it be this way?
 
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