• 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] Quick question regarding a For loop and multiple ITEs.

Status
Not open for further replies.
Level 20
Joined
Apr 14, 2012
Messages
2,901
Okay, it's been a while since I last used GUI coding so I thought I'd give it a shot again. I haven't fully mastered static indexing for MUI-spells yet so I'm still learning the tricks to it.

I'm having a little difficulty in this part of the trigger:

  • Set II_Wait[II_CurrentIndex] = II_Wait[II_CurrentIndex] + 1
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • II_Wait[II_CurrentIndex] Equal to 99
    • Then - Actions
      • -------- spell actions --------
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • II_Wait[II_CurrentIndex] Equal to 66
        • Then - Actions
          • -------- spell actions --------
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • II_Wait[II_CurrentIndex] Equal to 33
            • Then - Actions
              • -------- spell actions --------
            • Else - Actions


As you might notice, there are 3 ITEs inside of each other, each checking if integer Wait[] is equal to 33, then 66, then 99. Therefore there would be three actions that would be performed after each interval.

Now what I can't figure out is, how to put the whole thing into a loop (let's say for each tempint from 1 to n, where n is the number of intervals between the actions of the spell) so that it's not only limited to three groups of actions but also saving me the task of creating more and more ITEs.

I need you help here...
Sincerely,
MT.
 
Level 20
Joined
Apr 14, 2012
Messages
2,901
Hmm... something like this?

  • set int = 33
  • Loop - for each tempint from 1 - 4, do Actions
    • Loop - actions
      • If - conditions
        • value <= 33 * tempint
      • Then - actions
        • --- ----- ----
      • Else -actions
        • If - conditions
          • value <= 33 * tempint
I'm pretty sure it's not correct so... could you try showing me how it works in a loop?
 
Level 20
Joined
Apr 14, 2012
Messages
2,901
I should've made this clear earlier: I want to make a loop in which the actions in the ITEs can be performed as many times as possible (in this case, 'many times' can be configured like: For each temp in from 1 to n) with the actions still having the same interval between them.

Being able to do that will remove the tiring work of adding ITEs over-and-over again in the case that I may want to add more groups of actions.
 
Level 20
Joined
Apr 14, 2012
Messages
2,901
Okay I'll try:

-See in the trigger's current state, it can only perform action 1, 2, and 3.
-Between actions 1, 2, and 3 are intervals caused by integer counters (you taught this to me)
-Now, I'm having a problem: what if I want to add action no.4? I'd have to add another ITE to the trigger. What if I want to add Action 5, 6, 7, 8, and more actions to it? It's not practical to keep adding more and more ITEs to the trigger.
-Having known this problem, I want to find out how to perform multiple actions (these are actions 1, 2, 3, 4, ... n) while still keeping the configurable, integer-counter interval.
 
oooo lol. Now i understand what you mean sorry been a long day lol.

ok first you need one ITE / an Integer base / integer multiplier / counter

the base integer can be a normal integer the multiplier should be an integer array when doing indexing.
this way you can have one ITE do the same actions at completely different times with little code.

  • if all conditions are true do actions
    • if condition
      • base * multiplier[tempInt] less than or equal to counter
    • then
      • < do actions here >
    • else
i hope this is what you're looking for ?

off topic: you should check out my new system colored ping quest system. Link is in my sig.
 
Status
Not open for further replies.
Top