June 30 2024 build: Difference between revisions
m (→External links) |
mNo edit summary |
||
Line 75: | Line 75: | ||
* [[June 23 2024 build|Previous build]] | * [[June 23 2024 build|Previous build]] | ||
* Next build | * [[July 6 2024 build|Next build]] | ||
* [[Development Builds]] | * [[Development Builds]] | ||
Revision as of 02:24, 7 July 2024
It contains good-faith information, such as an existing building or content. |
It contains good information related to Skyscraper Simulator. |
This build has a new script interpreter feature, For loops. This is something that will be very useful to building creators, since it'll allow you to automate tasks more easily, such as creating hundreds of doors. I'll explain how it works from the script guide too.
This is the new content in the script guide (designguide.html):
9. For loops
For loops can be created by specifying an iterator variable, and the range to use, with the following syntax:
<For iterator start To end>
(code)
<EndFor>
The For loop will loop until it completes the "end" value, and can iterate up or down. The value of the iteration is stored in the iterator variable and the variable name must be unique. In the following example, the iterator variable will be printed out on each iteration:
<For i 1 to 3>
Print %i%
<EndFor>
When the code is run, this is the result:
1
2
3
For loops can be nested, like this:
<For i 1 to 3>
<For j 1 to 4>
Print %i% : %j%
<EndFor>
<EndFor>
When the code is run, this is the result:
1 : 1
1 : 2
1 : 3
1 : 4
2 : 1
2 : 2
2 : 3
2 : 4
3 : 1
3 : 2
3 : 3
3 : 4
Changelog:
- added support for For loops
- added documentation for the new For loops
Some more complex For loop examples:
<Floors 0 to 3>
<For i 1 to 10>
<For j 1 to 10>
Print %floor% : %i% : %j%
<EndFor>
<EndFor>
<EndFloors>
<For i 1 to 10>
<Floors 0 to 3>
Print %i% : %floor%
<EndFloors>
<EndFor>