DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Файл PluginPresenceNotifier.c

См. исходные тексты.

Структуры данных

class  PresenceNotifierNoiseEvents
 

Перечисления

enum  EPresenceNotifierNoiseEventType { LAND_LIGHT , LAND_HEAVY }
 

Функции

void PresenceNotifierNoiseEvent (float pValue, float pLength)
 
float GetTimerLength ()
 
int GetValue ()
 
void PluginPresenceNotifier ()
 
void Init (PlayerBase player)
 
void EnableDebug (bool pEnabled)
 
void ShowCoefsDbg (bool pEnabled)
 
int GetNoisePresence ()
 returns actual noise presence of player
 
int GetVisualPresence ()
 returns actual visibility presence of player
 
void ProcessEvent (EPresenceNotifierNoiseEventType pEventType)
 processing of external one-time events (land, fire, etc.)
 
int ProcessVisualComponents ()
 
int ProcessNoiseComponents ()
 
float GetMovementSpeedVisualCoef ()
 Visibility.
 
float GetMovementStanceVisualCoef ()
 
int GetMovementSpeedNoiseComponent ()
 
int GetBootsNoiseComponent ()
 
int GetSurfaceNoiseComponent ()
 DEPRECATED.
 
int GetExternalNoiseEventsComponent ()
 DEPRECATED.
 

Переменные

enum EPresenceNotifierNoiseEventType m_TimerLength
 
int m_Value
 
class PresenceNotifierNoiseEvents windowPosX = 0
 dbgUI settings
 
const int windowPosY = 10
 
const int mainPanelSizeX = 200
 
const int mainPanelSizeY = 1
 
const int margin = 10
 
const int NOISE_LEVEL_MIN = 0
 noise limits
 
const int NOISE_LEVEL_MAX = 5
 
const int SURFACE_NOISE_LVL0 = 0
 noise component from surfaces
 
const int SURFACE_NOISE_LVL1 = 1
 
const int SURFACE_NOISE_LVL2 = 2
 
const float SURFACE_LVL2_THRESHOLD = 1.0
 
const float SURFACE_LVL1_THRESHOLD = 0.5
 
const int LAND_NOISE_LVL1 = 2
 land noise
 
const int LAND_NOISE_LVL2 = 3
 
PlayerBase m_pPlayer
 
Weather m_Weather
 
ref PresenceNotifierNoiseEvents m_PresenceNotifierNoiseEvents
 

Перечисления

◆ EPresenceNotifierNoiseEventType

Элементы перечислений
LAND_LIGHT 
LAND_HEAVY 
2{
5}
@ LAND_LIGHT
Definition PluginPresenceNotifier.c:3
@ LAND_HEAVY
Definition PluginPresenceNotifier.c:4

Функции

◆ EnableDebug()

void EnableDebug ( bool pEnabled)
protected
121 {
123 }
void ShowCoefsDbg(bool pEnabled)
Definition PluginPresenceNotifier.c:125
Definition EntityAI.c:95

Перекрестные ссылки ShowCoefsDbg().

◆ GetBootsNoiseComponent()

int GetBootsNoiseComponent ( )
protected

noise component of presence based on player's shoes DEPRECATED

◆ GetExternalNoiseEventsComponent()

int GetExternalNoiseEventsComponent ( )
protected

DEPRECATED.

◆ GetMovementSpeedNoiseComponent()

int GetMovementSpeedNoiseComponent ( )
protected

Noise related noise component of presence based on player's speed DEPRECATED

◆ GetMovementSpeedVisualCoef()

float GetMovementSpeedVisualCoef ( )
protected

Visibility.

235 {
237 float speedCoef = 1.0;
238
239 m_pPlayer.GetMovementState(hms);
241 {
242 case DayZPlayerConstants.MOVEMENTIDX_RUN:
243 speedCoef = 0.66;
244 break;
245 case DayZPlayerConstants.MOVEMENTIDX_WALK:
246 speedCoef = 0.33;
247 break;
248 case DayZPlayerConstants.MOVEMENTIDX_IDLE:
249 speedCoef = 0;
250 break;
251 }
252
253 return speedCoef;
254 }
PlayerBase m_pPlayer
Definition PluginPresenceNotifier.c:102
Definition AITargetCallbacksPlayer.c:2
static int StanceToMovementIdxTranslation(HumanMovementState pState)
Definition AITargetCallbacksPlayer.c:89
Definition human.c:1139
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

