19 [
Attribute(
desc:
"Insert name of the task layer or leave empty for any task")];
20 protected string m_sTaskLayerName;
25 protected int m_iActionsInput;
31 SCR_GameModeSFManager gameModeComp = SCR_GameModeSFManager.Cast(
GetGame().
GetGameMode().FindComponent(SCR_GameModeSFManager));
35 gameModeComp.GetOnTaskStateChanged().Insert(
OnActivate);
43 if (task.GetTaskState() != m_eEventName || !
m_Input)
46 SCR_ScenarioFrameworkLayerTask taskLayer;
47 string sTaskLayerName =
"";
53 sTaskLayerName = taskLayer.GetOwner().GetName();
54 if (taskLayer.GetLayerTaskResolvedBeforeLoad())
59 if (m_sTaskLayerName.IsEmpty() || m_sTaskLayerName == sTaskLayerName)
68 SCR_ScenarioFrameworkSlotTask slotTask = taskLayer.GetSlotTask();
70 slotTask.OnTaskStateChanged(m_eEventName)
77 enum SCR_EScenarioFrameworkComparisonOperator
92 [
Attribute(
"0", UIWidgets.ComboBox,
"Operator",
"", ParamEnumArray.FromEnum(SCR_EScenarioFrameworkComparisonOperator))]
93 protected SCR_EScenarioFrameworkComparisonOperator m_eComparisonOperator;
107 SCR_ScenarioFrameworkParam<IEntity> entityWrapper = SCR_ScenarioFrameworkParam<IEntity>.Cast(m_Getter.Get());
110 PrintFormat(
"ScenarioFramework: Selected getter %1 is not suitable for this operation", m_Getter.ClassName(), LogLevel.ERROR);
114 IEntity entity = entityWrapper.GetValue();
117 PrintFormat(
"ScenarioFramework: Selected getter entity is null", m_Getter.ClassName(), LogLevel.ERROR);
131 GetGame().GetCallqueue().CallLater(RegisterOnChange, 5000);
136 void RegisterOnChange()
144 void OnActivate(SCR_ScenarioFrameworkParam<IEntity> param)
149 array<IEntity> aEntities = {};
150 int iNrOfEnts = m_Trigger.GetCountEntitiesInside();
153 ((m_eComparisonOperator == SCR_EScenarioFrameworkComparisonOperator.LESS_THAN) && (iNrOfEnts <
m_iValue)) ||
154 ((m_eComparisonOperator == SCR_EScenarioFrameworkComparisonOperator.LESS_OR_EQUAL) && (iNrOfEnts <=
m_iValue)) ||
155 ((m_eComparisonOperator == SCR_EScenarioFrameworkComparisonOperator.EQUAL) && (iNrOfEnts ==
m_iValue)) ||
156 ((m_eComparisonOperator == SCR_EScenarioFrameworkComparisonOperator.GREATER_OR_EQUAL) && (iNrOfEnts >=
m_iValue)) ||
157 ((m_eComparisonOperator == SCR_EScenarioFrameworkComparisonOperator.GREATER_THEN) && (iNrOfEnts >
m_iValue))
160 m_Input.OnActivate(
true, m_Trigger);
167 class SCR_ScenarioFrameworkActionInputCheckEntitiesInAreaTrigger : SCR_ScenarioFrameworkActionInputCheckEntitiesInTrigger
176 SCR_ScenarioFrameworkParam<IEntity> entityWrapper = SCR_ScenarioFrameworkParam<IEntity>.Cast(m_Getter.Get());
179 PrintFormat(
"ScenarioFramework: Selected getter %1 is not suitable for this operation", m_Getter.ClassName(), LogLevel.ERROR);
183 IEntity entity = entityWrapper.GetValue();
186 PrintFormat(
"ScenarioFramework: Selected getter entity is null", m_Getter.ClassName(), LogLevel.ERROR);
204 GetGame().GetCallqueue().CallLater(RegisterOnChange, 5000);