for each Integer A...??

sergykid

Cool Member
Reaction score
0
i didn't found a tutorial for the action "for each integer A, do...". How does this work? for what i can use this action, what can be done with it? i need to set custom values to units or how to use the effect of this action, i tested some event but nothing happened. Is there a tutorial for this action? Like... heroes variable array [1]...[10], and use variable integer A from 1 to 10 and do actions will affect all the heroes? or how it works, if someone know and want to help me, please post here. :)
 

Happy

Well-Known Member
Reaction score
71
if you need an example wait a sec ill show one of the triggers of my map^^

Trigger:
  • sand effect
    • Events
      • Time - QT_SandTimer expires
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Consitions
          • QT_ControlBoolean Equal to False
        • 'THEN'-Actions
        • 'ELSE'-Actions
          • Countdown-Timer - Start QT_SandTimer as a One-Shot timer that will expire in 3.00 seconds
          • For each (Integer A) from 1 to 15, do (Actions)
            • Loop - Actions
              • Set QT_SandPosition = (QT_HeroPosition offset by 400.00 towards ((360.00 / 15.00) x (Real((Integer A)))) degrees)
              • Einheit - Create 1 Dummy for (Owner of QT_Hero) at QT_SandPosition facing ...
              • Set QT_Control = ((Real((Integer A))) / 2.00)
              • Set QT_Control2 = ((Integer A) / 2)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Conditions
                  • QT_Control Not Equal (Real(QT_Control2))
                • 'THEN'-Actions
                  • Unit - Add a 5.00 second Standard expiration timer to (Last created unit)
                  • Set KnockbackCall_Dist = 400.00
                  • Set KnockbackCall_Dur = 10.00
                • 'ELSE'-Actions
                  • Unit - Add a 1.50 second Standard expiration timer to (Last created unit)
                  • Set KnockbackCall_Dist = 200.00
                  • Set KnockbackCall_Dur = 3.00
              • Set KnockbackCall_Unit = (Last created unit)
              • Set KnockbackCall_SFX = Abilities\Spells\Orc\MirrorImage\MirrorImageDeathCaster.mdl
              • Set KnockbackCall_DestroyTree = False
              • Set KnockbackCall_Angle = (Angle from QT_SandPosition to QT_HeroPosition)
              • Custom script: call RemoveLocation(udg_QT_SandPosition)
              • Trigger - Run Knocback Call <gen> (ignoring conditions)


look how i use Integer A....maybe it helps ^^
 

eubz

Cool Member
Reaction score
1
For each integer A is good for Arrays and variables you set. If there are four spawners, for instance and you want to spawn creeptypes in a those spawners, use that action.

For each integer A (from 1 to totalspawners) do (Actions)
Unit - Create 1 (creeptypes) for (player <player>) at the position of (creepspawner(integer A))
 

0WN3D

New Member
Reaction score
15
Integer A is also good for reducing trigger length....
Instead of
Create unit for Player 1-12

You can use
For each integer A 1 to 12
Create unit for Playernumber(Integer A)
 

NeuroToxin

