For each integer

Kahem

New Member
Reaction score
2
can someone explain fully how this all works, im a little lost :nuts:
i use it alot, but sometimes it works :thup: and sometimes it dosnt :thdown:
 

Kahem

New Member
Reaction score
2
Integer A
Integer B
Integer Variable?

there a 6 triggers in total for it

"is a loop" dosnt realy cover what that all is...
 

vypur85

Hibernate
Reaction score
803
Integer A and B are alternatives to each other. They work exactly the same. Integer variable provides more alternatives since you can create your own variable for it. There are several alternatives for a reason. Imagine you stack Integer A loop in another Integer A loop. It'll go confused. Which is why there's another Integer B loop for you to use. If you want to stack more, then there's Integer Variable...

Well, they create loops. Repeats of actions.

What problem do you have? You must've done something wrong. Sometimes it works sometimes it doesn't is not a good description for the problem you're facing.
 

PrisonLove

Hard Realist
Reaction score
78
Okay time for a flow chart:

You have:

Start Loop ---> "if" loop conditions ---> loop actions ---> update loop conditions

When you update the loop conditions it goes back to the "if" loop conditions.

If it returns true, it runs the loop actions again. It will do this until the loop is false.

So basically, For each Integer A from 1 to 10, would mean that the loop will execute 10 times. It sets Integer A to 1 in the beginning, then everytime the loop actions executes it sets A to A + 1. So, after one pass A goes from 1 to 2. When A becomes greater than 10, the loop conditions return false and the loop terminates. The actions no longer execute.

So, we have:

Code:
[U]A[/U]    [U]"If"[/U]         [U]actions[/U]
1     1 <= 10     true
2     2 <= 10     true
...   ...         ...
10    10 <= 10    true
11    11 <=10     false

Now the loop stops because 11 is not less than or equal to 10.

In summary, a loop is used to execute actions repeatedly, without having to actually write out the actions a bunch of times. So if you want to display a game message ten times, you would use a loop instead of using "Game - Display Text to Player" over and over again.

Get it now?

As for Integer variables. An integer is a number that has no fractional part. So, 1 is an integer, 2 is an integer, 3.1 is not an integer. Also, any number with a decimal, even if it has no fraction part is not an integer, so 1.0 is not an integer. number with fractional parts are reals. so 3.1 and 1.0 are real numbers. An integer variable is like a little container that you can store an integer in so that you can refer to it later.

So, if you have an integer variable named "i", you can use it in a completely different trigger. If we set "i" to 1, then anytime you refer to "i" you are referring to the number 1, until you change the value of "i".

Hope all that helps.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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