Before I answer your first question, understand that CurrentPage is an Integer
array variable. An
Array is what enables the
[index] that you see after the name of the variable. You can change any variable into an Array during the variable creation process by checking the little Array box.
Integer with Array
off:
-
Set Variable CurrentPage = 10
Integer with Array
on:
-
Set Variable CurrentPage[1] = 10
This gives us multiple instances of the same variable which can each hold their own value. It's sort of like turning your variable into a grocery list which can contain multiple numbered items. In this case we're using the Array as a way to track each Player's current page number. This is achieved by using the (Player number) function as the [index] in our array variable. Since no two Players share the same Player Number (Red = 1, Blue = 2, Teal = 3, etc) then we know for certain that each Player will have their own unique entry in the Array.
-
// P1 - Red //
-
Set Variable CurrentPage[1] = 55
-
// P2 - Blue //
-
Set Variable CurrentPage[2] = 204
-
// P3 - Teal //
-
Set Variable CurrentPage[3] = 100
Player 1 (Red) has a value of 55, Player 2 (Blue) has a value of 204, and Player 3 (Teal) has a value of 100.
Regarding your first question, anytime you see math like (10 + 10) or (Variable + 1), etc. know that it's done using the
Arithmetic function. So when choosing the value for CurrentPage you would click the Function bubble which gives you access to a list of functions to choose from. In there you would scroll down until you find the Math category and select
Math - Arithmetic. Then you'll see you now have two values to edit. For the first value you would choose the CurrentPage variable again and for the second value you would manually write the number
1. Then make sure your operation is set to addition (
+).
In my example I use another Integer variable called
PN. This is used as a shortcut to store our player's Player Number and quickly and efficiently reference it as the [index] for CurrentPage[]. Try not to overthink it too much, it's not actually necessary but it will make your life easier so I highly recommend using it.
Loops and arrays tutorial (also containing some information about leaks) - Loops and arrays - A loop is basicly what it sounds like, a circle that never ends, or in our case, it ends when we order it to end. A loop in the World Editor would look like this For each (Integer...
www.hiveworkshop.com