June 30 2024 build: Difference between revisions

From Skyscraper Wiki
Jump to navigation Jump to search
mNo edit summary
 
Line 82: Line 82:


[[Category:Development Builds]]
[[Category:Development Builds]]
[[Category:2024 Builds]]
[[Category:Alpha 12 builds]]
[[Category:Alpha 12 builds]]

Latest revision as of 13:57, 1 September 2024

This article is legitimate.
It contains good-faith information, such as an existing building or content.
This article describes a development build of Skyscraper Simulator.
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:

  1. added support for For loops
  2. 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>

See also[edit | edit source]

External links[edit | edit source]