• 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.

Integer A Value

Status
Not open for further replies.
I show in the Loop

look the trigger:
  • For each (Integer A) from 1 to 5, do (Actions)
    • Loop - Actions
      • Set MEQS_Integer[0] = (Integer A)
      • Set MEQS_Integer[1] = (Load (19 + MEQS_Integer[0]) of MEQS_InfoQN from MEQS_Hashtable)
      • Custom script: set udg_MEQS_UnitType[1] = udg_MEQS_Integer[1]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MEQS_UnitType[1] Equal to MEQS_UnitType[0]
        • Then - Actions
          • Hashtable - Save ((Load (16 + MEQS_Integer[0]) of MEQS_QuestNumber from MEQS_Hashtable) + 1) as (16 + MEQS_Integer[0]) of MEQS_QuestNumber in MEQS_Hashtable
          • Trigger - Run sTRING <gen> (checking conditions)
          • Game - Display to (All players) the text: (String((Integer A)))
        • Else - Actions
 
but this has no logic, what problem be within of ITE?

I put out, more problem still remains the same:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • MEQS_UnitType[1] Equal to MEQS_UnitType[0]
    • Then - Actions
      • Hashtable - Save ((Load (16 + MEQS_Integer[0]) of MEQS_QuestNumber from MEQS_Hashtable) + 1) as (16 + MEQS_Integer[0]) of MEQS_QuestNumber in MEQS_Hashtable
      • Trigger - Run sTRING <gen> (checking conditions)
    • Else - Actions
  • Game - Display to (All players) the text: (String((Integer A)))
 
display 1,2,3,4,5 (OBS: I switched Integer A for Integer B)

I need more just a number exact, it would have to operate within THEN ACTIONS of ITE, but when he is there, it displays (1,2), right would only 1

  • For each (Integer B) from 1 to 5, do (Actions)
    • Loop - Actions
      • Set MEQS_Integer[0] = (Integer B)
      • Set MEQS_Integer[1] = (Load (19 + MEQS_Integer[0]) of MEQS_InfoQN from MEQS_Hashtable)
      • Custom script: set udg_MEQS_UnitType[1] = udg_MEQS_Integer[1]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MEQS_UnitType[1] Equal to MEQS_UnitType[0]
        • Then - Actions
          • Hashtable - Save ((Load (16 + MEQS_Integer[0]) of MEQS_QuestNumber from MEQS_Hashtable) + 1) as (16 + MEQS_Integer[0]) of MEQS_QuestNumber in MEQS_Hashtable
          • Trigger - Run sTRING <gen> (checking conditions)
          • Game - Display to (All players) the text: (String((Integer B)))
        • Else - Actions
 
Ok, exist:
5 counter
5 Strings
5 Unit Type

I need to know, which drive who was killed, to add +1 for your counter and display the string of this counter.

for example: I kill Unit Type 3, then +1 for Counter 3 and display String 3.

Look:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set MEQS_Unit[0] = (Killing unit)
      • Set MEQS_Player = (Owner of MEQS_Unit[0])
      • Set MEQS_UnitType[0] = (Unit-type of (Triggering unit))
      • For each (Integer MEQS_LOOP) from 1 to MEQS_Quest_Index, do (Actions)
        • Loop - Actions
          • Set MEQS_QuestNumber = ((Player number of MEQS_Player) x (1000 + MEQS_LOOP))
          • Set MEQS_InfoQN = MEQS_LOOP
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load 1 of MEQS_QuestNumber from MEQS_Hashtable) Equal to 1
            • Then - Actions
              • For each (Integer B) from 1 to 5, do (Actions)
                • Loop - Actions
                  • Set MEQS_Integer[0] = (Integer B)
                  • Set MEQS_Integer[1] = (Load (19 + MEQS_Integer[0]) of MEQS_InfoQN from MEQS_Hashtable)
                  • Custom script: set udg_MEQS_UnitType[1] = udg_MEQS_Integer[1]
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • MEQS_UnitType[1] Equal to MEQS_UnitType[0]
                    • Then - Actions
                      • Hashtable - Save ((Load (16 + MEQS_Integer[0]) of MEQS_QuestNumber from MEQS_Hashtable) + 1) as (16 + MEQS_Integer[0]) of MEQS_QuestNumber in MEQS_Hashtable
                      • Trigger - Run sTRING <gen> (checking conditions)
                      • Game - Display to (All players) the text: (String((Integer B)))
                    • Else - Actions
            • Else - Actions
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
So, Unit Type 1, Counter 1, Message 1, right ?

Why don't you do it like this;
  • Initialize
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Index 1 --------
      • Set UnitType[1] = Footman
      • Set Message[1] = Footman has died.
      • -------- /////////////// --------
      • -------- .................. --------
      • -------- .................. --------
      • -------- Index n --------
      • Set UnitType[5] = Knight
      • Set Message[5] = Knight has died.
      • -------- /////////////// --------
      • -------- Total Index --------
      • Set TotalIndex = 5
  • Unit Dies
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • For each (Integer LoopingInteger) from 1 to TotalIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to UnitType[LoopingInteger]
            • Then - Actions
              • Set Counter[LoopingInteger] = (Counter[LoopingInteger] + 1)
              • Set LoopingInteger = TotalIndex
            • Else - Actions
As said by others, don't use IntegerA/B, use your custom-variable, namely LoopingInteger - For Each Integer Variable
 
So, Unit Type 1, Counter 1, Message 1, right ?

Why don't you do it like this;
  • Initialize
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Index 1 --------
      • Set UnitType[1] = Footman
      • Set Message[1] = Footman has died.
      • -------- /////////////// --------
      • -------- .................. --------
      • -------- .................. --------
      • -------- Index n --------
      • Set UnitType[5] = Knight
      • Set Message[5] = Knight has died.
      • -------- /////////////// --------
      • -------- Total Index --------
      • Set TotalIndex = 5
  • Unit Dies
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • For each (Integer LoopingInteger) from 1 to TotalIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to UnitType[LoopingInteger]
            • Then - Actions
              • Set Counter[LoopingInteger] = (Counter[LoopingInteger] + 1)
              • Set LoopingInteger = TotalIndex
            • Else - Actions
As said by others, don't use IntegerA/B, use your custom-variable, namely LoopingInteger - For Each Integer Variable

if i understand what ur trying to do then do it this way. only thing to note is try not to use to many of the unit type of unit as they leak and cant be fixed.
 
It cannot leaks because it maps to integer globals. These neither allocate or deallocate anything when used.

JASS:
integer bj_forLoopAIndex=0
integer bj_forLoopAIndexEnd=0
integer bj_forLoopBIndex=0
integer bj_forLoopBIndexEnd=0


ik what they are converted into thats what stumped me.
nvm my bad i found a bug in the triggers. i thought it was the unit type id but it was the group trying to limit units by type.
 
Status
Not open for further replies.
Top