Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_AIGetRandomLookPosition.c
Go to the documentation of this file.
1
class
SCR_AIGetRandomLookPosition
:
AITaskScripted
2
{
3
// Inputs
4
protected
static
const
string
PORT_IN_POS
=
"InPos"
;
5
6
// Outputs
7
protected
static
const
string
PORT_OUT_POS
=
"OutPos"
;
8
9
[
Attribute
(
"0.5"
,
UIWidgets
.EditBox,
params
:
"0 1"
,
desc
:
"Radius of random position is calculated based on distance multiplied by this value"
)]
10
protected
float
m_fTangent
;
11
12
//----------------------------------------------------------------------
13
override
ENodeResult
EOnTaskSimulate
(AIAgent owner,
float
dt)
14
{
15
IEntity
controlledEntity = owner.GetControlledEntity();
16
if
(!controlledEntity)
17
return
ENodeResult
.FAIL;
18
19
vector
inPos;
20
if
(!
GetVariableIn
(
PORT_IN_POS
, inPos))
21
return
ENodeResult
.FAIL;
22
23
float
distance
=
vector
.Distance(controlledEntity.
GetOrigin
(), inPos);
24
25
vector
outPos =
s_AIRandomGenerator
.GenerateRandomPointInRadius(0,
distance
*
m_fTangent
, inPos,
true
);
26
outPos[1] = inPos[1];
27
28
SetVariableOut
(
PORT_OUT_POS
, outPos);
29
30
return
ENodeResult
.SUCCESS;
31
}
32
33
//----------------------------------------------------------------------
34
protected
static
ref
TStringArray
s_aVarsOut
= {
PORT_OUT_POS
};
35
override
TStringArray
GetVariablesOut
() {
return
s_aVarsOut
; }
36
37
protected
static
ref
TStringArray
s_aVarsIn
= {
PORT_IN_POS
};
38
override
TStringArray
GetVariablesIn
() {
return
s_aVarsIn
; }
39
40
override
static
string
GetOnHoverDescription
()
41
{
42
return
"Generates randomized positions based on estimated target position, to look at them randomly."
;
43
}
44
45
override
string
GetNodeMiddleText
()
46
{
47
return
string
.Format(
"Tangent: %1"
,
m_fTangent
);
48
}
49
50
override
static
bool
VisibleInPalette
() {
return
true
; }
51
}
s_AIRandomGenerator
class SCR_AINodePortsHelpers s_AIRandomGenerator
distance
float distance
Definition
SCR_DestructibleTreeV2.c:29
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
params
category params
Definition
SCR_SpherePointGeneratorPreviewComponent.c:21
AITaskScripted
Definition
AITaskScripted.c:13
IEntity
Definition
IEntity.c:13
IEntity::GetOrigin
proto external vector GetOrigin()
Node::SetVariableOut
proto void SetVariableOut(string name, void val)
Node::GetVariableIn
proto bool GetVariableIn(string name, out void val)
SCR_AIGetRandomLookPosition
Definition
SCR_AIGetRandomLookPosition.c:2
SCR_AIGetRandomLookPosition::m_fTangent
float m_fTangent
Definition
SCR_AIGetRandomLookPosition.c:10
SCR_AIGetRandomLookPosition::PORT_OUT_POS
static const string PORT_OUT_POS
Definition
SCR_AIGetRandomLookPosition.c:7
SCR_AIGetRandomLookPosition::GetNodeMiddleText
override string GetNodeMiddleText()
Definition
SCR_AIGetRandomLookPosition.c:45
SCR_AIGetRandomLookPosition::VisibleInPalette
static override bool VisibleInPalette()
Definition
SCR_AIGetRandomLookPosition.c:50
SCR_AIGetRandomLookPosition::GetOnHoverDescription
static override string GetOnHoverDescription()
Definition
SCR_AIGetRandomLookPosition.c:40
SCR_AIGetRandomLookPosition::GetVariablesOut
override TStringArray GetVariablesOut()
Definition
SCR_AIGetRandomLookPosition.c:35
SCR_AIGetRandomLookPosition::EOnTaskSimulate
override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
Definition
SCR_AIGetRandomLookPosition.c:13
SCR_AIGetRandomLookPosition::GetVariablesIn
override TStringArray GetVariablesIn()
Definition
SCR_AIGetRandomLookPosition.c:38
SCR_AIGetRandomLookPosition::PORT_IN_POS
static const string PORT_IN_POS
Definition
SCR_AIGetRandomLookPosition.c:4
SCR_AIGetRandomLookPosition::s_aVarsOut
static ref TStringArray s_aVarsOut
Definition
SCR_AIGetRandomLookPosition.c:34
SCR_AIGetRandomLookPosition::s_aVarsIn
static ref TStringArray s_aVarsIn
Definition
SCR_AIGetRandomLookPosition.c:37
UIWidgets
Definition
attributes.c:40
vector
Definition
vector.c:13
ENodeResult
ENodeResult
Definition
ENodeResult.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
TStringArray
array< string > TStringArray
Definition
Types.c:385
scripts
Game
AI
ScriptedNodes
Utils
SCR_AIGetRandomLookPosition.c
Generated by
1.17.0