ProcessLineOfSight: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
__NOTOC__ | __NOTOC__ | ||
This function checks if there is anything between 2 points in the world, and if there is, tells you where and with what. The two positions must be within the local player's draw distance. | This function checks if there is anything between 2 points in the world, and if there is, tells you where and with what. The two positions must be within the local player's draw distance. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool float float float element processLineOfSight ( float startX, float startY, float startZ, float endX, float endY, float endZ, [ bool checkBuildings, bool checkVehicles, bool | bool float float float element processLineOfSight ( float startX, float startY, float startZ, float endX, float endY, float endZ, [ bool checkBuildings, bool checkVehicles, bool checkPlayers, bool checkObjects, bool checkDummies, bool seeThroughStuff, bool ignoreSomeObjectsForCamera, bool shootThroughStuff, element ignoredElement ] ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 20: | Line 21: | ||
*'''checkBuildings:''' Allow the line of sight to be blocked by GTA's internally placed buildings, i.e. the world map. | *'''checkBuildings:''' Allow the line of sight to be blocked by GTA's internally placed buildings, i.e. the world map. | ||
*'''checkVehicles:''' Allow the line of sight to be blocked by [[Vehicle|vehicles]]. | *'''checkVehicles:''' Allow the line of sight to be blocked by [[Vehicle|vehicles]]. | ||
*''' | *'''checkPlayers:''' Allow the line of sight to be blocked by [[Player|players]]. | ||
*'''checkObjects:''' Allow the line of sight to be blocked by [[Object|objects]]. | *'''checkObjects:''' Allow the line of sight to be blocked by [[Object|objects]]. | ||
*'''checkDummies:''' Allow the line of sight to be blocked by GTA's internal dummies. These are not used in the current MTA version so this argument can be set to ''false''. | *'''checkDummies:''' Allow the line of sight to be blocked by GTA's internal dummies. These are not used in the current MTA version so this argument can be set to ''false''. | ||
Line 26: | Line 27: | ||
*'''ignoreSomeObjectsForCamera:''' Allow the line of sight to be blocked by certain objects. | *'''ignoreSomeObjectsForCamera:''' Allow the line of sight to be blocked by certain objects. | ||
*'''shootThroughStuff:''' Allow the line of sight to be blocked by certain entities. | *'''shootThroughStuff:''' Allow the line of sight to be blocked by certain entities. | ||
*'''ignoredElement:''' Allow the line of sight to pass through a certain specified element. | *'''ignoredElement:''' Allow the line of sight to pass through a certain specified element. | ||
===Returns=== | ===Returns=== | ||
If there | If there is a collision, the function will return ''true'', the collision position and MTA element hit. If no element is hit, the element return value will be ''nil''. If there is no collision the function will return ''false''. | ||
If there is no collision the function will return false. | |||
==Example== | ==Example== |
Revision as of 01:20, 13 November 2007
This function checks if there is anything between 2 points in the world, and if there is, tells you where and with what. The two positions must be within the local player's draw distance.
Syntax
bool float float float element processLineOfSight ( float startX, float startY, float startZ, float endX, float endY, float endZ, [ bool checkBuildings, bool checkVehicles, bool checkPlayers, bool checkObjects, bool checkDummies, bool seeThroughStuff, bool ignoreSomeObjectsForCamera, bool shootThroughStuff, element ignoredElement ] )
Required Arguments
- startX: The start x position
- startY: The start y position
- startZ: The start z position
- endX: The end x position
- endY: The end y position
- endZ: The end z position
Optional Arguments
NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.
- checkBuildings: Allow the line of sight to be blocked by GTA's internally placed buildings, i.e. the world map.
- checkVehicles: Allow the line of sight to be blocked by vehicles.
- checkPlayers: Allow the line of sight to be blocked by players.
- checkObjects: Allow the line of sight to be blocked by objects.
- checkDummies: Allow the line of sight to be blocked by GTA's internal dummies. These are not used in the current MTA version so this argument can be set to false.
- seeThroughStuff: Allow the line of sight to be blocked by translucent game objects, e.g. glass.
- ignoreSomeObjectsForCamera: Allow the line of sight to be blocked by certain objects.
- shootThroughStuff: Allow the line of sight to be blocked by certain entities.
- ignoredElement: Allow the line of sight to pass through a certain specified element.
Returns
If there is a collision, the function will return true, the collision position and MTA element hit. If no element is hit, the element return value will be nil. If there is no collision the function will return false.
Example
This page lacks an example.
--add an example here.
See Also
- createSWATRope
- getBirdsEnabled
- getCoronaReflectionsEnabled
- getGarageBoundingBox
- getGaragePosition
- getGarageSize
- getGroundPosition
- getInteriorFurnitureEnabled
- getNearClipDistance
- getPedsLODDistance
- getRoofPosition
- getScreenFromWorldPosition
- getVehiclesLODDistance
- getWorldFromScreenPosition
- isAmbientSoundEnabled
- isLineOfSightClear
- isWorldSoundEnabled
- processLineOfSight
- resetAmbientSounds
- resetBlurLevel
- resetColorFilter
- resetCoronaReflectionsEnabled
- resetNearClipDistance
- resetPedsLODDistance
- resetVehiclesLODDistance
- resetWorldSounds
- setAmbientSoundEnabled
- setBirdsEnabled
- setColorFilter
- setCoronaReflectionsEnabled
- setInteriorFurnitureEnabled
- setInteriorSoundsEnabled
- setNearClipDistance
- setPedsLODDistance
- setVehiclesLODDistance
- setWorldSoundEnabled
- testLineAgainstWater
- areTrafficLightsLocked
- getAircraftMaxHeight
- getAircraftMaxVelocity
- getCloudsEnabled
- getFarClipDistance
- getFogDistance
- getGameSpeed
- getGravity
- getHeatHaze
- getInteriorSoundsEnabled
- getJetpackMaxHeight
- getMinuteDuration
- getMoonSize
- getOcclusionsEnabled
- getRainLevel
- getSunColor
- getSunSize
- getTime
- getTrafficLightState
- getWeather
- getWindVelocity
- getSkyGradient
- getPlayerBlurLevel
- getZoneName
- isGarageOpen
- removeWorldModel
- resetFarClipDistance
- resetFogDistance
- resetHeatHaze
- resetMoonSize
- resetRainLevel
- resetSkyGradient
- resetSunColor
- resetSunSize
- resetWindVelocity
- restoreAllWorldModels
- restoreWorldModel
- setAircraftMaxHeight
- setAircraftMaxVelocity
- setCloudsEnabled
- setFarClipDistance
- setFogDistance
- setGameSpeed
- setGarageOpen
- setGravity
- setHeatHaze
- setInteriorSoundsEnabled
- setMinuteDuration
- setMoonSize
- setOcclusionsEnabled
- setRainLevel
- setSkyGradient
- setSunColor
- setSunSize
- setTime
- setTrafficLightState
- setTrafficLightsLocked
- setWeather
- setWeatherBlended
- setWindVelocity
- setJetpackMaxHeight
- setPlayerBlurLevel