surfaceType: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "Category:Scripting Commands ArmA2" to "Category:Scripting Commands Arma 2")
m (Text replacement - "↵↵</sqf>" to " </sqf>")
 
(46 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Command|Comments=
{{RV|type=command
____________________________________________________________________________________________


| arma |Game name=
|game1= ofpe
|version1= 1.00


|1.00|Game version=
|game2= arma1
____________________________________________________________________________________________
|version2= 1.00


| Returns what surface type is at the given position.<br><br>
|game3= arma2
See the spoiler for surface types:
|version3= 1.00
<spoiler>
<pre>
A3 1.28:


"#GdtStratisConcrete"
|game4= arma2oa
"#GdtStratisDryGrass"
|version4= 1.50
"#GdtStratisGreenGrass"
"#GdtStratisRocky"
"#GdtStratisForestPine"
"#GdtStratisBeach"
"#GdtStratisDirt"
"#GdtVRsurface01"
"#GdtDirt"
"#GdtGrassGreen"
"#GdtGrassDry"
"#GdtSoil"
"#GdtThorn"
"#GdtStony"
"#GdtConcrete"
"#GdtMarsh"
"#GdtBeach"
"#GdtSeabed"
"#GdtDead"


A3 1.66:
|game5= tkoh
"#Default"
|version5= 1.00
"#Water"
"#SurfRoadDirt"
"#SurfRoadConcrete"
"#SurfRoadTarmac"
"#SurfWood"
"#SurfMetal"
"#SurfRoofTin"
"#SurfRoofTiles"
"#SurfIntWood"
"#SurfIntConcrete"
"#SurfIntTiles"
"#SurfIntMetal"
"#SurfWater"
"#TEST_SurfNormal"
"#GdtStratisConcrete"
"#GdtStratisBeach"
"#GdtStratisDirt"
"#GdtStratisSeabedCluttered"
"#GdtStratisSeabed"
"#GdtStratisDryGrass"
"#GdtStratisGreenGrass"
"#GdtStratisRocky"
"#GdtStratisThistles"
"#GdtStratisForestPine"
"#GdtRubble"
"#GdtForestPine"
"#GdtConcrete"
"#GdtSoil"
"#GdtBeach"
"#GdtRock"
"#GdtDead"
"#GdtDirt"
"#GdtDesert"
"#GdtGrassGreen"
"#GdtGrassDry"
"#GdtGrassWild"
"#GdtWeed"
"#GdtWildField"
"#GdtThorn"
"#GdtStony"
"#GdtStonyThistle"
"#GdtMud"
"#GdtMarsh"
"#GdtSeabed"
"#concrete"
"#concrete_out"
"#concrete_inside"
"#dirtrunway"
"#road"
"#floor"
"#floor_inside"
"#carpet_inside"
"#carpet"
"#mud"
"#concrete_hall"
"#stones"
"#cardboard"
"#lino"
"#steel"
"#trash"
"#parquet"
"#sand"
"#metalPlate"
"#woodenFloor"
"#planks"
"#planks_inside"
"#grid"
"#rubble"
"#BuildingRubble"
"#tiling"
"#wavyMetal"
"#GdtVRsurface01"
"#surf_metal"
"#surf_roadconcrete"
"#surf_roaddirt"
"#surf_roadtarmac"
"#surf_rooftiles"
"#surf_rooftin"
"#surf_wood"
"#surfint_concrete"
"#surfint_metal"
"#surfint_tiles"
"#surfint_wood"
"#road_exp"
"#sand_exp"
"#SurfRoadDirt_exp"
"#SurfRoadConcrete_exp"
"#SurfRoadTarmac_exp"
"#SurfTrailDirt_exp"
"#concrete_exp"
"#concrete_in_exp"
"#concrete_hall_exp"
"#floor_exp"
"#floor_in_exp"
"#stones_exp"
"#planks_in_exp"
"#planks_exp"
"#softwood_in_exp"
"#steel_exp"
"#metalPlate_exp"
"#metalPlatePressed_exp"
"#metalPlate_in_exp"
"#grid_exp"
"#wavyMetal_exp"
"#carpet_exp"
"#carpet_in_exp"
"#mat_in_exp"
"#mud_exp"
"#straw_exp"
"#cardboard_exp"
"#lino_in_exp"
"#lino_exp"
"#roof_tiles_exp"
"#trash_exp"
"#rubble_exp"
"#BuildingRubble_exp"
"#GdtGrassShort"
"#GdtGrassTall"
"#GdtGrassLong"
"#GdtVolcanoBeach"
"#GdtRedDirt"
"#GdtAsphalt"
"#GdtField"
"#GdtForest"
"#GdtVolcano"
"#GdtCliff"
</pre>
</spoiler>|DESCRIPTION=
____________________________________________________________________________________________


| [[String]] <nowiki>=</nowiki> '''surfaceType''' position |SYNTAX=
|game6= arma3
|version6= 0.50


|p1= position: [[Array]] - format [[Position2D]] or [[Position3D]] in which case Z will be ignored|PARAMETER1=
|gr1= Positions


| [[String]] |RETURNVALUE=
|descr= Returns what surface type is at the given position. For surface texture see [[surfaceTexture]] command.<br>
____________________________________________________________________________________________
<br>
 
{{Feature|informative|The command returns surface type of the ground, even underneath objects such as buildings and roads}}
|x1= <code>_surface <nowiki>=</nowiki> [[surfaceType]] [4500, 4500];</code>|EXAMPLE1=
<spoiler text="Show surface types (Armed Assault)">
* #GRASSSOUTH
* #GRASSGENERAL
* #SANDGENERAL
</spoiler>
<spoiler text="Show surface types (Arma 2)">
* #UTGRASS - for natural surfaces
* #UTCONCRETE - for urban surfaces
</spoiler>
<spoiler text="Show surface types (Arma 3)">
{{Columns|4|
* BuildingRubble
* BuildingRubble_exp
* cardboard
* cardboard_exp
* carpet
* carpet_exp
* carpet_inside
* carpet_in_exp
* concrete
* concrete_exp
* concrete_hall
* concrete_hall_exp
* concrete_inside
* concrete_in_exp
* concrete_out
* Default
* dirtrunway
* floor
* floor_exp
* floor_inside
* floor_in_exp
* GdtAsphalt
* GdtBeach
* GdtCliff
* GdtConcrete
* GdtDead
* GdtDesert
* GdtDirt
* GdtField
* GdtForest
* GdtForestMalden
* GdtForestPine
* GdtGrassDry
* GdtGrassGreen
* GdtGrassLong
* GdtGrassShort
* GdtGrassTall
* GdtGrassWild
* GdtKLCobblestone
* GdtKLDirt
* GdtKlField
* GdtKLForestCon
* GdtKLForestDec
* GdtKLGrass1
* GdtKLGrass2
* GdtKlSoil
* GdtKlStubble
* GdtKlTarmac
* GdtKlWeatheredTarmac
* GdtMarsh
* GdtMud
* GdtRedDirt
* GdtRock
* GdtRubble
* GdtSeabed
* GdtSeabedExp
* GdtSoil
* GdtStony
* GdtStonyThistle
* GdtStratisBeach
* GdtStratisConcrete
* GdtStratisDirt
* GdtStratisDryGrass
* GdtStratisForestPine
* GdtStratisGreenGrass
* GdtStratisRocky
* GdtStratisSeabed
* GdtStratisSeabedCluttered
* GdtStratisThistles
* GdtThorn
* GdtVolcano
* GdtVolcanoBeach
* GdtVRsurface01
* GdtWeed
* GdtWildField
* grid
* grid_exp
* lino
* lino_exp
* lino_in_exp
* mat_in_exp
* metalPlate
* metalPlatePressed_exp
* metalPlate_exp
* metalPlate_in_exp
* mud
* mud_exp
* parquet
* planks
* planks_exp
* planks_inside
* planks_in_exp
* road
* road_exp
* roof_tiles_exp
* rubble
* rubble_exp
* sand
* sand_exp
* softwood_in_exp
* steel
* steel_exp
* stones
* stones_exp
* straw_exp
* SurfIntConcrete
* SurfIntMetal
* SurfIntTiles
* SurfIntWood
* surfint_concrete
* surfint_metal
* surfint_tiles
* surfint_wood
* SurfMetal
* SurfRoadConcrete
* SurfRoadConcrete_exp
* SurfRoadDirt
* SurfRoadDirt_Enoch
* SurfRoadDirt_exp
* SurfRoadTarmac
* SurfRoadTarmac1_Enoch
* SurfRoadTarmac2_Enoch
* SurfRoadTarmac3_Enoch
* SurfRoadTarmac_exp
* SurfRoofTiles
* SurfRoofTin
* SurfTrailDirt_Enoch
* SurfTrailDirt_exp
* SurfWater
* SurfWood
* surf_metal
* surf_roadconcrete
* surf_roaddirt
* surf_roadtarmac
* surf_rooftiles
* surf_rooftin
* surf_wood
* TEST_SurfNormal
* tiling
* trash
* trash_exp
* Water
* wavyMetal
* wavyMetal_exp
* woodenFloor
}}
</spoiler>


|x2= <code>_surface <nowiki>=</nowiki> [[surfaceType]] [[position]] [[player]];</code>|EXAMPLE2=
|s1= [[surfaceType]] [x, y, z or useLayerMask]
____________________________________________________________________________________________


| [[surfaceIsWater]], [[surfaceNormal]], [[getAllEnvSoundControllers]] |SEEALSO=
|p1= x: [[Number]] - world x coordinate of the position
|p2= y: [[Number]] - world y coordinate of the position
|p3since=arma3 2.18
|p3= z or useLayerMask: [[Number]] or [[Boolean]] - When a number is provided (Z in 3D positions), it is ignored. When a boolean is provided, it defines whether the layer mask should be used. Using the layer mask is more accurate but slightly slower.
[[File:Capture.png|thumb|256px|The patches of "dirt" are defined using a layer mask. The "concrete" is the primary surface texture.]]
|r1= [[String]] - Surface type


}}
|x1= <sqf>private _surface = surfaceType [4500, 4500];</sqf>


<h3 style="display:none">Notes</h3>
|x2= <sqf>hint surfaceType getPosWorld player;</sqf>
<dl class="command_description">
<!-- Note Section BEGIN -->


<dd class="notedate">Posted on February 05, 2010 - 01:06
|x3= <sqf>
<dt class="note">'''[[User:MaestrO.fr|MaestrO.fr]]'''<dd class="note">In ArmA 2 returned value is "#UTGRASS" for natural surface and "#UTCONCRETE" for urban surface.
private _pos = getPosWorld player;
<dd class="notedate">Posted on December 16, 2006 - 23:45
_pos set [2, true]; // use layer mask
<dt class="note">'''[[User:Kronzky|Kronzky]]'''<dd class="note">Only seems to return either "#GRASSSOUTH" or "#GRASSGENERAL", even when you're in a building or in water.
surfaceType _pos;
<dd class="notedate">Posted on December 30, 2006 - 16:12
</sqf>
<dt class="note">'''[[User:VictorF|VictorF]]'''<dd class="note">Another returned value is "#SANDGENERAL". However, when providing an exact [x,y] position the "surfaceType" function seems to return the general surface type of the environment rather than the exact type on that given position.


<!-- Note Section END -->
|seealso= [[surfaceTexture]] [[surfaceIsWater]] [[surfaceNormal]] [[getAllEnvSoundControllers]]
</dl>
}}
<h3 style="display:none">Bottom Section</h3>
[[Category:Scripting Commands|SURFACETYPE]]
[[Category:Scripting Commands OFP Elite |SURFACETYPE]]
[[Category:Scripting Commands ArmA|SURFACETYPE]]
[[Category:Scripting Commands Arma 2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]

Latest revision as of 19:48, 3 September 2024

Hover & click on the images for description

Description

Description:
Returns what surface type is at the given position. For surface texture see surfaceTexture command.

The command returns surface type of the ground, even underneath objects such as buildings and roads

  • #GRASSSOUTH
  • #GRASSGENERAL
  • #SANDGENERAL
  • #UTGRASS - for natural surfaces
  • #UTCONCRETE - for urban surfaces

  • BuildingRubble
  • BuildingRubble_exp
  • cardboard
  • cardboard_exp
  • carpet
  • carpet_exp
  • carpet_inside
  • carpet_in_exp
  • concrete
  • concrete_exp
  • concrete_hall
  • concrete_hall_exp
  • concrete_inside
  • concrete_in_exp
  • concrete_out
  • Default
  • dirtrunway
  • floor
  • floor_exp
  • floor_inside
  • floor_in_exp
  • GdtAsphalt
  • GdtBeach
  • GdtCliff
  • GdtConcrete
  • GdtDead
  • GdtDesert
  • GdtDirt
  • GdtField
  • GdtForest
  • GdtForestMalden
  • GdtForestPine
  • GdtGrassDry
  • GdtGrassGreen
  • GdtGrassLong
  • GdtGrassShort
  • GdtGrassTall
  • GdtGrassWild
  • GdtKLCobblestone
  • GdtKLDirt
  • GdtKlField
  • GdtKLForestCon
  • GdtKLForestDec
  • GdtKLGrass1
  • GdtKLGrass2
  • GdtKlSoil
  • GdtKlStubble
  • GdtKlTarmac
  • GdtKlWeatheredTarmac
  • GdtMarsh
  • GdtMud
  • GdtRedDirt
  • GdtRock
  • GdtRubble
  • GdtSeabed
  • GdtSeabedExp
  • GdtSoil
  • GdtStony
  • GdtStonyThistle
  • GdtStratisBeach
  • GdtStratisConcrete
  • GdtStratisDirt
  • GdtStratisDryGrass
  • GdtStratisForestPine
  • GdtStratisGreenGrass
  • GdtStratisRocky
  • GdtStratisSeabed
  • GdtStratisSeabedCluttered
  • GdtStratisThistles
  • GdtThorn
  • GdtVolcano
  • GdtVolcanoBeach
  • GdtVRsurface01
  • GdtWeed
  • GdtWildField
  • grid
  • grid_exp
  • lino
  • lino_exp
  • lino_in_exp
  • mat_in_exp
  • metalPlate
  • metalPlatePressed_exp
  • metalPlate_exp
  • metalPlate_in_exp
  • mud
  • mud_exp
  • parquet
  • planks
  • planks_exp
  • planks_inside
  • planks_in_exp
  • road
  • road_exp
  • roof_tiles_exp
  • rubble
  • rubble_exp
  • sand
  • sand_exp
  • softwood_in_exp
  • steel
  • steel_exp
  • stones
  • stones_exp
  • straw_exp
  • SurfIntConcrete
  • SurfIntMetal
  • SurfIntTiles
  • SurfIntWood
  • surfint_concrete
  • surfint_metal
  • surfint_tiles
  • surfint_wood
  • SurfMetal
  • SurfRoadConcrete
  • SurfRoadConcrete_exp
  • SurfRoadDirt
  • SurfRoadDirt_Enoch
  • SurfRoadDirt_exp
  • SurfRoadTarmac
  • SurfRoadTarmac1_Enoch
  • SurfRoadTarmac2_Enoch
  • SurfRoadTarmac3_Enoch
  • SurfRoadTarmac_exp
  • SurfRoofTiles
  • SurfRoofTin
  • SurfTrailDirt_Enoch
  • SurfTrailDirt_exp
  • SurfWater
  • SurfWood
  • surf_metal
  • surf_roadconcrete
  • surf_roaddirt
  • surf_roadtarmac
  • surf_rooftiles
  • surf_rooftin
  • surf_wood
  • TEST_SurfNormal
  • tiling
  • trash
  • trash_exp
  • Water
  • wavyMetal
  • wavyMetal_exp
  • woodenFloor
↑ Back to spoiler's top
Groups:
Positions

Syntax

Syntax:
surfaceType [x, y, z or useLayerMask]
Parameters:
x: Number - world x coordinate of the position
y: Number - world y coordinate of the position
since Arma 3 logo black.png2.18
z or useLayerMask: Number or Boolean - When a number is provided (Z in 3D positions), it is ignored. When a boolean is provided, it defines whether the layer mask should be used. Using the layer mask is more accurate but slightly slower.
The patches of "dirt" are defined using a layer mask. The "concrete" is the primary surface texture.
Return Value:
String - Surface type

Examples

Example 1:
private _surface = surfaceType [4500, 4500];
Example 2:
hint surfaceType getPosWorld player;
Example 3:
private _pos = getPosWorld player; _pos set [2, true]; // use layer mask surfaceType _pos;

Additional Information

See also:
surfaceTexture surfaceIsWater surfaceNormal getAllEnvSoundControllers

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note