Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
surface.c
Go to the documentation of this file.
1
class
Surface
2
{
3
static
int
GetStepsParticleID
(
string
surface_name)
4
{
5
return
SurfaceInfo
.
GetByName
(surface_name).
GetStepParticleId
();
6
}
7
8
static
int
GetWheelParticleID
(
string
surface_name)
9
{
10
return
SurfaceInfo
.
GetByName
(surface_name).
GetWheelParticleId
();
11
}
12
13
static
int
GetParamInt
(
string
surface_name,
string
param_name)
14
{
15
return
g_Game
.ConfigGetInt(
"CfgSurfaces "
+ surface_name +
" "
+ param_name);
16
}
17
18
static
float
GetParamFloat
(
string
surface_name,
string
param_name)
19
{
20
return
g_Game
.ConfigGetFloat(
"CfgSurfaces "
+ surface_name +
" "
+ param_name);
21
}
22
23
static
string
GetParamText
(
string
surfaceName,
string
paramName)
24
{
25
string
output =
""
;
26
g_Game
.ConfigGetText(
"CfgSurfaces "
+ surfaceName +
" "
+ paramName, output);
27
return
output;
28
29
}
30
31
static
bool
AllowedWaterSurface
(
float
pHeight,
string
pSurface,
array<string>
pAllowedSurfaceList)
32
{
33
if
(pSurface)
34
{
35
pSurface.
Replace
(
"_ext"
,
""
);
36
pSurface.
Replace
(
"_int"
,
""
);
37
pSurface.
Replace
(
"sakhal_"
,
""
);
38
}
39
40
bool
isSeaCheck =
false
;
41
42
foreach
(
string
allowedSurface : pAllowedSurfaceList)
43
{
44
if
(pSurface ==
""
&& allowedSurface ==
UAWaterType
.
SEA
)
45
isSeaCheck = pHeight <= (
g_Game
.SurfaceGetSeaLevel() + 0.25);
//MaxWave_default
46
47
if
(isSeaCheck || allowedSurface == pSurface)
48
return
true
;
49
}
50
51
return
false
;
52
}
53
54
static
bool
CheckLiquidSource
(
float
pHeight,
string
pSurface,
int
allowedWaterSourceMask)
55
{
56
bool
success =
false
;
57
if
(pSurface ==
""
)
58
{
59
if
( allowedWaterSourceMask &
LIQUID_SALTWATER
)
60
{
61
success =
true
;
62
}
63
}
64
else
65
{
66
int
liquidType =
SurfaceInfo
.
GetByName
(pSurface).
GetLiquidType
();
67
68
success = allowedWaterSourceMask & liquidType;
69
}
70
71
return
success;
72
}
73
}
Surface
Definition
surface.c:2
Surface::GetParamFloat
static float GetParamFloat(string surface_name, string param_name)
Definition
surface.c:18
Surface::GetWheelParticleID
static int GetWheelParticleID(string surface_name)
Definition
surface.c:8
Surface::GetParamInt
static int GetParamInt(string surface_name, string param_name)
Definition
surface.c:13
Surface::GetStepsParticleID
static int GetStepsParticleID(string surface_name)
Definition
surface.c:3
Surface::GetParamText
static string GetParamText(string surfaceName, string paramName)
Definition
surface.c:23
Surface::AllowedWaterSurface
static bool AllowedWaterSurface(float pHeight, string pSurface, array< string > pAllowedSurfaceList)
Definition
surface.c:31
Surface::CheckLiquidSource
static bool CheckLiquidSource(float pHeight, string pSurface, int allowedWaterSourceMask)
Definition
surface.c:54
SurfaceInfo
Unmanaged surface info handle.
Definition
surfaceinfo.c:9
SurfaceInfo::GetWheelParticleId
proto int GetWheelParticleId()
SurfaceInfo::GetByName
static proto SurfaceInfo GetByName(string name)
Warning: O(n) time complexity where n is the total number of loaded surfaces Note: Will load the surf...
SurfaceInfo::GetStepParticleId
proto int GetStepParticleId()
See 'ParticleList', if config entry not set, value is 'ParticleList.NONE', if config entry is set but...
SurfaceInfo::GetLiquidType
proto int GetLiquidType()
See 'LiquidTypes' in 'constants.c'.
UAWaterType
Definition
actionconstants.c:161
UAWaterType::SEA
const string SEA
Definition
actionconstants.c:162
array
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
Definition
isboxcollidinggeometryproxyclasses.c:28
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
LIQUID_SALTWATER
const int LIQUID_SALTWATER
Definition
constants.c:553
string::Replace
proto int Replace(string sample, string replace)
Replace all occurrances of 'sample' in 'str' by 'replace'.
Games
Dayz
scripts
4_world
static
surface.c
Generated by
1.17.0