Перекрестные ссылки m_pPlayer и AITargetCallbacksPlayer::StanceToMovementIdxTranslation().

Используется в ProcessVisualComponents() и ShowCoefsDbg().

◆ GetMovementStanceVisualCoef()

float GetMovementStanceVisualCoef ( )
protected
257 {
259 float stanceCoef = 1.0;
260
261 m_pPlayer.GetMovementState(hms);
262 switch (hms.m_iStanceIdx)
263 {
264 case DayZPlayerConstants.STANCEIDX_CROUCH:
265 case DayZPlayerConstants.STANCEIDX_RAISEDCROUCH:
266 stanceCoef = 0.33;
267 break;
268
269 case DayZPlayerConstants.STANCEIDX_PRONE:
270 case DayZPlayerConstants.STANCEIDX_RAISEDPRONE:
271 stanceCoef = 0.11;
272 break;
273 }
274
275 return stanceCoef;
276 }

Перекрестные ссылки m_pPlayer.

Используется в ProcessVisualComponents() и ShowCoefsDbg().

◆ GetNoisePresence()

int GetNoisePresence ( )
protected

returns actual noise presence of player

192 {
193 return ProcessNoiseComponents();
194 }
int ProcessNoiseComponents()
Definition PluginPresenceNotifier.c:219

Перекрестные ссылки ProcessNoiseComponents().

Используется в ShowCoefsDbg().

◆ GetSurfaceNoiseComponent()

int GetSurfaceNoiseComponent ( )
protected

DEPRECATED.

◆ GetTimerLength()

float GetTimerLength ( )
protected
19 {
20 return m_TimerLength;
21 }
enum EPresenceNotifierNoiseEventType m_TimerLength

Перекрестные ссылки m_TimerLength.

◆ GetValue()

int GetValue ( )
protected
24 {
25 return m_Value;
26 }
int m_Value
Definition PluginPresenceNotifier.c:10

Перекрестные ссылки m_Value.

◆ GetVisualPresence()

int GetVisualPresence ( )
protected

returns actual visibility presence of player

198 {
200 }
int ProcessVisualComponents()
Definition PluginPresenceNotifier.c:208

Перекрестные ссылки ProcessVisualComponents().

Используется в ShowCoefsDbg().

◆ Init()

void Init ( PlayerBase player)
protected
115 {
117 m_Weather = GetGame().GetWeather();
118 }
Weather m_Weather
Definition PluginPresenceNotifier.c:103
proto native CGame GetGame()

Перекрестные ссылки GetGame(), m_pPlayer и m_Weather.

◆ PluginPresenceNotifier()

void PluginPresenceNotifier ( )
protected
108 {
112 }
EPresenceNotifierNoiseEventType
Definition PluginPresenceNotifier.c:2
const int LAND_NOISE_LVL2
Definition PluginPresenceNotifier.c:98
const int LAND_NOISE_LVL1
land noise
Definition PluginPresenceNotifier.c:97
ref PresenceNotifierNoiseEvents m_PresenceNotifierNoiseEvents
Definition PluginPresenceNotifier.c:105
Definition PluginPresenceNotifier.c:30

Перекрестные ссылки LAND_NOISE_LVL1, LAND_NOISE_LVL2 и m_PresenceNotifierNoiseEvents.

Используется в ManBase::OnSelectPlayer().

◆ PresenceNotifierNoiseEvent()

void PresenceNotifierNoiseEvent ( float pValue,
float pLength )
protected
13 {
16 }

Перекрестные ссылки m_TimerLength и m_Value.

Используется в PresenceNotifierNoiseEvents::ProcessEvent() и PresenceNotifierNoiseEvents::RegisterEvent().

◆ ProcessEvent()

void ProcessEvent ( EPresenceNotifierNoiseEventType pEventType)
protected

processing of external one-time events (land, fire, etc.)

204 {
206 }

Перекрестные ссылки m_PresenceNotifierNoiseEvents.

◆ ProcessNoiseComponents()

