Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AIConfigureArtilleryAmmo.c
Go to the documentation of this file.
2{
3 // Inputs
4 protected static const string PORT_AMMO_ENTITY = "AmmoEntity";
5 protected static const string PORT_INIT_SPEED_ID = "InitSpeedId";
6
7
8 //---------------------------------------------------------------------------------------------------------
9 override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
10 {
11 IEntity ammoEntity;
12 int initSpeedId = 0;
13 if (!GetVariableIn(PORT_AMMO_ENTITY, ammoEntity))
14 return ENodeResult.FAIL;
15 if (!ammoEntity)
16 return ENodeResult.FAIL;
17
18 if (!GetVariableIn(PORT_INIT_SPEED_ID, initSpeedId))
19 return ENodeResult.FAIL;
20
21 //Print(string.Format("SCR_AIConfigureArtilleryAmmo: Setting initial speed index %1 for ammo entity %2", initSpeedId, ammoEntity));
22 ConfigureAmmoEntity(ammoEntity, initSpeedId);
23
24 return ENodeResult.SUCCESS;
25 }
26
27 //---------------------------------------------------------------------------------------------------------
28 protected bool ConfigureAmmoEntity(notnull IEntity ammoEntity, int configurationId)
29 {
30 SCR_MortarShellGadgetComponent shellComp = SCR_MortarShellGadgetComponent.Cast(ammoEntity.FindComponent(SCR_MortarShellGadgetComponent));
31
32 if (!shellComp)
33 return false;
34
35 shellComp.SetChargeRingConfig(configurationId);
36
37 return true;
38 }
39
40 //---------------------------------------------------------------------------------------------------------
42 override TStringArray GetVariablesIn() { return s_aVarsIn; }
43
44 override static string GetOnHoverDescription() { return "Configures artillery ammo entity. Now it only sets initial speed configuration."; }
45
46 override static bool VisibleInPalette() { return true; }
47}
proto bool GetVariableIn(string name, out void val)
bool ConfigureAmmoEntity(notnull IEntity ammoEntity, int configurationId)
static override string GetOnHoverDescription()
override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
ENodeResult
Definition ENodeResult.c:13
array< string > TStringArray
Definition Types.c:385