1. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  2. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  3. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Can someone link me/explain how to use integers? {"from integer 1 to 5"}

Discussion in 'World Editor Help Zone' started by FriXionX, Jun 2, 2009.

  1. FriXionX

    FriXionX

    Joined:
    Aug 1, 2008
    Messages:
    401
    Resources:
    0
    Resources:
    0
    I dont really get how to use "from integer 1 to 5 do actions" bit. Is there a tutorial for integers like that? I cant seem to find one, i find it confusing :(
     
  2. moRIs

    moRIs

    Joined:
    Oct 11, 2008
    Messages:
    91
    Resources:
    0
    Resources:
    0
    Well, this is basic programming. That thing does 5 steps. For example:
    For each integer A from 1 to 5 do
    Create a special effect at center of playable map area
    Wait 1 second

    This works like this: Step 1: a special effect appears in the middle of the map, step 2 the same, ... same for step 5. So this one creates 5 special effects in the middle of the map each between 1 second interval.
     
  3. FriXionX

    FriXionX

    Joined:
    Aug 1, 2008
    Messages:
    401
    Resources:
    0
    Resources:
    0
    But where does integer "A" come in? Why not integer B? Whats the difference?
     
  4. SunTzu7387

    SunTzu7387

    Joined:
    Mar 28, 2009
    Messages:
    66
    Resources:
    0
    Resources:
    0
  5. toofless

    toofless

    Joined:
    Nov 9, 2008
    Messages:
    496
    Resources:
    0
    Resources:
    0
    Sometimes you need a loop in a loop where both will refer to the loop number (Integer X) therefore you need to differ Integer X ergo Interger A and Integer B.

    Loops are great for simplifying a trigger. For example you can take Integer A and use it to refer to a player number which means you can have a trigger to something to all players with a single segment of code instead of individual segments for each player.
     
  6. FriXionX

    FriXionX

    Joined:
    Aug 1, 2008
    Messages:
    401
    Resources:
    0
    Resources:
    0
    So, integers (in this manner) are only used for looping?
    and sunyzu7387, i was looking at that just recently :p He didnt explain the integers though, in not much detail.
     
  7. SunTzu7387

    SunTzu7387

    Joined:
    Mar 28, 2009
    Messages:
    66
    Resources:
    0
    Resources:
    0
  8. FriXionX

    FriXionX

    Joined:
    Aug 1, 2008
    Messages:
    401
    Resources:
    0
    Resources:
    0
    Nice. Helped me & will probably help in future. +rep to both :)
     
  9. TriggerHappy

    TriggerHappy

    Code Moderator

    Joined:
    Jun 23, 2007
    Messages:
    3,831
    Resources:
    22
    Spells:
    11
    Tutorials:
    2
    JASS:
    9
    Resources:
    22
    Integers are just whole numbers.

    A simple google search could have showed you that. You use integers in every day life (if you have ever done any sort of math..).

    Anyways, I suggest this tutorial over all other GUI ones.
     
  10. Duhcake

    Duhcake

    Joined:
    Oct 13, 2008
    Messages:
    287
    Resources:
    0
    Resources:
    0
    Well the peeps have already explained it's functions, But from 'A' or from 'B' Differ in simple way; If you have two Loop actions with 'A' At same time, then it will skip the other one / Nulfill it's effect's. So the 'A' and 'B' are so that you can create 2 loops at same time without interrupting the loops.
     
  11. TriggerHappy

    TriggerHappy

    Code Moderator

    Joined:
    Jun 23, 2007
    Messages:
    3,831
    Resources:
    22
    Spells:
    11
    Tutorials:
    2
    JASS:
    9
    Resources:
    22
    He asked about integers, and you gave him loops..
     
  12. FriXionX

    FriXionX

    Joined:
    Aug 1, 2008
    Messages:
    401
    Resources:
    0
    Resources:
    0
    I kinda asked about loops. I didnt really mean integers, i knew what they are. I just was wondering how "For integer A (etc)" actually does & how to use it. Hard to explain :/