int ProcessNoiseComponents ( )
protected
220 {
221 float noise = 0;
222 float reduction = 0;
223 if (m_pPlayer)
224 {
227 }
228
230 }
const int NOISE_LEVEL_MAX
Definition PluginPresenceNotifier.c:86
const int NOISE_LEVEL_MIN
noise limits
Definition PluginPresenceNotifier.c:85
Definition EnMath.c:7
Definition SensesAIEvaluate.c:2
static float GetNoiseMultiplier(DayZPlayerImplement playerImplement)
Definition SensesAIEvaluate.c:5
static float GetNoiseReduction(Weather weather)
Definition SensesAIEvaluate.c:18
static proto float Round(float f)
Returns mathematical round of value.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.

Перекрестные ссылки Math::Clamp(), GetGame(), NoiseAIEvaluate::GetNoiseMultiplier(), NoiseAIEvaluate::GetNoiseReduction(), m_pPlayer, NOISE_LEVEL_MAX, NOISE_LEVEL_MIN и Math::Round().

Используется в GetNoisePresence().

◆ ProcessVisualComponents()

int ProcessVisualComponents ( )
protected
209 {
210 float visualMean = 0;
211 if (m_pPlayer)
212 {
214 }
215
216 return visualMean;
217 }
float GetMovementSpeedVisualCoef()
Visibility.
Definition PluginPresenceNotifier.c:234
float GetMovementStanceVisualCoef()
Definition PluginPresenceNotifier.c:256

Перекрестные ссылки GetMovementSpeedVisualCoef(), GetMovementStanceVisualCoef() и m_pPlayer.

Используется в GetVisualPresence().

◆ ShowCoefsDbg()

void ShowCoefsDbg ( bool pEnabled)
protected

HumanMovementState content

126 {
128
129 if (pEnabled && m_pPlayer)
130 {
132 m_pPlayer.GetMovementState(hms);
133
134 string visualAlertLevel;
135 string noiseAlertLevel;
136
137 DbgUI.Begin("Presence Notifier", windowPosX + 10, windowPosY);
138 DbgUI.Panel("MinimumSize", mainPanelSizeX, mainPanelSizeY);
139
140 DbgUI.Text("Visual: ");
141 DbgUI.Text("Visibility: " + m_pPlayer.GetVisibilityCoef());
143 DbgUI.Text("Stance: " + GetMovementStanceVisualCoef());
144 DbgUI.Spacer(10);
145
146 DbgUI.Panel("-- Noises", mainPanelSizeX, 2);
147 DbgUI.Text("Noises: ");
150 DbgUI.Text("Surface: " + NoiseAIEvaluate.GetNoiseMultiplierBySurface(m_pPlayer) + " [ cfg: " + m_pPlayer.GetSurfaceNoise() + "]");
151 DbgUI.Spacer(10);
152
153 DbgUI.Panel("-- Noise reductions", mainPanelSizeX, 2);
154 DbgUI.Text("Noise reductions: ");
156 DbgUI.Spacer(10);
157
158 DbgUI.Panel("-- Result", mainPanelSizeX, 2);
159 DbgUI.Text("Result: ");
160 visualAlertLevel = "";
161 for (int iv = 0; iv < GetVisualPresence(); iv++)
162 {
163 visualAlertLevel += "!";
164 }
165 DbgUI.Text("Visual level: " + GetVisualPresence() + " [" + visualAlertLevel + "]");
166
167
168 noiseAlertLevel = "";
169 for (int ia = 0; ia < GetNoisePresence(); ia++)
170 {
171 noiseAlertLevel += "!";
172 }
173
174 DbgUI.Text("Noise level: " + GetNoisePresence() + " [" + noiseAlertLevel + "]");
175
176 DbgUI.End();
177
179 DbgUI.Begin("HumanMovementState", windowPosX + 250, windowPosY);
180 DbgUI.Panel("MinimumSize", mainPanelSizeX, mainPanelSizeY);
181 DbgUI.Text("Command ID: " + hms.m_CommandTypeId);
182 DbgUI.Text("Stance: " + hms.m_iStanceIdx);
183 DbgUI.Text("Movement: " + hms.m_iMovement);
184 DbgUI.End();
185 }
186
188 }
class PresenceNotifierNoiseEvents windowPosX
dbgUI settings
const int mainPanelSizeX
Definition PluginPresenceNotifier.c:79
int GetVisualPresence()
returns actual visibility presence of player
Definition PluginPresenceNotifier.c:197
const int mainPanelSizeY
Definition PluginPresenceNotifier.c:80
int GetNoisePresence()
returns actual noise presence of player
Definition PluginPresenceNotifier.c:191
const int windowPosY
Definition PluginPresenceNotifier.c:77
Definition DbgUI.c:60
static float GetNoiseMultiplierByPlayerSpeed(DayZPlayerImplement playerImplement)
Definition SensesAIEvaluate.c:27
static float GetNoiseMultiplierByShoes(DayZPlayerImplement playerImplement)
Definition SensesAIEvaluate.c:63
static float GetNoiseMultiplierBySurface(DayZPlayerImplement playerImplement)
Definition SensesAIEvaluate.c:82
static proto native void Spacer(int height)
static proto native void Begin(string windowTitle, float x=0, float y=0)
static proto void BeginCleanupScope()
static proto native void Text(string label)
static proto native void EndCleanupScope()
static proto native void End()
static proto native void Panel(string label, int width, int height, int color=0xaa555555)

