Arma Reforger Script API
|
Public Member Functions | |
int | GetTaskDeliverState () |
void | SetDeliveryTrigger () |
Sets delivery trigger by name if it exists in the world. | |
void | SetDeliveryTrigger (SCR_BaseTriggerEntity trigger) |
void | SetTriggerNameToDeliver (string triggerName) |
string | GetTriggerNameToDeliver () |
void | OnDeliveryTriggerActivated (notnull SCR_ScenarioFrameworkTriggerEntity trigger) |
void | OnObjectPossessed (IEntity item, BaseInventoryStorageComponent pStorageOwner) |
Updates task title and description if possessed item matches asset, sets delivery item found flag if not, and progresses state if. | |
void | OnObjectDropped (IEntity item, BaseInventoryStorageComponent pStorageOwner) |
Updates task state and title/description when an item is dropped into inventory. | |
void | UpdateTaskTitleAndDescription (int iPossessed=-1) |
Updates task title and description based on object state, triggers delivery, and sets task title and description for the support entity. | |
override void | UpdateMapTaskIcon () |
Updates map task icon visibility based on object state, sets opacity and visibility accordingly. | |
override bool | SetSupportEntity () |
Sets support entity for task delivery, returns true if found, logs error if not found. | |
override void | Init () |
Initializes inventory component, registers players, and sets event handlers for player spawning and disconnecting. | |
Public Member Functions inherited from SCR_ScenarioFrameworkTask | |
void | SetTaskState (SCR_TaskState state) |
void | SetLayerTask (SCR_ScenarioFrameworkLayerTask layer) |
SCR_ScenarioFrameworkLayerTask | GetLayerTask () |
override void | OnStateChanged (SCR_TaskState previousState, SCR_TaskState newState) |
An event called when the state of this task has been changed. | |
override void | Finish (bool showMsg=true) |
Finishes mission based on player's faction, shows message if player's faction matches target faction. | |
void | SetTaskAsset (IEntity object) |
void | RehookTaskAsset (IEntity object) |
Updates linked entity for this task. | |
IEntity | GetAsset () |
void | SetSlotTask (SCR_ScenarioFrameworkSlotTask slotTask) |
SCR_ScenarioFrameworkSlotTask | GetSlotTask () |
SCR_ScenarioFrameworkTaskSupportEntity | GetSupportEntity () |
void | SetTaskExecutionBriefing (string text) |
string | GetTaskExecutionBriefing () |
void | SetSpawnedEntityName (string name) |
string | GetSpawnedEntityName () |
override string | GetTaskListTaskText () |
override void | Serialize (ScriptBitWriter writer) |
Serializes task execution briefing and spawned entity name. | |
override void | Deserialize (ScriptBitReader reader) |
Deserializes task execution briefing and spawned entity name from ScriptBitReader. | |
void | Init () |
Initializes support entity, sets task entity, updates blacklist if necessary. | |
override void | EOnInit (IEntity owner) |
Initializes task manager if it exists, otherwise returns without action. | |
Public Member Functions inherited from SCR_BaseTask | |
void | OnDelete () |
bool | NotifyAssignment () |
bool | NotifyUnassign () |
void | DoNotifyAssignment (int assigneeID) |
void | DoNotifyUnassign (int assigneeID) |
SCR_ERadioMsg | GetAssignMessage () |
SCR_ERadioMsg | GetUnassignMessage () |
ResourceName | GetMapUIElementResourceName () |
string | GetMapDescriptorText () |
void | OnMapOpen (MapConfiguration config) |
void | OnHoverItem (MapItem item) |
string | GetFullTaskIconName () |
string | GetTaskMapIconName () |
string | GetTaskListIconNamePrefix () |
string | GetTaskListIconName () |
string | GetTaskListTaskTitle () |
string | GetMajorModifier () |
string | GetTaskListTaskText () |
Widget | GetParentWidget (notnull Widget rootWidget) |
ResourceName | GetIconImageset () |
void | SetHUDIcon () |
void | SetWidgetIcon (ImageWidget image) |
void | ClearWidgetIcon () |
Remove icon assigned to this task. | |
void | UpdateMapTaskIcon () |
void | UpdatePriorityMapTaskIcon () |
bool | AssignTaskToAI (AIAgent agent) |
string | GetIconName () |
ResourceName | GetImageSetName () |
string | GetIconSuffix () |
string | GetTitleIconString () |
void | SetTitleWidgetText (notnull TextWidget textWidget, string taskText) |
string | GetTitleText () |
void | SetDescriptionWidgetText (notnull TextWidget textWidget, string taskText) |
Widget | GenerateTaskDescriptionUI (notnull Widget rootWidget, array< Widget > widgets) |
void | UpdateTaskListAssignee () |
void | OnAssigneeKilled () |
void | CreateMapUIIcon () |
Faction | GetTargetFaction () |
Returns the faction that should complete this task. | |
void | SetTargetFaction (Faction targetFaction) |
Sets the faction that should complete this task. | |
string | GetFinishText () |
Returns a text informing about the task being finished. | |
bool | IsAssigned () |
Returns whether the task is assigned to someone or not. | |
string | GetAllAssigneeNamesString () |
Returns a string with all the assignees on this task in following format: "PlayerA, PlayerB, ..., PlayerN". | |
void | CheckAssigneeTimeout () |
Checks all the assignees for timeout, if their time is up, they get unassigned. | |
void | SetLastAssigneeAddedTimestamp (float timestamp) |
void | SetIndividual (bool individual) |
Set this task as task for an individual. | |
bool | IsIndividual () |
Returns whether this task is for an individual or not. | |
void | SetIsPriority (bool isPrio) |
bool | IsPriority () |
bool | IsAssignable () |
bool | CanBeAssigned (out SCR_ECannotAssignReasons reason, int playerID=-1) |
Returns whether this task can be assigned to the player with the given player ID If playerID == -1, the local player is used as the target. | |
float | GetLastAssigneeAddedTimestamp () |
Returns the timestamp of last add assignee event. | |
float | GetAssigneeTimeLeft () |
Returns time left the assignee of this task has to finish it, after that they get automatically unassigned. | |
void | SetTaskID (int taskID) |
Sets an ID of this task. | |
int | GetTaskID () |
Returns an ID of this task. | |
SCR_TaskState | GetTaskState () |
Returns the state of this task. | |
void | SetTitle (string title) |
string | GetTitle () |
Return the title of this task. | |
void | SetDescription (string description) |
string | GetDescription () |
Return the description of this task. | |
SCR_BaseTaskExecutor | GetAssignee () |
Returns the first assignee of this task. | |
int | GetAssignees (out array< SCR_BaseTaskExecutor > assignees) |
Returns assignees of this task. | |
int | GetAssigneeCount () |
void | Cancel (bool showMsg=true) |
void | Remove () |
Marks the task as removed. | |
void | Create (bool showMsg=true) |
When the task is created. | |
void | Finish (bool showMsg=true) |
Marks the task as finished. | |
void | Fail (bool showMsg=true) |
Fails the task. | |
void | RemoveAllAssignees () |
Removes every assignee from this task. | |
void | RemoveAssignee (SCR_BaseTaskExecutor assignee, SCR_EUnassignReason reason) |
Removes an assignee, specified as a parameter, from this task. | |
void | AddAssignee (SCR_BaseTaskExecutor assignee, float timestamp) |
Adds a new assignee, specified as a parameter, to this task. | |
void | InitOnSpawn (int pid, IEntity ent) |
void | ToggleHUDIcon (bool show, bool fade=true) |
void | UpdateHUDIcon () |
Widget | GetTaskIconkWidget () |
void | SetTaskIconWidget (Widget w) |
void | SetState (SCR_TaskState state) |
Changes the state of this task to the parameter. | |
void | RegisterTaskUpdate (SCR_ETaskEventMask TaskEventMask) |
Registers task event mask for OnTaskUpdate. | |
void | Serialize (ScriptBitWriter writer) |
void | Deserialize (ScriptBitReader reader) |
override void | EOnInit (IEntity owner) |
void | SCR_BaseTask (IEntitySource src, IEntity parent) |
void | ~SCR_BaseTask () |
Public Attributes | |
SCR_EScenarioFrameworkItemGCState | m_eGarbageCollectionStatus = SCR_EScenarioFrameworkItemGCState.UNDEFINED |
Public Attributes inherited from SCR_ScenarioFrameworkTask | |
string | m_sTaskIntroVoiceline |
Protected Member Functions | |
void | UpdateDroppedTaskMarker () |
Updates dropped task marker position, checks if it's a deliver task, schedules marker position update if it is. | |
void | MoveTaskMarkerPosition () |
Updates task position, moves marker if asset exists, logs error if asset not assigned. | |
void | OnItemCarrierChanged (InventoryStorageSlot oldSlot, InventoryStorageSlot newSlot) |
Handles item carrier changes, removes/adds event handlers, and updates garbage collection status. | |
void | HandleNewSlotGC (IEntity entity) |
Handles the cases where GarbageSystem might delete new slot entity. | |
void | HandleOldSlotGC (IEntity entity) |
Handles possible revert of case prevention where GarbageSystem might delete root entity. | |
void | OnDestroyed (IEntity destroyedEntity) |
Used to remove task item from destroyed entity inventory and drop it to the ground. | |
void | OnDisconnected (int iPlayerID) |
void | RegisterPlayer (int iPlayerID, IEntity playerEntity) |
Registers player with inventory and event handlers. | |
void | InvokedSetDeliveryTrigger () |
Sets delivery trigger for an event. | |
bool | SetSupportEntity () |
Sets support entity for task. | |
Protected Member Functions inherited from SCR_BaseTask | |
void | ShowPopUpNotification (string subtitle) |
void | UpdateMapInfo () |
bool | DoneByAssignee () |
void | ShowTaskProgress (bool showMsg=true) |
void | ShowAvailableTask (bool afterAssigneeRemoved=false) |
Shows a message informing about this task being available. | |
bool | IsAssignedToLocalPlayer () |
Returns whether this task is assigned to the local player. | |
void | OnAssigneeRemoved (SCR_BaseTaskExecutor oldAssignee) |
An event called when an assignee has been removed from this task. | |
void | OnAssigneeAdded (SCR_BaseTaskExecutor newAssignee) |
An event called when a new assignee has been added to this task. | |
void | OnStateChanged (SCR_TaskState previousState, SCR_TaskState newState) |
An event called when the state of this task has been changed. | |
Additional Inherited Members | |
Static Public Attributes inherited from SCR_BaseTask | |
static const string | TASK_AMOUNT_COMPLETED_TEXT = "#AR-Tasks_AmountCompleted" |
static const string | TASK_PROGRESS_TEXT = "#AR-Tasks_StatusProgress-UC" |
static const string | TASK_FINISHED_TEXT = "#AR-Tasks_StatusFinished-UC" |
static const string | TASK_AVAILABLE_TEXT = "#AR-Tasks_StatusNew-UC" |
static const string | TASK_HINT_TEXT = "#AR-Tasks_Hint" |
static const string | TASK_CANCELLED_TEXT = "#AR-Tasks_StatusCancelled-UC" |
static const string | TASK_COMPLETED_TEXT = "#AR-Tasks_StatusCompleted-UC" |
static const string | TASK_FAILED_TEXT = "#AR-Tasks_StatusFailed-UC" |
static const float | DEFAULT_ASSIGNEE_TIME_LIMIT = 1800 |
static const float | DEFAULT_ASSIGNEE_TIMEOUT_TIME = 60 |
static const int | INVALID_TIMESTAMP = -1 |
static const int | INVALID_TASK_ID = -1 |
static int | s_iCurrentTaskID = 0 |
const string | TASK_BG_M = "Icon_M_Task_BG" |
const string | TASK_O_M = "Icon_M_Task_Outline" |
const string | TASK_BG = "Icon_Task_BG" |
const string | TASK_O = "Icon_Task_Outline" |
const string | TASK_H = "Icon_M_Task_Hover" |
const string | Task_S = "TaskIconSymbol" |
Static Protected Attributes inherited from SCR_BaseTask | |
static const float | PLATFORM_ICON_SIZE = 2 |
int SCR_TaskDeliver.GetTaskDeliverState | ( | ) |
string SCR_TaskDeliver.GetTriggerNameToDeliver | ( | ) |
|
protected |
Handles the cases where GarbageSystem might delete new slot entity.
|
protected |
Handles possible revert of case prevention where GarbageSystem might delete root entity.
override void SCR_TaskDeliver.Init | ( | ) |
Initializes inventory component, registers players, and sets event handlers for player spawning and disconnecting.
Implements SCR_ScenarioFrameworkTask.
|
protected |
Sets delivery trigger for an event.
|
protected |
Updates task position, moves marker if asset exists, logs error if asset not assigned.
void SCR_TaskDeliver.OnDeliveryTriggerActivated | ( | notnull SCR_ScenarioFrameworkTriggerEntity | trigger | ) |
[in] | trigger | Trigger activates when entities enter its area, checks if asset is inside, finishes task if found, else checks ch |
|
protected |
Used to remove task item from destroyed entity inventory and drop it to the ground.
|
protected |
[in] | iPlayerID | iPlayerID represents the unique identifier for the player being disconnected from the server. |
|
protected |
Handles item carrier changes, removes/adds event handlers, and updates garbage collection status.
[in] | oldSlot | Represents the previous inventory storage slot of an item before it was moved or changed. |
[in] | newSlot | New slot represents the new location where an item is moved in the inventory system. |
void SCR_TaskDeliver.OnObjectDropped | ( | IEntity | item, |
BaseInventoryStorageComponent | pStorageOwner | ||
) |
Updates task state and title/description when an item is dropped into inventory.
[in] | item | Item dropped event, checks if dropped item matches assigned asset, updates task state if match found. |
[in] | pStorageOwner | Represents inventory storage component of an entity in the method. |
void SCR_TaskDeliver.OnObjectPossessed | ( | IEntity | item, |
BaseInventoryStorageComponent | pStorageOwner | ||
) |
Updates task title and description if possessed item matches asset, sets delivery item found flag if not, and progresses state if.
[in] | item | Checks if possessed item matches task asset, updates title and description if so, sets state to PROGRESSED if delivery |
[in] | pStorageOwner | Represents inventory storage component for item possession tracking. |
|
protected |
Registers player with inventory and event handlers.
[in] | iPlayerID | Player ID representing the controlled entity in the game. |
[in] | playerEntity | Player entity represents an in-game player controlled by a human player. |
void SCR_TaskDeliver.SetDeliveryTrigger | ( | ) |
Sets delivery trigger by name if it exists in the world.
void SCR_TaskDeliver.SetDeliveryTrigger | ( | SCR_BaseTriggerEntity | trigger | ) |
[in] | trigger | Trigger entity for delivery activation. |
override bool SCR_TaskDeliver.SetSupportEntity | ( | ) |
Sets support entity for task delivery, returns true if found, logs error if not found.
Implements SCR_ScenarioFrameworkTask.
void SCR_TaskDeliver.SetTriggerNameToDeliver | ( | string | triggerName | ) |
[in] | triggerName | Represents the name of the trigger for delivering an object in the scenario. |
|
protected |
Updates dropped task marker position, checks if it's a deliver task, schedules marker position update if it is.
override void SCR_TaskDeliver.UpdateMapTaskIcon | ( | ) |
Updates map task icon visibility based on object state, sets opacity and visibility accordingly.
Implements SCR_BaseTask.
void SCR_TaskDeliver.UpdateTaskTitleAndDescription | ( | int | iPossessed = -1 | ) |
Updates task title and description based on object state, triggers delivery, and sets task title and description for the support entity.
[in] | iPossessed | iPossessed represents the possession state of the task, either 0 (not possessed) or 1 (possessed |
|
protected |
|
protected |
SCR_EScenarioFrameworkItemGCState SCR_TaskDeliver.m_eGarbageCollectionStatus = SCR_EScenarioFrameworkItemGCState.UNDEFINED |
|
protected |
|
protected |
|
protected |