Findnearactor: Difference between revisions
Hendricks266 (talk | contribs) mNo edit summary |
Hendricks266 (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
'''findnearactor''' <[[tile number]]> <distance> <[[gamevar]]><br> | '''findnearactor''' <[[tile number]]> <distance> <[[gamevar]]><br> | ||
'''findnearactorvar''' <[[tile number]]> < | '''findnearactorvar''' <[[tile number]]> <distance> <[[gamevar]]><br> | ||
'''findnearactorz''' <[[tile number]]> <xydistance> <zdistance> <[[gamevar]]><br> | '''findnearactorz''' <[[tile number]]> <xydistance> <zdistance> <[[gamevar]]><br> | ||
'''findnearactorzvar''' <[[tile number]]> < | '''findnearactorzvar''' <[[tile number]]> <xydistance> <zdistance> <[[gamevar]]><br> | ||
'''findnearactor3d''' <[[tile number]]> <distance> <[[gamevar]]><br> | '''findnearactor3d''' <[[tile number]]> <distance> <[[gamevar]]><br> | ||
'''findnearactor3dvar''' <[[tile number]]> < | '''findnearactor3dvar''' <[[tile number]]> <distance> <[[gamevar]]><br> | ||
'''findnearsprite''' <[[tile number]]> <distance> <[[gamevar]]><br> | '''findnearsprite''' <[[tile number]]> <distance> <[[gamevar]]><br> | ||
'''findnearspritevar''' <[[tile number]]> < | '''findnearspritevar''' <[[tile number]]> <distance> <[[gamevar]]><br> | ||
'''findnearspritez''' <[[tile number]]> <xydistance> <zdistance> <[[gamevar]]><br> | '''findnearspritez''' <[[tile number]]> <xydistance> <zdistance> <[[gamevar]]><br> | ||
'''findnearspritezvar''' <[[tile number]]> < | '''findnearspritezvar''' <[[tile number]]> <xydistance> <zdistance> <[[gamevar]]><br> | ||
'''findnearsprite3d''' <[[tile number]]> <distance> <[[gamevar]]><br> | '''findnearsprite3d''' <[[tile number]]> <distance> <[[gamevar]]><br> | ||
'''findnearsprite3dvar''' <[[tile number]]> < | '''findnearsprite3dvar''' <[[tile number]]> <distance> <[[gamevar]]> | ||
These commands get the sprite ID of the closest <[[tile number]]> within <distance> into a <[[gamevar]]>. If no sprite within range is found, the [[gamevar]] is set to -1. The input for <[[tile number]]> may be its tile number (example: 2000) or its defined label (example: PIGCOP). | These commands get the sprite ID of the closest <[[tile number]]> within <distance> into a <[[gamevar]]>. If no sprite within range is found, the [[gamevar]] is set to -1. The input for <[[tile number]]> may be its tile number (example: 2000) or its defined label (example: PIGCOP). | ||
Line 20: | Line 20: | ||
The normal finding commands limit distance on the x and y plane only. If you were to visualize its range, it would be an infinitely tall/deep vertical cylinder, with a radius of <distance>. The "z" commands work within a finite cylinder, with a radius of <xydistance> and a height extending <zdistance> both above and below. The "3d" commands work within a sphere, with a radius of <distance>. | The normal finding commands limit distance on the x and y plane only. If you were to visualize its range, it would be an infinitely tall/deep vertical cylinder, with a radius of <distance>. The "z" commands work within a finite cylinder, with a radius of <xydistance> and a height extending <zdistance> both above and below. The "3d" commands work within a sphere, with a radius of <distance>. | ||
{{varsuffix}} | |||
[[Category:EDuke commands]] | [[Category:EDuke commands]] | ||
[[Category:Sprite manipulation]] | [[Category:Sprite manipulation]] |
Revision as of 19:35, 24 February 2011
findnearactor <tile number> <distance> <gamevar>
findnearactorvar <tile number> <distance> <gamevar>
findnearactorz <tile number> <xydistance> <zdistance> <gamevar>
findnearactorzvar <tile number> <xydistance> <zdistance> <gamevar>
findnearactor3d <tile number> <distance> <gamevar>
findnearactor3dvar <tile number> <distance> <gamevar>
findnearsprite <tile number> <distance> <gamevar>
findnearspritevar <tile number> <distance> <gamevar>
findnearspritez <tile number> <xydistance> <zdistance> <gamevar>
findnearspritezvar <tile number> <xydistance> <zdistance> <gamevar>
findnearsprite3d <tile number> <distance> <gamevar>
findnearsprite3dvar <tile number> <distance> <gamevar>
These commands get the sprite ID of the closest <tile number> within <distance> into a <gamevar>. If no sprite within range is found, the gamevar is set to -1. The input for <tile number> may be its tile number (example: 2000) or its defined label (example: PIGCOP).
By getting the actor ID of a nearby actor, the current actor can use getactor/setactor to edit the properties of the target actor or getangle to face the target actor, among other potential uses.
The actor finding commands work on a subset of sprites: currently awake, valid actors. The sprite finding commands work on a superset of actors: all sprites, including non-actor sprites or sleeping actors.
The normal finding commands limit distance on the x and y plane only. If you were to visualize its range, it would be an infinitely tall/deep vertical cylinder, with a radius of <distance>. The "z" commands work within a finite cylinder, with a radius of <xydistance> and a height extending <zdistance> both above and below. The "3d" commands work within a sphere, with a radius of <distance>.
Commands with an additional "var" suffix take gamevars rather than constants or defined labels for their inputs. As an alternate short form, "varvar" can be dropped from these commands; for example ife serves an an alias for ifvarvare.