Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_Tutorial_SquadLeadership_END.c
Go to the documentation of this file.
1[EntityEditorProps(insertable: false)]
5
6//------------------------------------------------------------------------------------------------
8{
9 //------------------------------------------------------------------------------------------------
10 override protected void Setup()
11 {
12 SCR_HintManagerComponent.HideHint();
13 SCR_HintManagerComponent.ClearLatestHint();
14
15 SeparateAI();
16 //PlayNarrativeCharacterStage("SQUADLEADERSHIP_Instructor", 17);
18 }
19
20 //------------------------------------------------------------------------------------------------
21 protected void SeparateAI()
22 {
24 if (!playerController)
25 return;
26
27 SCR_PlayerControllerGroupComponent playerGroupComp = SCR_PlayerControllerGroupComponent.Cast(playerController.FindComponent(SCR_PlayerControllerGroupComponent));
28 if (!playerGroupComp)
29 return;
30
31 SCR_GroupsManagerComponent groupsManager = SCR_GroupsManagerComponent.GetInstance();
32 if (!groupsManager)
33 return;
34
35 SCR_AIGroup group = groupsManager.FindGroup(playerGroupComp.GetGroupID());
36 if (!group)
37 return;
38
39 array <AIAgent> agents = {};
40 group.GetSlave().GetAgents(agents);
41
42 if (!agents || agents.IsEmpty())
43 return;
44
45 SCR_AIGroup newGroup = SCR_AIGroup.Cast(GetGame().SpawnEntityPrefabEx("{000CD338713F2B5A}Prefabs/AI/Groups/Group_Base.et", 0));
46 if (!newGroup)
47 return;
48
49 newGroup.SetName("OldGroup");
50
51 foreach (AIAgent agent : agents)
52 {
53 newGroup.AddAgent(agent);
54 }
55
56 IEntity pos = GetGame().GetWorld().FindEntityByName("WP_SquadLeadership_DEFEND");
57 if (!pos)
58 return;
59
60 AIWaypoint wp = AIWaypoint.Cast(m_TutorialComponent.SpawnAsset("COMMANDING_DEFEND_OLD", "{93291E72AC23930F}Prefabs/AI/Waypoints/AIWaypoint_Defend.et", pos));
61 if (wp)
62 newGroup.AddWaypoint(wp);
63
64 }
65
66 //------------------------------------------------------------------------------------------------
67 override bool GetIsFinished()
68 {
69 return m_sLastFinishedEvent == "SOUND_TUTORIAL_TA_POSITION_DEFENDED_INSTRUCTOR_O_02" || GetDuration() > 15000;
70 }
71}
IEntity SpawnEntityPrefabEx(ResourceName prefab, bool randomizeEditableVariant, BaseWorld world=null, EntitySpawnParams params=null)
Definition game.c:90
ArmaReforgerScripted GetGame()
Definition game.c:1398
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
void IEntity(IEntitySource src, IEntity parent)
protected script Constructor
SCR_AIGroup GetSlave()
SCR_TutorialGamemodeComponent m_TutorialComponent
static SCR_VoiceoverSystem GetInstance()
void PlaySequence(string sequenceName, IEntity actor1=null, IEntity actor2=null, IEntity actor3=null, IEntity actor4=null, IEntity actor5=null, bool playImmediately=true)
Plays a sequence of voiceover lines defined in loaded config (see SetData).
proto external PlayerController GetPlayerController()