One Million Worlds Wiki
Explore
Main Page
All Pages
Interactive Maps
navigation
Main page
Community portal
Recent changes
Random page
Admin noticeboard
Gamepedia
Gamepedia support
Report a bad ad
Help Wiki
Contact us
FANDOM
Fan Central
BETA
Games
Anime
Movies
TV
Video
Wikis
Explore Wikis
Community Central
Start a Wiki
Don't have an account?
Register
Sign In
Sign In
Register
One Million Worlds Wiki
78
pages
Explore
Main Page
All Pages
Interactive Maps
navigation
Main page
Community portal
Recent changes
Random page
Admin noticeboard
Gamepedia
Gamepedia support
Report a bad ad
Help Wiki
Contact us
Editing
Script Block
(section)
Back to page
Edit
VisualEditor
History
Talk (0)
Edit Page
Script Block
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Arrays== Sometimes a piece of data has several parts, like a position might have an x, y and z. These can be both read and creating within scripts. The main place youβll see these is inputs coming from scanner blocks which report positions as an array of 3 numbers. For arrays that enter on inputs you can refer to them in 2 ways: β === Reading arrays by X,Y,Z: === <pre>distanceAway = N.x //N.x is the first value in the array, N.y is the second, N.z is the third S = distanceAway</pre> This way of referring to arrays only works with arrays entering on inputs, not ones you create yourself. === Reading arrays by a number index: === <pre>distanceAway = N[0] //N[0] is the first value in the array, N[1] is the second, N[2] is the third S = distanceAway</pre> '''Be aware''' when using numeric indexes the first entry has index 0; the first value is N[0], not N[1]. You can create arrays using square brackets. for example this program would return an array of the numbers 1,2,3 <pre>N = [1,2,3]</pre> You can of course use variables <pre>distanceAway = N.x N = [distanceAway, 2*distanceAway, 3*distanceAway]</pre>
Summary:
Please note that all contributions to the One Million Worlds Wiki are considered to be released under the CC BY-NC-SA
Cancel
Editing help
(opens in new window)
Follow on IG
TikTok
Join Fan Lab