• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Help me!!! Asap

Status
Not open for further replies.
Level 7
Joined
Mar 6, 2014
Messages
203
hello i got a problem in my trigger when i cast it once its fine but when two caster cast it the other one will become normal but the second one is not normal.. this is the trigger..

  • Rage
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Rage
    • Actions
      • Set RageIndex = (RageIndex + 1)
      • Set RageCaster[RageIndex] = (Triggering unit)
      • Set RageStack[RageIndex] = 0.00
      • Set RageSize[RageIndex] = (100.00 + RageStack[RageIndex])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RageIndex Greater than or equal to 0
        • Then - Actions
          • Trigger - Turn on Rage Loop <gen>
        • Else - Actions
the loop trigger...

  • Rage Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer RageRecycle) from 1 to RageIndex, do (Actions)
        • Loop - Actions
          • Set RageStack[RageRecycle] = (RageStack[RageRecycle] + 1.00)
          • Set RageSize[RageRecycle] = (100.00 + RageStack[RageRecycle])
          • Animation - Change RageCaster[RageRecycle]'s size to (RageSize[RageRecycle]%, RageSize[RageRecycle]%, RageSize[RageRecycle]%) of its original size
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RageStack[RageRecycle] Greater than or equal to 75.00
            • Then - Actions
              • Animation - Change RageCaster[RageRecycle]'s size to (100.00%, 100.00%, 100.00%) of its original size
              • Set RageCaster[RageRecycle] = RageCaster[RageIndex]
              • Set RageRecycle = (RageRecycle - 1)
              • Set RageIndex = (RageIndex - 1)
              • Set RageSize[RageRecycle] = RageSize[RageIndex]
              • Set RageStack[RageRecycle] = RageStack[RageIndex]
              • Trigger - Turn off (This trigger)
            • Else - Actions
 
Level 12
Joined
Nov 3, 2013
Messages
989
Shouldn't
  • Set RageSize[RageRecycle] = RageSize[RageIndex]
  • Set RageStack[RageRecycle] = RageStack[RageIndex]
both be before:

  • Set RageRecycle = (RageRecycle - 1)
  • Set RageIndex = (RageIndex - 1)
Although this isn't really related to the problem in question, no reason to add 0.

  • Set RageStack[RageIndex] = 0.00
  • Set RageSize[RageIndex] = (100.00 + RageStack[RageIndex])
 
You always turn your periodic trigger off in your deinex part. Make a check first if RageIndex Equals 0.

And you only need to turn it on if RageIndex Equals 1.

Btw, using an integer for the counter (RageStack) would make more sense and if you Set RageSize[RageRecycle] you can use Integer2Real function.

Also what Death Adder said, settings RageSize[RageIndex] = 100 + 0 doesn't make sense.
 
Level 7
Joined
Mar 6, 2014
Messages
203
You always turn your periodic trigger off in your deinex part. Make a check first if RageIndex Equals 0.

And you only need to turn it on if RageIndex Equals 1.

Btw, using an integer for the counter (RageStack) would make more sense and if you Set RageSize[RageRecycle] you can use Integer2Real function.

Also what Death Adder said, settings RageSize[RageIndex] = 100 + 0 doesn't make sense.

can you make an example?? Im a not pro making MUI trigger this is my first mui spell so i want it to become perfect
 
If RageStack[RageRecycle] Greater than or equal to 75.00 ....

...then comes your deindex part. This is also the part where you reset the unit's size again.

But your problem is that if you deindex any unit you also turn off the trigger each time. That's wrong, because there still might be other units indexed.

Solution: Add a If/Then/Else into your deindex part to check if there are units left or not.

  • ... your deindex part
  • ...
  • (If RageIndex Equals 0)
    • Then - Actions
      • Trigger - Turn Off
    • Else - Actions
So it only gets turned off if there is no index left.
 
Level 7
Joined
Mar 6, 2014
Messages
203
If RageStack[RageRecycle] Greater than or equal to 75.00 ....

...then comes your deindex part. This is also the part where you reset the unit's size again.

But your problem is that if you deindex any unit you also turn off the trigger each time. That's wrong, because there still might be other units indexed.

Solution: Add a If/Then/Else into your deindex part to check if there are units left or not.

  • ... your deindex part
  • ...
  • (If RageIndex Equals 0)
    • Then - Actions
      • Trigger - Turn Off
    • Else - Actions
So it only gets turned off if there is no index left.
argggghhh icemanbo its still bugged! When 2 hero cast it by the same time the first caster will work fine but when the trigger stop the other will not back to normal @_@. Can you show me the right full trigger?
 
Level 13
Joined
Jul 16, 2012
Messages
679
Here...

Triggers
    • Rage Start
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Rage
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Rage_Y Equal to 0
          • Then - Actions
            • Trigger - Turn on Rage Loop <gen>
          • Else - Actions
        • Set Rage_Y = (Rage_Y + 1)
        • Set Rage_Caster[Rage_Y] = (Triggering unit)
        • Set Rage_Stack[Rage_Y] = 0.00
        • Set Rage_Size[Rage_Y] = 100.00
    • Rage Loop
      • Events
        • Time - Every 0.03 seconds of game time
      • Conditions
      • Actions
        • For each (Integer Rage_X) from 1 to Rage_Y, do (Actions)
          • Loop - Actions
            • Set Rage_Stack[Rage_X] = (Rage_Stack[Rage_X] + 1.00)
            • Set Rage_Size[Rage_X] = (Rage_Size[Rage_Y] + Rage_Stack[Rage_X])
            • Animation - Change Rage_Caster[Rage_X]'s size to (Rage_Size[Rage_X]%, 100.00%, 100.00%) of its original size
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Rage_Stack[Rage_X] Greater than or equal to 75.00
              • Then - Actions
                • Animation - Change Rage_Caster[Rage_X]'s size to (100.00%, 100.00%, 100.00%) of its original size
                • Set Rage_X = (Rage_X - 1)
                • Set Rage_Y = (Rage_Y - 1)
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • Rage_Y Equal to 0
                  • Then - Actions
                    • Trigger - Turn off (This trigger)
                    • Skip remaining actions
                  • Else - Actions
              • Else - Actions
This is already tested
:)
 
Status
Not open for further replies.
Top