Updatesector: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(12 intermediate revisions by 6 users not shown)
Line 1: Line 1:
updatesector <var> <x> <y>
'''updatesector''' <in_x> <in_y> <in_out_sectnum><br>
'''updatesectorz''' <in_x> <in_y> <in_z> <in_out_sectnum>


Returns [[sector number]] of [[sector]] at (<x>,<y>) into [[gamevar]] <var>
Returns [[sector id]] of the [[sector]] containing the point (<in_x>,<in_y>) or (<in_x>,<in_y>,<in_z>) into <in_out_[[sectnum]]>. The final parameter must be pre-populated with what is assumed to be the correct sector, such as the sprite's pre-existing sectnum.


Note: prior to version 1.3.0, the syntax was updatesector <x> <y> <var>
If the point is not a valid sector (like outside the map, inside a column, or below the floor), it returns -1.  You should verify that the value return is not equal to -1 before manipulating the sector or you could have problems.
 
[[Category:EDuke32 specific commands]]
[[Category:Sector manipulation]]

Latest revision as of 23:17, 7 February 2018

updatesector <in_x> <in_y> <in_out_sectnum>
updatesectorz <in_x> <in_y> <in_z> <in_out_sectnum>

Returns sector id of the sector containing the point (<in_x>,<in_y>) or (<in_x>,<in_y>,<in_z>) into <in_out_sectnum>. The final parameter must be pre-populated with what is assumed to be the correct sector, such as the sprite's pre-existing sectnum.

If the point is not a valid sector (like outside the map, inside a column, or below the floor), it returns -1. You should verify that the value return is not equal to -1 before manipulating the sector or you could have problems.