New Member
Reaction score
46
Basically, Integer A and Integer B are loops, loops are things that the actions you put in them, will be run as many times as specified, you can also do a variable loop, which basically means for each integer tempint from 0 to 60 create 1 unit for X player. It will then create 60 units for player (X).
Loops - I use them mainly when I make spells mui, for example, heres a small sample. (Note its quite advanced)
Trigger:
  • SSCast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Send Soul
    • Actions
      • Set Send_Effect = &quot;Abilities\\Spells\\Items\\AIil\\AIilTarget.mdl&quot;
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Circling_Units[(Custom value of (Triggering unit))] is empty) Equal to True
        • Then - Actions
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SS_Integer Greater than or equal to 2999
        • Then - Actions
          • Set SS_Integer = 0
        • Else - Actions
          • Set SS_Integer = (SS_Integer + 1)
      • Set SS_Caster[SS_Integer] = (Triggering unit)
      • Set SS_Target[SS_Integer] = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (SS_Target[SS_Integer] is in SS_NO_DAMAGE) Equal to True
        • Then - Actions
          • Unit Group - Remove SS_Target[SS_Integer] from SS_NO_DAMAGE
        • Else - Actions
      • Set SS_Damage[SS_Integer] = (10.00 + (10.00 x (Real((Level of (Ability being cast) for (Triggering unit))))))
      • Set SS_Dummy[SS_Integer] = (Random unit from Circling_Units[(Custom value of (Triggering unit))])
      • Unit Group - Remove SS_Dummy[SS_Integer] from Circling_Units[(Custom value of (Triggering unit))]
      • Unit Group - Add SS_Dummy[SS_Integer] to SS_SentGroup
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SS_Dummy[SS_Integer] Equal to No unit
        • Then - Actions
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: No Dummy Unit Selec...
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SS_Integer Equal to 0
            • Then - Actions
              • Set SS_Integer = 0
            • Else - Actions
              • Set SS_Integer = (SS_Integer - 1)
        • Else - Actions
          • Trigger - Turn on SSLoop &lt;gen&gt;
          • Animation - Change SS_Dummy[SS_Integer] flying height to 50.00 at 500.00

And then heres the Integer A to run through all instances of the spell.
Trigger:
  • SSLoop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 0 to SS_Integer, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • SS_Dummy[(Integer A)] Not equal to No unit
            • Then - Actions
              • Set SS_Dummyloc = (Position of SS_Dummy[(Integer A)])
              • Set SS_TargetLoc = (Position of SS_Target[(Integer A)])
              • Set SS_Angle = (Angle from SS_Dummyloc to SS_TargetLoc)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Distance between SS_Dummyloc and SS_TargetLoc) Less than or equal to 50.00) and ((SS_Target[(Integer A)] is in SS_NO_DAMAGE) Equal to False)
                • Then - Actions
                  • Custom script: call RemoveLocation(udg_SS_Dummyloc)
                  • Custom script: call RemoveLocation(udg_SS_TargetLoc)
                  • Special Effect - Create a special effect attached to the origin of SS_Target[(Integer A)] using Send_Effect
                  • Special Effect - Destroy (Last created special effect)
                  • Unit - Cause SS_Caster[(Integer A)] to damage SS_Target[(Integer A)], dealing SS_Damage[(Integer A)] damage of attack type Spells and damage type Normal
                  • Unit - Remove SS_Dummy[(Integer A)] from the game
                  • Unit Group - Remove SS_Dummy[(Integer A)] from SS_SentGroup
                  • Unit Group - Add SS_Target[(Integer A)] to SS_NO_DAMAGE
                • Else - Actions
                  • Set SS_Offset = (SS_Dummyloc offset by 20.00 towards SS_Angle degrees)
                  • Unit - Move SS_Dummy[(Integer A)] instantly to SS_Offset, facing SS_Angle degrees
                  • Custom script: call RemoveLocation(udg_SS_Dummyloc)
                  • Custom script: call RemoveLocation(udg_SS_TargetLoc)
                  • Custom script: call RemoveLocation(udg_SS_Offset)
            • Else - Actions
 

sergykid

Cool Member
Reaction score
0
I am not that advanced, and i know nothing about custom script. I will try to use something like creating a unit array variable, create 10 demons (example) and set variable 1-10 array to them, then for each integer A from 1 to 10 create the unit [(index) integer A]. It should work ?

Sorry for late answer but i dont have internet at my home, only at scool i enter the forum.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Yes, it will. Basically any actions that come under For Each Integer Loops will run once, then the integer increases its value by one and does all the actions again. That's how the Integer A value for integers works - if you put the action Add 5 Gold to Player[Integer A], that means every value of Integer A that gets run through will do this action for that player.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top