For: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Documentation of the "for" CON keyword.
 
Fox (talk | contribs)
No edit summary
Line 1: Line 1:
'''for''' <[[gamevar]]> <iterator> { code to execute }<br>
'''for''' <gamevar> <function> { [...] }<br>
'''for''' <[[gamevar]]> <iterator> <num> { code to execute }
'''for''' <gamevar> <function> <value> { [...] }


Executes the code in the curly braces for every instance of the iterator specified, and <[[gamevar]]> stores the sprite/sector/wall/etc found in the current iteration. For example, setting <iterator> to '''allsprites''' will execute the code for every sprite in-game, and the var specified in <[[gamevar]]> will be set to the sprite number of the current sprite it's on.
Executes the code in the curly braces for every instance of the iterator specified, and <[[gamevar]]> stores the sprite/sector/wall/etc found in the current iteration. For example, setting <iterator> to '''allsprites''' will execute the code for every sprite in-game, and the var specified in <[[gamevar]]> will be set to the sprite number of the current sprite it's on.


Iterator types:
== Functions ==
:'''allsprites''' - All actors/sprites in-game.
 
:'''allsectors''' - All sectors in the map.
{| {{prettytable}}
:'''allwalls''' - All walls in the map.
| '''allsprites''' || All actors/sprites in-game.
:'''activelights''' - All active polymer lights.
|-
:'''drawnsprites''' - Only the sprites currently being drawn.
| '''allsectors''' || All sectors in the map.
:'''spritesofsector <sector num>''' - All sprites in the given sector.
|-
:'''spritesofstatus <statnum>''' - All sprites with the given [[statnum]].
| '''allwalls''' || All walls in the map.
:'''wallsofsector <sector num>''' - The walls of the given sector.
|-
:'''loopofwall <wall num>''' - All walls in the same loop of the given wall.
| '''activelights'''<br />'''lights''' || All active polymer lights.
:'''range <num>''' - A range from 0 to the number specified.
|-
| '''drawnsprites''' || Only the sprites currently being drawn.
|-
| '''spritesofsector'''<sectnum><br /> '''sprofsec'''<sectnum> || All sprites in the given sector.
|-
| '''spritesofstatus''' <statnum><br />'''sprofstat''' <statnum> || All sprites with the given [[statnum]].
|-
| '''wallsofsector''' <sectnum><br />'''walofsec''' <sectnum> || The walls of the given sector.
|-
| '''loopofwall''' <wall num> || All walls in the same loop of the given wall.
|-
| '''range''' <num> || A range from 0 to the number specified.
|}


[[Category:EDuke32 specific commands]]
[[Category:EDuke32 specific commands]]

Revision as of 04:56, 25 February 2020

for <gamevar> <function> { [...] }
for <gamevar> <function> <value> { [...] }

Executes the code in the curly braces for every instance of the iterator specified, and <gamevar> stores the sprite/sector/wall/etc found in the current iteration. For example, setting <iterator> to allsprites will execute the code for every sprite in-game, and the var specified in <gamevar> will be set to the sprite number of the current sprite it's on.

Functions

allsprites All actors/sprites in-game.
allsectors All sectors in the map.
allwalls All walls in the map.
activelights
lights
All active polymer lights.
drawnsprites Only the sprites currently being drawn.
spritesofsector<sectnum>
sprofsec<sectnum>
All sprites in the given sector.
spritesofstatus <statnum>
sprofstat <statnum>
All sprites with the given statnum.
wallsofsector <sectnum>
walofsec <sectnum>
The walls of the given sector.
loopofwall <wall num> All walls in the same loop of the given wall.
range <num> A range from 0 to the number specified.