• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] How to prevent duplicate integers across multiple arrays?

Level 7
Joined
Aug 5, 2010
Messages
147
I have a map where i want each wave to be able to have up to 3 modfiers, however across all the ways ive tried to prevent duplicates and other issues i have thus far been unsuccessful and my brain is pretty scrambled from attempting to fix it myself so ive come to ask for some much needed help.

Here is an example of my issue from a test map
Untitled.png
As you can see multiple waves have duplicate modifiers, this is what i am/was trying to prevent.

Here is the trigger from the test map that i will attach, this trigger does not have any of the various ways ive tried dealing with the problem, ive cleaned the trigger up as best i can and added comments in an attempt to further clarify what i am attempting to do with each action.
  • ini
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Abbreviated strings for each modifier, in the actual map the strings are used on a multiboard to show the modifiers of the current wave and next wave. --------
      • Set VariableSet String_Array_Mods[0] = |cffc0c0c0[None
      • Set VariableSet String_Array_Mods[1] = |cffffff00[Com
      • Set VariableSet String_Array_Mods[2] = |cff00ff00[Eth
      • Set VariableSet String_Array_Mods[3] = |cff3232ff[Shi
      • Set VariableSet String_Array_Mods[4] = |cff808080[Arm
      • Set VariableSet String_Array_Mods[5] = |cffff0000[Fst
      • Set VariableSet String_Array_Mods[6] = |cff80ff80[Rgn
      • Set VariableSet String_Array_Mods[7] = |cff00ffff[Eva
      • Set VariableSet String_Array_Mods[8] = |cffd45e19[Spl
      • -------- Used again on the muiltiboard in the actual map to indicate the level a modifier will be. --------
      • Set VariableSet String_Array_ModLevel[1] = ]|r
      • Set VariableSet String_Array_ModLevel[2] = +]|r
      • Set VariableSet String_Array_ModLevel[3] = ++]|r
      • -------- Waves 1 to 10 wont spawn with modifiers so i start the loop at 11. --------
      • For each (Integer A) from 0 to 10, do (Actions)
        • Loop - Actions
          • Set VariableSet String_Array_Modifiers[(Integer A)] = |cffc0c0c0[None]
      • For each (Integer A) from 11 to 80, do (Actions)
        • Loop - Actions
          • -------- Mod 1 --------
          • Set VariableSet Integer_Array_ModChance1[(Integer A)] = (Random integer number between 1 and 1000)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_Array_ModChance1[(Integer A)] Less than or equal to (Integer_ModifierChance + (Integer A))
            • Then - Actions
              • -------- ModifierChance is 150 in the actual map, in the test map its set to 500 to so the strings will fill up. I add Int A to ModifierChance so the chance increases over the course of the game. --------
              • Set VariableSet Integer_ModType = (Random integer number between 1 and Integer_TotalModNumber)
              • -------- Int_ModType is saved to ModType1 so i can use it to generate strings but also to use it in the trigger that gives each unit of a wave the actual modifier, that trigger is needed in this test map so i didnt include it. --------
              • Set VariableSet Integer_Array_ModType1[(Integer A)] = Integer_ModType
              • Set VariableSet Integer_Array_ModLevel1[(Integer A)] = (Random integer number between 1 and 3)
              • -------- I dont really need to have this string start with String_Array_Modifier here in the Mod 1 section, either way its an empty string. --------
              • Set VariableSet String_Array_Modifiers[(Integer A)] = (String_Array_Modifiers[(Integer A)] + (String_Array_Mods[Integer_Array_ModType1[(Integer A)]] + String_Array_ModLevel[Integer_Array_ModLevel1[(Integer A)]]))
            • Else - Actions
              • -------- This is for debugging purposes, makes it easier to see exactly where each string/int was generated from, in the actual map these would be disabled. --------
              • Set VariableSet Integer_Array_ModType1[(Integer A)] = 0
              • Set VariableSet Integer_Array_ModLevel1[(Integer A)] = 1
              • Set VariableSet String_Array_Modifiers[(Integer A)] = (String_Array_Modifiers[(Integer A)] + (String_Array_Mods[Integer_Array_ModType1[(Integer A)]] + String_Array_ModLevel[Integer_Array_ModLevel1[(Integer A)]]))
          • -------- This is where i struggle, in another version of this trigger i was able to prevent mod 2 from generating a duplicate modifier by using the duplicate to level up the Mod1 modifier if they were the same. --------
          • -------- However in that system mod 3 was supposed to be able to level up either mod 1 or 2, and i couldnt figure out how to resolve the miriad of issues that would occur in that system --------
          • -------- so ive settled on simple setting the level of a modifier to a random level, however the duplicate issue still remains unresolved.. --------
          • -------- Mod 2 --------
          • Set VariableSet Integer_Array_ModChance2[(Integer A)] = (Random integer number between 1 and 1000)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_Array_ModChance2[(Integer A)] Less than or equal to (Integer_ModifierChance + (Integer A))
            • Then - Actions
              • Set VariableSet Integer_ModType = (Random integer number between 1 and Integer_TotalModNumber)
              • Set VariableSet Integer_Array_ModType2[(Integer A)] = Integer_ModType
              • Set VariableSet Integer_Array_ModLevel2[(Integer A)] = (Random integer number between 1 and 3)
              • Set VariableSet String_Array_Modifiers[(Integer A)] = (String_Array_Modifiers[(Integer A)] + (String_Array_Mods[Integer_Array_ModType2[(Integer A)]] + String_Array_ModLevel[Integer_Array_ModLevel2[(Integer A)]]))
            • Else - Actions
              • Set VariableSet Integer_Array_ModType2[(Integer A)] = 0
              • Set VariableSet Integer_Array_ModLevel2[(Integer A)] = 1
              • Set VariableSet String_Array_Modifiers[(Integer A)] = (String_Array_Modifiers[(Integer A)] + (String_Array_Mods[Integer_Array_ModType2[(Integer A)]] + String_Array_ModLevel[Integer_Array_ModLevel2[(Integer A)]]))
          • -------- Mod 3 --------
          • Set VariableSet Integer_Array_ModChance3[(Integer A)] = (Random integer number between 1 and 1000)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_Array_ModChance3[(Integer A)] Less than or equal to (Integer_ModifierChance + (Integer A))
            • Then - Actions
              • Set VariableSet Integer_ModType = (Random integer number between 1 and Integer_TotalModNumber)
              • Set VariableSet Integer_Array_ModType3[(Integer A)] = Integer_ModType
              • Set VariableSet Integer_Array_ModLevel3[(Integer A)] = (Random integer number between 1 and 3)
              • Set VariableSet String_Array_Modifiers[(Integer A)] = (String_Array_Modifiers[(Integer A)] + (String_Array_Mods[Integer_Array_ModType3[(Integer A)]] + String_Array_ModLevel[Integer_Array_ModLevel3[(Integer A)]]))
            • Else - Actions
              • Set VariableSet Integer_Array_ModType3[(Integer A)] = 0
              • Set VariableSet Integer_Array_ModLevel3[(Integer A)] = 1
              • Set VariableSet String_Array_Modifiers[(Integer A)] = (String_Array_Modifiers[(Integer A)] + (String_Array_Mods[Integer_Array_ModType3[(Integer A)]] + String_Array_ModLevel[Integer_Array_ModLevel3[(Integer A)]]))
          • -------- If no modifier are chosen then the string for intA will be set to [None] --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_Array_ModChance1[(Integer A)] Greater than (Integer_ModifierChance + (Integer A))
              • Integer_Array_ModChance2[(Integer A)] Greater than (Integer_ModifierChance + (Integer A))
              • Integer_Array_ModChance3[(Integer A)] Greater than (Integer_ModifierChance + (Integer A))
            • Then - Actions
              • Set VariableSet String_Array_Modifiers[(Integer A)] = (<Empty String> + (String_Array_Mods[0] + String_Array_ModLevel[1]))
            • Else - Actions
Just to note the test map uses JASS scripting, the actual map uses LUA, if anyone would like to see the actual map i will attach at request.
 

Attachments

  • test.w3m
    21 KB · Views: 0
Level 39
Joined
Feb 27, 2007
Messages
5,023
An actual 2D array would simplify this. Do this after randomizing 1-3 (yes in this order) but before building the string:
  • If (All conditions are true) do (Then actions) else do (Else actions)
    • If - Conditions
      • Integer_Array_ModType3[(Integer A)] equal to Integer_Array_ModType2[(Integer A)]
      • Integer_Array_ModType3[(Integer A)] equal to Integer_Array_ModType1[(Integer A)]
    • Then - Actions
      • Set Integer_Array_ModType3[(Integer A)] = 0
    • Else - Actions
  • If (All conditions are true) do (Then actions) else do (Else actions)
    • If - Conditions
      • Integer_Array_ModType2[(Integer A)] equal to Integer_Array_ModType1[(Integer A)]
    • Then - Actions
      • Set Integer_Array_ModType2[(Integer A)] = Integer_Array_ModType3[(Integer A)]
      • Set Integer_Array_ModLevel2[(Integer A)] = Integer_Array_ModLevel3[(Integer A)]
      • Set Integer_Array_ModType3[(Integer A)] = 0
    • Else - Actions
 
Last edited:
Level 7
Joined
Aug 5, 2010
Messages
147
An actual 2D array would simplify this. Do this after randomizing 1-3 (yes in this order) but before building the string:
  • If (All conditions are true) do (Then actions) else do (Else actions)
    • If - Conditions
      • Integer_Array_ModType3[(Integer A)] equal to Integer_Array_ModType2[(Integer A)]
      • Integer_Array_ModType3[(Integer A)] equal to Integer_Array_ModType1[(Integer A)]
    • Then - Actions
      • Set Integer_Array_ModType3[(Integer A)] = 0
    • Else - Actions
  • If (All conditions are true) do (Then actions) else do (Else actions)
    • If - Conditions
      • Integer_Array_ModType2[(Integer A)] equal to Integer_Array_ModType1[(Integer A)]
    • Then - Actions
      • Set Integer_Array_ModType2[(Integer A)] = Integer_Array_ModType3[(Integer A)]
      • Set Integer_Array_ModLevel2[(Integer A)] = Integer_Array_ModLevel3[(Integer A)]
    • Else - Actions
I added that to the trigger after randomizing 1,2,3 and it made things worse whilst also not preventing duplicates.
Untitled.png
  • ini
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Abbreviated strings for each modifier, in the actual map the strings are used on a multiboard to show the modifiers of the current wave and next wave. --------
      • Set VariableSet String_Array_Mods[0] = |cffc0c0c0[None
      • Set VariableSet String_Array_Mods[1] = |cffffff00[Com
      • Set VariableSet String_Array_Mods[2] = |cff00ff00[Eth
      • Set VariableSet String_Array_Mods[3] = |cff3232ff[Shi
      • Set VariableSet String_Array_Mods[4] = |cff808080[Arm
      • Set VariableSet String_Array_Mods[5] = |cffff0000[Fst
      • Set VariableSet String_Array_Mods[6] = |cff80ff80[Rgn
      • Set VariableSet String_Array_Mods[7] = |cff00ffff[Eva
      • Set VariableSet String_Array_Mods[8] = |cffd45e19[Spl
      • -------- Used again on the muiltiboard in the actual map to indicate the level a modifier will be. --------
      • Set VariableSet String_Array_ModLevel[1] = ]|r
      • Set VariableSet String_Array_ModLevel[2] = +]|r
      • Set VariableSet String_Array_ModLevel[3] = ++]|r
      • -------- Waves 1 to 10 wont spawn with modifiers so i start the loop at 11. --------
      • For each (Integer A) from 0 to 10, do (Actions)
        • Loop - Actions
          • Set VariableSet String_Array_Modifiers[(Integer A)] = |cffc0c0c0[None]
      • For each (Integer A) from 11 to 80, do (Actions)
        • Loop - Actions
          • -------- Mod 1 --------
          • Set VariableSet Integer_Array_ModChance1[(Integer A)] = (Random integer number between 1 and 1000)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_Array_ModChance1[(Integer A)] Less than or equal to (Integer_ModifierChance + (Integer A))
            • Then - Actions
              • -------- ModifierChance is 150 in the actual map, in the test map its set to 500 to so the strings will fill up. I add Int A to ModifierChance so the chance increases over the course of the game. --------
              • Set VariableSet Integer_ModType = (Random integer number between 1 and Integer_TotalModNumber)
              • -------- Int_ModType is saved to ModType1 so i can use it to generate strings but also to use it in the trigger that gives each unit of a wave the actual modifier, that trigger is needed in this test map so i didnt include it. --------
              • Set VariableSet Integer_Array_ModType1[(Integer A)] = Integer_ModType
              • Set VariableSet Integer_Array_ModLevel1[(Integer A)] = (Random integer number between 1 and 3)
              • -------- I dont really need to have this string start with String_Array_Modifier here in the Mod 1 section, either way its an empty string. --------
            • Else - Actions
              • -------- This is for debugging purposes, makes it easier to see exactly where each string/int was generated from, in the actual map these would be disabled. --------
          • -------- This is where i struggle, in another version of this trigger i was able to prevent mod 2 from generating a duplicate modifier by using the duplicate to level up the Mod1 modifier if they were the same. --------
          • -------- However in that system mod 3 was supposed to be able to level up either mod 1 or 2, and i couldnt figure out how to resolve the miriad of issues that would occur in that system --------
          • -------- so ive settled on simple setting the level of a modifier to a random level, however the duplicate issue still remains unresolved.. --------
          • -------- Mod 2 --------
          • Set VariableSet Integer_Array_ModChance2[(Integer A)] = (Random integer number between 1 and 1000)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_Array_ModChance2[(Integer A)] Less than or equal to (Integer_ModifierChance + (Integer A))
            • Then - Actions
              • Set VariableSet Integer_ModType = (Random integer number between 1 and Integer_TotalModNumber)
              • Set VariableSet Integer_Array_ModType2[(Integer A)] = Integer_ModType
              • Set VariableSet Integer_Array_ModLevel2[(Integer A)] = (Random integer number between 1 and 3)
            • Else - Actions
          • -------- Mod 3 --------
          • Set VariableSet Integer_Array_ModChance3[(Integer A)] = (Random integer number between 1 and 1000)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_Array_ModChance3[(Integer A)] Less than or equal to (Integer_ModifierChance + (Integer A))
            • Then - Actions
              • Set VariableSet Integer_ModType = (Random integer number between 1 and Integer_TotalModNumber)
              • Set VariableSet Integer_Array_ModType3[(Integer A)] = Integer_ModType
              • Set VariableSet Integer_Array_ModLevel3[(Integer A)] = (Random integer number between 1 and 3)
            • Else - Actions
          • -------- -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_Array_ModType3[(Integer A)] Equal to Integer_Array_ModType2[(Integer A)]
              • Integer_Array_ModType3[(Integer A)] Equal to Integer_Array_ModType1[(Integer A)]
            • Then - Actions
              • Set VariableSet Integer_Array_ModType3[(Integer A)] = 0
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_Array_ModType2[(Integer A)] Equal to Integer_Array_ModType1[(Integer A)]
            • Then - Actions
              • Set VariableSet Integer_Array_ModType2[(Integer A)] = Integer_Array_ModType3[(Integer A)]
              • Set VariableSet Integer_Array_ModLevel2[(Integer A)] = Integer_Array_ModLevel3[(Integer A)]
            • Else - Actions
          • Set VariableSet String_Array_Modifiers[(Integer A)] = (<Empty String> + (String_Array_Mods[Integer_Array_ModType1[(Integer A)]] + String_Array_ModLevel[Integer_Array_ModLevel1[(Integer A)]]))
          • Set VariableSet String_Array_Modifiers[(Integer A)] = (String_Array_Modifiers[(Integer A)] + (String_Array_Mods[Integer_Array_ModType2[(Integer A)]] + String_Array_ModLevel[Integer_Array_ModLevel2[(Integer A)]]))
          • Set VariableSet String_Array_Modifiers[(Integer A)] = (String_Array_Modifiers[(Integer A)] + (String_Array_Mods[Integer_Array_ModType3[(Integer A)]] + String_Array_ModLevel[Integer_Array_ModLevel3[(Integer A)]]))
          • -------- If no modifier are chosen then the string for intA will be set to [None] --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_Array_ModChance1[(Integer A)] Greater than (Integer_ModifierChance + (Integer A))
              • Integer_Array_ModChance2[(Integer A)] Greater than (Integer_ModifierChance + (Integer A))
              • Integer_Array_ModChance3[(Integer A)] Greater than (Integer_ModifierChance + (Integer A))
            • Then - Actions
              • Set VariableSet String_Array_Modifiers[(Integer A)] = (<Empty String> + (String_Array_Mods[0] + String_Array_ModLevel[1]))
            • Else - Actions
 

Attachments

  • test.w3m
    21.5 KB · Views: 0
Level 39
Joined
Feb 27, 2007
Messages
5,023
I skipped this line in the second conditional which is why it appears to be duplicated (I have changed this above):
  • Set Integer_Array_ModType3[(Integer A)] = 0
The display text is a problem with how you are building the output string for the display, not an issue with what I suggested you do. Instead of adding text only where it is relevant, you're now adding the [None text to every modifier that has the value 0. Modifiers of 0 should just be... blank. Just don't print anything at all. You're making it way more complicated than it needs to be, and honestly the excessive use of arrays is what's at the heart of it all. There are a few places you're dropping the |r that's necessary to end the color code, which allows it to overflow past where it should color.
  • -------- Setup --------
  • Set LevelText[1] = ]|r
  • Set LevelText[2] = +]|r
  • Set LevelText[3] = ++]|r
  • -------- At end of 11-80 loop --------
  • Set Output = <empty string>
  • If (All conditions are true) then do (Then actions) else do (Else Actions)
    • If - Conditions
      • Integer_Array_ModType1[(Integer A)] not equal to 0
    • Then - Actions
      • Set Output = (Output + String_Array_Mods[Integer_Array_ModType1[(Integer A)])
  • If (All conditions are true) then do (Then actions) else do (Else Actions)
  • Set Output = (Output + LevelText[Integer_Array_ModLevel1[(Integer A)])
    • If - Conditions
      • Integer_Array_ModType2[(Integer A)] not equal to 0
    • Then - Actions
      • Set Output = (Output + String_Array_Mods[Integer_Array_ModType2[(Integer A)])
      • Set Output = (Output + LevelText[Integer_Array_ModLevel1[(Integer A)])
  • If (All conditions are true) then do (Then actions) else do (Else Actions)
    • If - Conditions
      • Integer_Array_ModType3[(Integer A)] not equal to 0
    • Then - Actions
      • Set Output = (Output + String_Array_Mods[Integer_Array_ModType3[(Integer A)])
      • Set Output = (Output + LevelText[Integer_Array_ModLevel1[(Integer A)])
  • If (All conditions are true) then do (Then actions) else do (Else Actions)
    • If - Conditions
      • Output equal to <Empty String>
    • Then - Actions
      • Set Output = (String_Array_Mods[0] + LevelText[1])
Using fewer arrays and storing less unnecessary information:
  • Set ModName[0] = |cffc0c0c0[None
  • Set ModName[1] = |cffffff00[Com
  • Set ModName[2] = |cff00ff00[Eth
  • Set ModName[3] = |cff3232ff[Shi
  • Set ModName[4] = |cff808080[Arm
  • Set ModName[5] = |cffff0000[Fst
  • Set ModName[6] = |cff80ff80[Rgn
  • Set ModName[7] = |cff00ffff[Eva
  • Set ModName[8] = |cffd45e19[Spl
  • -------- --------
  • Set LevelText[0] = ]|r //failsafe
  • Set LevelText[1] = ]|r
  • Set LevelText[2] = +]|r
  • Set LevelText[3] = ++]|r
  • -------- --------
  • For each (Integer A) from 11 to 80, do (Actions)
    • Loop - Actions
      • For each (Integer B) from 1 to 3, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 1000) Less than or equal to (Integer_ModifierChance + (Integer A))
            • Then - Actions
              • Set Slot = (((Integer A) - 1) x 3))
              • Set WaveMod[(Slot + (Integer B))] = (Random integer number between 1 and Integer_TotalModNumber)
              • Set WaveModLevel[(Slot + (Integer B))] = (Random integer number between 1 and 3)
            • Else - Actions
      • -------- --------
      • Set Slot = ((Integer A) - 1) x 3)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any Conditions are true
            • WaveMod[(Slot + 3)] equal to WaveMod[(Slot + 2)]
            • WaveMod[(Slot + 3)] equal to WaveMod[(Slot + 1)]
        • Then - Actions
          • Set WaveMod[(Slot + 3)] = 0
          • Set WaveModLevel[(Slot + 3)] = 0
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WaveMod[(Slot + 2)] equal to WaveMod[(Slot + 1)]
        • Then - Actions
          • Set WaveMod[(Slot + 2)] = WaveMod=[(Slot + 3)]
          • Set WaveModLevel[(Slot + 2)] = WaveModLevel[(Slot + 3)]
          • Set WaveMod[(Slot + 3)] = 0
          • Set WaveModLevel[(Slot + 3)] = 0
        • Else - Actions
  • -------- --------
  • For each (Integer A) from 1 to 80, do (Actions)
    • Loop - Actions
      • Set Slot = ((Integer A) - 1) x 3)
      • Set WaveText[(Integer A)] = <empty string>
      • For each (Integer B) from 1 to 3, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • WaveMod[(Slot + (Integer B))] not equal to 0
            • Then - Actions
              • Set WaveText[(Integer A)] = (WaveText[(Integer A)] + ModName[WaveMod[(Slot + (Integer B))]])
              • Set WaveText[(Integer A)] = (WaveText[(Integer A)] + LevelText[WaveModLevel[(Slot + (Integer B))]])
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WaveText[(Integer A)] equal to <empty string>
        • Then - Actions
          • Set WaveText[(Integer A)] = (ModName[0] + LevelText[1])
        • Else - Actions
 
Level 7
Joined
Aug 5, 2010
Messages
147
Using fewer arrays and storing less unnecessary information:
  • Set ModName[0] = |cffc0c0c0[None
  • Set ModName[1] = |cffffff00[Com
  • Set ModName[2] = |cff00ff00[Eth
  • Set ModName[3] = |cff3232ff[Shi
  • Set ModName[4] = |cff808080[Arm
  • Set ModName[5] = |cffff0000[Fst
  • Set ModName[6] = |cff80ff80[Rgn
  • Set ModName[7] = |cff00ffff[Eva
  • Set ModName[8] = |cffd45e19[Spl
  • -------- --------
  • Set LevelText[0] = ]|r //failsafe
  • Set LevelText[1] = ]|r
  • Set LevelText[2] = +]|r
  • Set LevelText[3] = ++]|r
  • -------- --------
  • For each (Integer A) from 11 to 80, do (Actions)
    • Loop - Actions
      • For each (Integer B) from 1 to 3, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 1000) Less than or equal to (Integer_ModifierChance + (Integer A))
            • Then - Actions
              • Set Slot = (((Integer A) - 1) x 3))
              • Set WaveMod[(Slot + (Integer B))] = (Random integer number between 1 and Integer_TotalModNumber)
              • Set WaveModLevel[(Slot + (Integer B))] = (Random integer number between 1 and 3)
            • Else - Actions
      • -------- --------
      • Set Slot = ((Integer A) - 1) x 3)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any Conditions are true
            • WaveMod[(Slot + 3)] equal to WaveMod[(Slot + 2)]
            • WaveMod[(Slot + 3)] equal to WaveMod[(Slot + 1)]
        • Then - Actions
          • Set WaveMod[(Slot + 3)] = 0
          • Set WaveModLevel[(Slot + 3)] = 0
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WaveMod[(Slot + 2)] equal to WaveMod[(Slot + 1)]
        • Then - Actions
          • Set WaveMod[(Slot + 2)] = WaveMod=[(Slot + 3)]
          • Set WaveModLevel[(Slot + 2)] = WaveModLevel[(Slot + 3)]
          • Set WaveMod[(Slot + 3)] = 0
          • Set WaveModLevel[(Slot + 3)] = 0
        • Else - Actions
  • -------- --------
  • For each (Integer A) from 1 to 80, do (Actions)
    • Loop - Actions
      • Set Slot = ((Integer A) - 1) x 3)
      • Set WaveText[(Integer A)] = <empty string>
      • For each (Integer B) from 1 to 3, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • WaveMod[(Slot + (Integer B))] not equal to 0
            • Then - Actions
              • Set WaveText[(Integer A)] = (WaveText[(Integer A)] + ModName[WaveMod[(Slot + (Integer B))]])
              • Set WaveText[(Integer A)] = (WaveText[(Integer A)] + LevelText[WaveModLevel[(Slot + (Integer B))]])
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WaveText[(Integer A)] equal to <empty string>
        • Then - Actions
          • Set WaveText[(Integer A)] = (ModName[0] + LevelText[1])
        • Else - Actions
I recreated this in my test map and appears to work perfectly. Other than var names everything should be identical
  • Ini
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet String_Array_ModName[0] = |cffc0c0c0[None
      • Set VariableSet String_Array_ModName[1] = |cffffff00[Com
      • Set VariableSet String_Array_ModName[2] = |cff00ff00[Eth
      • Set VariableSet String_Array_ModName[3] = |cff3232ff[Shi
      • Set VariableSet String_Array_ModName[4] = |cff808080[Arm
      • Set VariableSet String_Array_ModName[5] = |cffff0000[Fst
      • Set VariableSet String_Array_ModName[6] = |cff80ff80[Rgn
      • Set VariableSet String_Array_ModName[7] = |cff00ffff[Eva
      • Set VariableSet String_Array_ModName[8] = |cffd45e19[Spl
      • -------- -------------- --------
      • Set VariableSet String_Array_ModLevelText[0] = ]|r
      • Set VariableSet String_Array_ModLevelText[1] = ]|r
      • Set VariableSet String_Array_ModLevelText[2] = +]|r
      • Set VariableSet String_Array_ModLevelText[3] = ++]|r
      • -------- -------------- --------
      • For each (Integer A) from 11 to 80, do (Actions)
        • Loop - Actions
          • For each (Integer B) from 1 to 3, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Random integer number between 1 and 1000) Less than or equal to (Integer_ModifierChance + (Integer A))
                • Then - Actions
                  • Set VariableSet Integer_Slot = (((Integer A) - 1) x 3)
                  • Set VariableSet Integer_Array_WaveMod[(Integer_Slot + (Integer B))] = (Random integer number between 1 and Integer_TotalModNumber)
                  • Set VariableSet Integer_Array_WaveModLevel[(Integer_Slot + (Integer B))] = (Random integer number between 1 and 3)
                • Else - Actions
          • -------- -------------- --------
          • Set VariableSet Integer_Slot = (((Integer A) - 1) x 3)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • Integer_Array_WaveMod[(Integer_Slot + 3)] Equal to Integer_Array_WaveMod[(Integer_Slot + 2)]
                  • Integer_Array_WaveMod[(Integer_Slot + 3)] Equal to Integer_Array_WaveMod[(Integer_Slot + 1)]
            • Then - Actions
              • Set VariableSet Integer_Array_WaveMod[(Integer_Slot + 3)] = 0
              • Set VariableSet Integer_Array_WaveModLevel[(Integer_Slot + 3)] = 0
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Integer_Array_WaveMod[(Integer_Slot + 2)] Equal to Integer_Array_WaveMod[(Integer_Slot + 1)]
            • Then - Actions
              • Set VariableSet Integer_Array_WaveMod[(Integer_Slot + 2)] = Integer_Array_WaveMod[(Integer_Slot + 3)]
              • Set VariableSet Integer_Array_WaveModLevel[(Integer_Slot + 2)] = Integer_Array_WaveModLevel[(Integer_Slot + 3)]
              • Set VariableSet Integer_Array_WaveMod[(Integer_Slot + 3)] = 0
              • Set VariableSet Integer_Array_WaveModLevel[(Integer_Slot + 3)] = 0
            • Else - Actions
      • -------- -------------- --------
      • For each (Integer A) from 1 to 80, do (Actions)
        • Loop - Actions
          • Set VariableSet Integer_Slot = (((Integer A) - 1) x 3)
          • Set VariableSet String_Array_WaveText[(Integer A)] = <Empty String>
          • For each (Integer B) from 1 to 3, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Integer_Array_WaveMod[(Integer_Slot + (Integer B))] Not equal to 0
                • Then - Actions
                  • Set VariableSet String_Array_WaveText[(Integer A)] = (String_Array_WaveText[(Integer A)] + String_Array_ModName[Integer_Array_WaveMod[(Integer_Slot + (Integer B))]])
                  • Set VariableSet String_Array_WaveText[(Integer A)] = (String_Array_WaveText[(Integer A)] + String_Array_ModLevelText[Integer_Array_WaveModLevel[(Integer_Slot + (Integer B))]])
                • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • String_Array_WaveText[(Integer A)] Equal to <Empty String>
            • Then - Actions
              • Set VariableSet String_Array_WaveText[(Integer A)] = (String_Array_ModName[0] + String_Array_ModLevelText[1])
            • Else - Actions
It took some thinking to figure out how it was storing the mods for each wave but i figured it out eventually, i added a second game message to display the int rather than the name to confirm how it works and that it is working.

Thank you for the help.

Untitled.png
 

Attachments

  • test.w3m
    19.4 KB · Views: 0
Top