Setarraysequence: Difference between revisions
Jump to navigation
Jump to search
Doom64hunter (talk | contribs) Added short form |
No edit summary |
||
Line 1: | Line 1: | ||
'''setarraysequence''' <[[gamearray]]> <[[gamevar]] | '''setarraysequence''' <[[gamearray]]> <[[gamevar 1]]> [...] <[[gamevar N]]> | ||
'''setarrayseq''' <[[gamearray]]> <[[gamevar 1]]> [...] <[[gamevar N]]> | |||
Saves the values of the provided gamevars to the first N entries of a gamearray. | |||
Note that the gamearray will be resized to match the number of gamevars provided. | |||
Current the limit of variables is 32. | |||
This | This is useful for creating a state that takes the values of multiple gamevars. A common usage is to modify a [[rotatesprite]] function. | ||
Example: | |||
state Rotatesprite_Scaled | |||
getarraysequence Rotatesprite_Sequence X Y Scale Ang Picnum Shade Pal Orientation X1 Y1 X2 Y2 | |||
ifn userdef[].statusbarscale 100 | |||
{ | |||
sub X 160 | |||
sub Y 200 | |||
scalevar X X userdef[].statusbarscale 100 | |||
scalevar Y Y userdef[].statusbarscale 100 | |||
scalevar Scale Scale userdef[].statusbarscale 100 | |||
add X 160 | |||
add Y 200 | |||
} | |||
rotatesprite X Y Scale Ang Picnum Shade Pal Orientation X1 Y1 X2 Y2 | |||
ends | |||
appendevent EVENT_DISPLAYSBAR | |||
set X2 xdim | |||
set Y2 ydim | |||
sub X2 1 | |||
sub Y2 1 | |||
setarraysequence Rotatesprite_Sequence 160 166 65536 0 BOTTOMSTATUSBAR 4 0 24 0 0 X2 Y2 | |||
state Rotatesprite_Scaled | |||
endevent | |||
See also [[getarraysequence]]. | |||
[[Category:EDuke32 specific commands]] | [[Category:EDuke32 specific commands]] | ||
[[Category:Gamearray manipulation]] | [[Category:Gamearray manipulation]] |
Revision as of 19:40, 19 February 2020
setarraysequence <gamearray> <gamevar 1> [...] <gamevar N> setarrayseq <gamearray> <gamevar 1> [...] <gamevar N>
Saves the values of the provided gamevars to the first N entries of a gamearray.
Note that the gamearray will be resized to match the number of gamevars provided.
Current the limit of variables is 32.
This is useful for creating a state that takes the values of multiple gamevars. A common usage is to modify a rotatesprite function.
Example:
state Rotatesprite_Scaled getarraysequence Rotatesprite_Sequence X Y Scale Ang Picnum Shade Pal Orientation X1 Y1 X2 Y2 ifn userdef[].statusbarscale 100 { sub X 160 sub Y 200 scalevar X X userdef[].statusbarscale 100 scalevar Y Y userdef[].statusbarscale 100 scalevar Scale Scale userdef[].statusbarscale 100 add X 160 add Y 200 } rotatesprite X Y Scale Ang Picnum Shade Pal Orientation X1 Y1 X2 Y2 ends appendevent EVENT_DISPLAYSBAR set X2 xdim set Y2 ydim sub X2 1 sub Y2 1 setarraysequence Rotatesprite_Sequence 160 166 65536 0 BOTTOMSTATUSBAR 4 0 24 0 0 X2 Y2 state Rotatesprite_Scaled endevent
See also getarraysequence.