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
612
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.
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top