Перекрестные ссылки DbgUI::Begin(), DbgUI::BeginCleanupScope(), DbgUI::End(), DbgUI::EndCleanupScope(), GetMovementSpeedVisualCoef(), GetMovementStanceVisualCoef(), NoiseAIEvaluate::GetNoiseMultiplierByPlayerSpeed(), NoiseAIEvaluate::GetNoiseMultiplierByShoes(), NoiseAIEvaluate::GetNoiseMultiplierBySurface(), GetNoisePresence(), NoiseAIEvaluate::GetNoiseReduction(), GetVisualPresence(), m_pPlayer, m_Weather, mainPanelSizeX, mainPanelSizeY, DbgUI::Panel(), DbgUI::Spacer(), DbgUI::Text(), windowPosX и windowPosY.

Используется в EnableDebug().

Переменные

◆ LAND_NOISE_LVL1

const int LAND_NOISE_LVL1 = 2
protected

land noise

Используется в PluginPresenceNotifier().

◆ LAND_NOISE_LVL2

const int LAND_NOISE_LVL2 = 3
protected

Используется в PluginPresenceNotifier().

◆ m_pPlayer

PlayerBase m_pPlayer
protected

◆ m_PresenceNotifierNoiseEvents

ref PresenceNotifierNoiseEvents m_PresenceNotifierNoiseEvents
protected

Используется в PluginPresenceNotifier() и ProcessEvent().

◆ m_TimerLength

◆ m_Value

int m_Value
protected

◆ m_Weather

◆ mainPanelSizeX

const int mainPanelSizeX = 200
protected

Используется в OnGUI() и ShowCoefsDbg().

◆ mainPanelSizeY

const int mainPanelSizeY = 1
protected

Используется в OnGUI() и ShowCoefsDbg().

◆ margin

const int margin = 10
protected

Используется в OnGUI().

◆ NOISE_LEVEL_MAX

const int NOISE_LEVEL_MAX = 5
protected

Используется в ProcessNoiseComponents().

◆ NOISE_LEVEL_MIN

const int NOISE_LEVEL_MIN = 0
protected

noise limits

Используется в ProcessNoiseComponents().

◆ SURFACE_LVL1_THRESHOLD

const float SURFACE_LVL1_THRESHOLD = 0.5
protected

◆ SURFACE_LVL2_THRESHOLD

const float SURFACE_LVL2_THRESHOLD = 1.0
protected

◆ SURFACE_NOISE_LVL0

const int SURFACE_NOISE_LVL0 = 0
protected

noise component from surfaces

◆ SURFACE_NOISE_LVL1

const int SURFACE_NOISE_LVL1 = 1
protected

◆ SURFACE_NOISE_LVL2

const int SURFACE_NOISE_LVL2 = 2
protected

◆ windowPosX

class PresenceNotifierNoiseEvents windowPosX = 0
protected

dbgUI settings

Используется в OnGUI() и ShowCoefsDbg().

◆ windowPosY

const int windowPosY = 10
protected

Используется в OnGUI() и ShowCoefsDbg().