Headspritesect: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
m Fix
One (talk | contribs)
No edit summary
Line 1: Line 1:
'''headspritesect <spriteID> <sectID>'''
'''headspritesect''' <spriteID> <sectID>


Returns the ID of first sprite in the sector. The purpose of this command to scan through all sprites in the specified sector. The [[nextspritesect]] and [[prevspritesect]] should be used to go forward and back through the list of actors.
Returns the ID of first sprite in the sector. The purpose of this command to scan through all sprites in the specified sector. The [[nextspritesect]] and [[prevspritesect]] should be used to go forward and back through the list of actors.


Example:
'''headspritestat''' i 1 // look for all sprites with the stat of 0
<pre>
whilevarn i -1
headspritestat i 1 // look for all sprites with the stat of 0
{
whilevarn i -1
// use i as the sprite ID
{
addlogvar i
// use i as the sprite ID
nextspritestat i i
addlogvar i
}
nextspritestat i i
}
</pre>


[[Category:EDuke32 specific commands]]
[[Category:EDuke32 specific commands]]
[[Category:Sprite manipulation]]
[[Category:Sprite manipulation]]

Revision as of 12:39, 4 May 2009

headspritesect <spriteID> <sectID>

Returns the ID of first sprite in the sector. The purpose of this command to scan through all sprites in the specified sector. The nextspritesect and prevspritesect should be used to go forward and back through the list of actors.

headspritestat i 1 // look for all sprites with the stat of 0
whilevarn i -1
{
	// use i as the sprite ID
	addlogvar i
	nextspritestat i i
}