Compare commits

...

2 Commits

Author SHA1 Message Date
Jacob Schmidt
39c8648bd6 Merge branch 'master' of https://gitea.innovativedevsolutions.org/IDSolutions/client
All checks were successful
Build / Build (push) Successful in 53s
2025-01-05 17:00:09 -06:00
Jacob Schmidt
db9a0b8fd8 Added Editor Task Modules 2025-01-05 17:00:03 -06:00
27 changed files with 1225 additions and 382 deletions

View File

@ -0,0 +1,6 @@
class CfgFactionClasses {
class NO_CATEGORY;
class FORGE_Modules: NO_CATEGORY {
displayName = "FORGE";
};
};

791
addons/task/CfgVehicles.hpp Normal file
View File

@ -0,0 +1,791 @@
class CfgVehicles {
class Logic;
class Module_F: Logic {
class AttributesBase {
class Default;
class Edit;
class Combo;
class Checkbox;
class CheckboxNumber;
class NumberState;
class ModuleDescription;
class Units;
};
class ModuleDescription {
class AnyBrain;
class Anything;
};
};
class FORGE_Module_Attack: Module_F {
scope = 2;
displayName = "Attack Task";
// icon = "\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\default_ca.paa";
category = "FORGE_Modules";
function = QFUNC(attackModule);
functionPriority = 1;
isGlobal = 1;
isTriggerActivated = 1;
isDisposable = 1;
is3DEN = 0;
canSetArea = 0;
canSetAreaShape = 0;
canSetAreaHeight = 0;
class AttributeValues {};
class Attributes: AttributesBase {
class TaskID: Edit {
property = "FORGE_Module_Attack_TaskID";
displayName = "Task ID";
tooltip = "Unique identifier for this task";
typeName = "STRING";
// defaultValue = """";
};
class LimitFail: Edit {
property = "FORGE_Module_Attack_LimitFail";
displayName = "Fail Limit";
tooltip = "Number of targets that escape to fail the task";
typeName = "NUMBER";
defaultValue = -1;
};
class LimitSuccess: Edit {
property = "FORGE_Module_Attack_LimitSuccess";
displayName = "Success Limit";
tooltip = "Number of targets that need to be eliminated to succeed the task";
typeName = "NUMBER";
defaultValue = -1;
};
class CompanyFunds: Edit {
property = "FORGE_Module_Attack_CompanyFunds";
displayName = "Reward Funds";
tooltip = "Amount of funds awarded on success";
typeName = "NUMBER";
defaultValue = 0;
};
class RatingFail: Edit {
property = "FORGE_Module_Attack_RatingFail";
displayName = "Rating Loss";
tooltip = "Amount of rating lost on failure";
typeName = "NUMBER";
defaultValue = 0;
};
class RatingSuccess: Edit {
property = "FORGE_Module_Attack_RatingSuccess";
displayName = "Rating Gain";
tooltip = "Amount of rating gained on success";
typeName = "NUMBER";
defaultValue = 0;
};
class EndSuccess: Combo {
property = "FORGE_Module_Attack_EndSuccess";
displayName = "End on Success";
tooltip = "End mission when task is completed successfully";
typeName = "BOOL";
defaultValue = 0;
class Values {
class EnableEndSuccess { name = "Enable"; value = 1; };
class DisableEndSuccess { name = "Disable"; value = 0; };
};
};
class EndFail: Combo {
property = "FORGE_Module_Attack_EndFail";
displayName = "End on Failure";
tooltip = "End mission when task fails";
typeName = "BOOL";
defaultValue = 0;
class Values {
class EnableEndFail { name = "Enable"; value = 1; };
class DisableEndFail { name = "Disable"; value = 0; };
};
};
class TimeLimit: Edit {
property = "FORGE_Module_Attack_TimeLimit";
displayName = "Time Limit";
tooltip = "Time in seconds before targets escape (0 for no limit)";
typeName = "NUMBER";
defaultValue = 0;
};
};
class ModuleDescription: ModuleDescription {
description = "Creates an attack task with configurable parameters";
sync[] = { "Anything" };
class Anything {
description[] = {
"Attack task module",
"Sync with units/vehicles to mark as targets"
};
position = 1;
direction = 1;
optional = 1;
duplicate = 1;
};
};
};
class FORGE_Module_Explosives: Module_F {
scope = 2;
displayName = "Explosive Entities";
// icon = "\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\default_ca.paa";
category = "FORGE_Modules";
function = QFUNC(explosivesModule);
functionPriority = 1;
isGlobal = 1;
isTriggerActivated = 0;
isDisposable = 1;
is3DEN = 0;
canSetArea = 0;
canSetAreaShape = 0;
canSetAreaHeight = 0;
class AttributeValues {};
class Attributes: AttributesBase {};
class ModuleDescription: ModuleDescription {
description = "Module for explosive entities that need to be defused";
sync[] = { "Anything" };
class Anything {
description[] = {
"Explosive entities module",
"Sync with objects to mark as explosives",
"Those objects will be processed as defusal targets"
};
position = 1;
direction = 1;
optional = 1;
duplicate = 1;
};
};
};
class FORGE_Module_Hostages: Module_F {
scope = 2;
displayName = "Hostage Entities";
// icon = "\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\default_ca.paa";
category = "FORGE_Modules";
function = QFUNC(hostagesModule);
functionPriority = 1;
isGlobal = 1;
isTriggerActivated = 0;
isDisposable = 1;
is3DEN = 0;
canSetArea = 0;
canSetAreaShape = 0;
canSetAreaHeight = 0;
class AttributeValues {};
class Attributes: AttributesBase {};
class ModuleDescription: ModuleDescription {
description = "Module for hostage entities that need to be rescued";
sync[] = { "Anything" };
class Anything {
description[] = {
"Hostage entities module",
"Sync with units to mark as hostages",
"Those objects will be processed as rescue targets"
};
position = 1;
direction = 1;
optional = 1;
duplicate = 1;
};
};
};
class FORGE_Module_Shooters: Module_F {
scope = 2;
displayName = "Shooter Entities";
// icon = "\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\default_ca.paa";
category = "FORGE_Modules";
function = QFUNC(shootersModule);
functionPriority = 1;
isGlobal = 1;
isTriggerActivated = 0;
isDisposable = 1;
is3DEN = 0;
canSetArea = 0;
canSetAreaShape = 0;
canSetAreaHeight = 0;
class AttributeValues {};
class Attributes: AttributesBase {};
class ModuleDescription: ModuleDescription {
description = "Module for shooter entities that need to be eliminated";
sync[] = { "AnyBrain" };
class AnyBrain {
description[] = {
"Shooter entities module",
"Sync with units to mark as shooters",
"Those objects will be processed as elimination targets"
};
position = 1;
direction = 1;
optional = 1;
duplicate = 1;
};
};
};
class FORGE_Module_Protected: Module_F {
scope = 2;
displayName = "Protected Entities";
// icon = "\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\default_ca.paa";
category = "FORGE_Modules";
function = QFUNC(protectedModule);
functionPriority = 1;
isGlobal = 1;
isTriggerActivated = 0;
isDisposable = 1;
is3DEN = 0;
canSetArea = 0;
canSetAreaShape = 0;
canSetAreaHeight = 0;
class AttributeValues {};
class Attributes: AttributesBase {};
class ModuleDescription: ModuleDescription {
description = "Module for protected entities that need to be protected";
sync[] = { "Anything" };
class Anything {
description[] = {
"Protected entities module",
"Sync with objects to mark as protected entities",
"Those objects will be processed as protected targets"
};
position = 1;
direction = 1;
optional = 1;
duplicate = 1;
};
};
};
class FORGE_Module_Defuse: Module_F {
scope = 2;
displayName = "Defuse Task";
// icon = "\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\default_ca.paa";
category = "FORGE_Modules";
function = QFUNC(defuseModule);
functionPriority = 1;
isGlobal = 1;
isTriggerActivated = 1;
isDisposable = 1;
is3DEN = 0;
canSetArea = 0;
canSetAreaShape = 0;
canSetAreaHeight = 0;
class AttributeValues {};
class Attributes: AttributesBase {
class TaskID: Edit {
property = "FORGE_Module_Defuse_TaskID";
displayName = "Task ID";
tooltip = "Unique identifier for this task";
typeName = "STRING";
// defaultValue = """";
};
class LimitFail: Edit {
property = "FORGE_Module_Defuse_LimitFail";
displayName = "Fail Limit";
tooltip = "Number of protected entities destroyed to fail the task";
typeName = "NUMBER";
defaultValue = -1;
};
class LimitSuccess: Edit {
property = "FORGE_Module_Defuse_LimitSuccess";
displayName = "Success Limit";
tooltip = "Number of entities that need to be defused to complete the task";
typeName = "NUMBER";
defaultValue = -1;
};
class CompanyFunds: Edit {
property = "FORGE_Module_Defuse_CompanyFunds";
displayName = "Reward Funds";
tooltip = "Amount of funds awarded on success";
typeName = "NUMBER";
defaultValue = 0;
};
class RatingFail: Edit {
property = "FORGE_Module_Defuse_RatingFail";
displayName = "Rating Loss";
tooltip = "Amount of rating lost on failure";
typeName = "NUMBER";
defaultValue = 0;
};
class RatingSuccess: Edit {
property = "FORGE_Module_Defuse_RatingSuccess";
displayName = "Rating Gain";
tooltip = "Amount of rating gained on success";
typeName = "NUMBER";
defaultValue = 0;
};
class EndSuccess: Combo {
property = "FORGE_Module_Defuse_EndSuccess";
displayName = "End on Success";
tooltip = "End mission when task is completed successfully";
typeName = "BOOL";
defaultValue = 0;
class Values {
class EnableEndSuccess { name = "Enable"; value = 1; };
class DisableEnSuccess { name = "Disable"; value = 0; };
};
};
class EndFail: Combo {
property = "FORGE_Module_Defuse_EndFail";
displayName = "End on Failure";
tooltip = "End mission when task fails";
typeName = "BOOL";
defaultValue = 0;
class Values {
class EnableEndFail { name = "Enable"; value = 1; };
class DisableEndFail { name = "Disable"; value = 0; };
};
};
class TimeLimit: Edit {
property = "FORGE_Module_Defuse_TimeLimit";
displayName = "Time Limit";
tooltip = "Time in seconds before detenation (0 for no limit)";
typeName = "NUMBER";
defaultValue = 0;
};
};
class ModuleDescription: ModuleDescription {
description = "Creates a defuse task with configurable parameters";
sync[] = { "Anything" };
class Anything {
description[] = {
"Defuse task module",
"Sync with entities to mark as explosives and protected entities",
};
position = 1;
direction = 1;
optional = 1;
duplicate = 1;
};
};
};
class FORGE_Module_Destroy: Module_F {
scope = 2;
displayName = "Destroy Task";
// icon = "\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\default_ca.paa";
category = "FORGE_Modules";
function = QFUNC(destroyModule);
functionPriority = 1;
isGlobal = 1;
isTriggerActivated = 1;
isDisposable = 1;
is3DEN = 0;
canSetArea = 0;
canSetAreaShape = 0;
canSetAreaHeight = 0;
class AttributeValues {};
class Attributes: AttributesBase {
class TaskID: Edit {
property = "FORGE_Module_Destroy_TaskID";
displayName = "Task ID";
tooltip = "Unique identifier for this task";
typeName = "STRING";
// defaultValue = """";
};
class LimitFail: Edit {
property = "FORGE_Module_Destroy_LimitFail";
displayName = "Fail Limit";
tooltip = "Number of targets that can escape before failing";
typeName = "NUMBER";
defaultValue = -1;
};
class LimitSuccess: Edit {
property = "FORGE_Module_Destroy_LimitSuccess";
displayName = "Success Limit";
tooltip = "Number of targets that need to be destroyed";
typeName = "NUMBER";
defaultValue = -1;
};
class CompanyFunds: Edit {
property = "FORGE_Module_Destroy_CompanyFunds";
displayName = "Reward Funds";
tooltip = "Amount of funds awarded on success";
typeName = "NUMBER";
defaultValue = 0;
};
class RatingFail: Edit {
property = "FORGE_Module_Destroy_RatingFail";
displayName = "Rating Loss";
tooltip = "Amount of rating lost on failure";
typeName = "NUMBER";
defaultValue = 0;
};
class RatingSuccess: Edit {
property = "FORGE_Module_Destroy_RatingSuccess";
displayName = "Rating Gain";
tooltip = "Amount of rating gained on success";
typeName = "NUMBER";
defaultValue = 0;
};
class EndSuccess: Combo {
property = "FORGE_Module_Destroy_EndSuccess";
displayName = "End on Success";
tooltip = "End mission when task is completed successfully";
typeName = "BOOL";
defaultValue = 0;
class Values {
class EnableEndSuccess { name = "Enable"; value = 1; };
class DisableEndSuccess { name = "Disable"; value = 0; };
};
};
class EndFail: Combo {
property = "FORGE_Module_Destroy_EndFail";
displayName = "End on Failure";
tooltip = "End mission when task fails";
typeName = "BOOL";
defaultValue = 0;
class Values {
class EnableEndFail { name = "Enable"; value = 1; };
class DisableEndFail { name = "Disable"; value = 0; };
};
};
class TimeLimit: Edit {
property = "FORGE_Module_Destroy_TimeLimit";
displayName = "Time Limit";
tooltip = "Time in seconds before targets escape (0 for no limit)";
typeName = "NUMBER";
defaultValue = 0;
};
};
class ModuleDescription: ModuleDescription {
description = "Creates a destroy task with configurable parameters";
sync[] = { "Anything" };
class Anything {
description[] = {
"Destroy task module",
"Sync with units and/or vehicles to mark as targets"
};
position = 1;
direction = 1;
optional = 1;
duplicate = 1;
};
};
};
class FORGE_Module_Hostage: Module_F {
scope = 2;
displayName = "Hostage Task";
// icon = "\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\default_ca.paa";
category = "FORGE_Modules";
function = QFUNC(hostageModule);
functionPriority = 1;
isGlobal = 1;
isTriggerActivated = 1;
isDisposable = 1;
is3DEN = 0;
canSetArea = 0;
canSetAreaShape = 0;
canSetAreaHeight = 0;
class AttributeValues {};
class Attributes: AttributesBase {
class TaskID: Edit {
property = "FORGE_Module_Hostage_TaskID";
displayName = "Task ID";
tooltip = "Unique identifier for this task";
typeName = "STRING";
// defaultValue = """";
};
class LimitFail: Edit {
property = "FORGE_Module_Hostage_LimitFail";
displayName = "Fail Limit";
tooltip = "Number of hostages KIA before failing";
typeName = "NUMBER";
defaultValue = -1;
};
class LimitSuccess: Edit {
property = "FORGE_Module_Hostage_LimitSuccess";
displayName = "Success Limit";
tooltip = "Number of hostages rescued before succeeding";
typeName = "NUMBER";
defaultValue = -1;
};
class ExtZone: Edit {
property = "FORGE_Module_Hostage_ExtZone";
displayName = "Extraction Zone";
tooltip = "Unique marker name for the extraction zone";
typeName = "STRING";
// defaultValue = """";
};
class CompanyFunds: Edit {
property = "FORGE_Module_Hostage_CompanyFunds";
displayName = "Reward Funds";
tooltip = "Amount of funds awarded on success";
typeName = "NUMBER";
defaultValue = 0;
};
class RatingFail: Edit {
property = "FORGE_Module_Hostage_RatingFail";
displayName = "Rating Loss";
tooltip = "Amount of rating lost on failure";
typeName = "NUMBER";
defaultValue = 0;
};
class RatingSuccess: Edit {
property = "FORGE_Module_Hostage_RatingSuccess";
displayName = "Rating Gain";
tooltip = "Amount of rating gained on success";
typeName = "NUMBER";
defaultValue = 0;
};
class CBRN: Combo {
property = "FORGE_Module_Hostage_CBRN";
displayName = "CBRN Attack";
tooltip = "CBRN Attack instead of execution";
typeName = "BOOL";
defaultValue = 0;
class Values {
class TrueCBRN { name = "True"; value = 1; };
class FalseCBRN { name = "False"; value = 0; };
};
};
class Execution: Combo {
property = "FORGE_Module_Hostage_Execution";
displayName = "Execution";
tooltip = "Execution instead of CBRN Attack";
typeName = "BOOL";
defaultValue = 0;
class Values {
class TrueExecution { name = "True"; value = 1; };
class FalseExecution { name = "False"; value = 0; };
};
};
class EndSuccess: Combo {
property = "FORGE_Module_Hostage_EndSuccess";
displayName = "End on Success";
tooltip = "End mission when task is completed successfully";
typeName = "BOOL";
defaultValue = 0;
class Values {
class EnableEndSuccess { name = "Enable"; value = 1; };
class DisableEndSuccess { name = "Disable"; value = 0; };
};
};
class EndFail: Combo {
property = "FORGE_Module_Hostage_EndFail";
displayName = "End on Failure";
tooltip = "End mission when task fails";
typeName = "BOOL";
defaultValue = 0;
class Values {
class EnableEndFail { name = "Enable"; value = 1; };
class DisableEndFail { name = "Disable"; value = 0; };
};
};
class TimeLimit: Edit {
property = "FORGE_Module_Hostage_TimeLimit";
displayName = "Time Limit";
tooltip = "Time in seconds before HVTs escape (0 for no limit)";
typeName = "NUMBER";
defaultValue = 0;
};
class CBRNZone: Edit {
property = "FORGE_Module_Hostage_CBRNZone";
displayName = "CBRN Zone";
tooltip = "Unique marker name for the CBRN zone";
typeName = "STRING";
// defaultValue = """";
};
};
class ModuleDescription: ModuleDescription {
description = "Creates a Hostage task with configurable parameters";
sync[] = { "Anything" };
class Anything {
description[] = {
"Hostage task module",
"Sync with hostage and shooter module to register the entities to the task"
};
position = 1;
direction = 1;
optional = 1;
duplicate = 1;
};
};
};
class FORGE_Module_HVT: Module_F {
scope = 2;
displayName = "HVT Task";
// icon = "\a3\ui_f\data\IGUI\Cfg\simpleTasks\types\default_ca.paa";
category = "FORGE_Modules";
function = QFUNC(hvtModule);
functionPriority = 1;
isGlobal = 1;
isTriggerActivated = 1;
isDisposable = 1;
is3DEN = 0;
canSetArea = 0;
canSetAreaShape = 0;
canSetAreaHeight = 0;
class AttributeValues {};
class Attributes: AttributesBase {
class TaskID: Edit {
property = "FORGE_Module_HVT_TaskID";
displayName = "Task ID";
tooltip = "Unique identifier for this task";
typeName = "STRING";
// defaultValue = """";
};
class LimitFail: Edit {
property = "FORGE_Module_HVT_LimitFail";
displayName = "Fail Limit";
tooltip = "Number of hvts that can escape or KIA before failing";
typeName = "NUMBER";
defaultValue = -1;
};
class LimitSuccess: Edit {
property = "FORGE_Module_HVT_LimitSuccess";
displayName = "Success Limit";
tooltip = "Number of hvts that need to be captured or KIA";
typeName = "NUMBER";
defaultValue = -1;
};
class ExtZone: Edit {
property = "FORGE_Module_HVT_ExtZone";
displayName = "Extraction Zone";
tooltip = "Unique marker name for the extraction zone";
typeName = "STRING";
// defaultValue = """";
};
class CompanyFunds: Edit {
property = "FORGE_Module_HVT_CompanyFunds";
displayName = "Reward Funds";
tooltip = "Amount of funds awarded on success";
typeName = "NUMBER";
defaultValue = 0;
};
class RatingFail: Edit {
property = "FORGE_Module_HVT_RatingFail";
displayName = "Rating Loss";
tooltip = "Amount of rating lost on failure";
typeName = "NUMBER";
defaultValue = 0;
};
class RatingSuccess: Edit {
property = "FORGE_Module_HVT_RatingSuccess";
displayName = "Rating Gain";
tooltip = "Amount of rating gained on success";
typeName = "NUMBER";
defaultValue = 0;
};
class CaptureHVT: Combo {
property = "FORGE_Module_HVT_CaptureHVT";
displayName = "Capture HVT";
tooltip = "Capture HVT instead of eliminating";
typeName = "BOOL";
defaultValue = 1;
class Values {
class TrueCapture { name = "True"; value = 1; };
class FalseCapture { name = "False"; value = 0; };
};
};
class EliminateHVT: Combo {
property = "FORGE_Module_HVT_EliminateHVT";
displayName = "Eliminate HVT";
tooltip = "Eliminate HVT instead of capturing";
typeName = "BOOL";
defaultValue = 0;
class Values {
class TrueEliminate { name = "True"; value = 1; };
class FalseEliminate { name = "False"; value = 0; };
};
};
class EndSuccess: Combo {
property = "FORGE_Module_HVT_EndSuccess";
displayName = "End on Success";
tooltip = "End mission when task is completed successfully";
typeName = "BOOL";
defaultValue = 0;
class Values {
class EnableEndSuccess { name = "Enable"; value = 1; };
class DisableEndSuccess { name = "Disable"; value = 0; };
};
};
class EndFail: Combo {
property = "FORGE_Module_HVT_EndFail";
displayName = "End on Failure";
tooltip = "End mission when task fails";
typeName = "BOOL";
defaultValue = 0;
class Values {
class EnableEndFail { name = "Enable"; value = 1; };
class DisableEndFail { name = "Disable"; value = 0; };
};
};
class TimeLimit: Edit {
property = "FORGE_Module_HVT_TimeLimit";
displayName = "Time Limit";
tooltip = "Time in seconds before HVTs escape (0 for no limit)";
typeName = "NUMBER";
defaultValue = 0;
};
};
class ModuleDescription: ModuleDescription {
description = "Creates a HVT task with configurable parameters";
sync[] = { "Anything" };
class Anything {
description[] = {
"HVT task module",
"Sync with units to mark as HVTs"
};
position = 1;
direction = 1;
optional = 1;
duplicate = 1;
};
};
};
};

View File

@ -1,12 +1,22 @@
PREP(attack);
PREP(attackModule);
PREP(defuse);
PREP(defuseModule);
PREP(destroy);
PREP(destroyModule);
PREP(explosivesModule);
PREP(handler);
PREP(heartBeat);
PREP(hostage);
PREP(hostageModule);
PREP(hostagesModule);
PREP(hvt);
PREP(hvtModule);
PREP(makeHostage);
PREP(makeHVT);
PREP(makeIED);
PREP(makeObject);
PREP(makeTarget);
PREP(makeShooter);
PREP(makeTarget);
PREP(protectedModule);
PREP(shootersModule);

View File

@ -1,5 +1,7 @@
#include "script_component.hpp"
GVAR(defusedCount) = 0;
["ace_explosives_defuse", {
GVAR(defusedCount) = GVAR(defusedCount) + 1;
}] call CFUNC(addEventHandler);

View File

@ -13,4 +13,6 @@ class CfgPatches {
};
};
#include "CfgEventHandlers.hpp"
#include "CfgEventHandlers.hpp"
#include "CfgFactionClasses.hpp"
#include "CfgVehicles.hpp"

View File

@ -8,11 +8,11 @@
* 0: ID of the task <STRING>
* 1: Amount of targets escaped to fail the task <NUMBER>
* 2: Amount of targets eliminated to complete the task <NUMBER>
* 3: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
* 4: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
* 5: Amount of funds the company recieves if the task is successful <NUMBER> (default: 0)
* 6: Amount of rating the company and player lose if the task is failed <NUMBER> (default: 0)
* 7: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
* 3: Amount of funds the company recieves if the task is successful <NUMBER> (default: 0)
* 4: Amount of rating the company and player lose if the task is failed <NUMBER> (default: 0)
* 5: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
* 6: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
* 7: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
* 8: Amount of time before target(s) escape <NUMBER> (default: nil)
*
* Return Value:
@ -25,52 +25,38 @@
* Public: Yes
*/
// Mission Parameters from Contract via Mission Handler
params [["_taskID", ""], ["_limitFail", -1], ["_limitSuccess", -1], ["_companyFunds", 0], ["_ratingFail", 0], ["_ratingSuccess", 0], ["_endSuccess", false], ["_endFail", false], "_time"];
private _result = 0;
waitUntil {
sleep 1;
_targets = GVAR(allTargets) select { (_x getVariable ["assignedTask", ""]) == _taskID };
count _targets > 0
};
private _targets = GVAR(allTargets) select { (_x getVariable ["assignedTask", ""]) == _taskID };
private _startTime = if (!isNil "_time") then { floor(time) } else { nil };
// Mission Initialization.
if (!isNil "_time") then {
// Mission Watchdog checks for example Timeout, killed Targets
private _startTime = floor(time);
waitUntil {
sleep 1; // Use sleep on server side!
waitUntil {
sleep 1;
// Timeout check
private _currTime = floor(time);
if (_currTime - _startTime >= _time) then { _result = 1; };
private _targetsKilled = ({ !alive _x } count _targets);
// Check if targets are killed
private _targetsAlive = ({ !alive _x } count _targets);
if (!isNil "_time") then {
private _timeExpired = (floor time - _startTime >= _time);
// Trigger Conditions
(_result == 1) OR (_targetsAlive >= _limitSuccess)
};
} else {
// Mission Watchdog checks for example Killed targets
waitUntil {
sleep 1; // Use sleep on server side!
if (_targetsKilled < _limitSuccess && _timeExpired) then { _result = 1; };
// Check if targets are killed
private _targetsAlive = ({ !alive _x } count _targets);
// Trigger Conditions
(_targetsAlive >= _limitSuccess)
(_result == 1) or (_targetsKilled >= _limitSuccess)
} else {
(_targetsKilled >= _limitSuccess)
};
};
if (_result == 1) then {
// Mission Failed
// Clean-up Targets
{ deleteVehicle _x } forEach _targets;
// Do stuff after the Mission is failed
// Like trigger next mission step via Mission Handler, punishment or so on
[_taskID, "FAILED"] call BFUNC(taskSetState);
if (_endFail) then {
@ -83,14 +69,8 @@ if (_result == 1) then {
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
} else {
// Mission Complete
// Clean-up Targets
{ deleteVehicle _x } forEach _targets;
// Do stuff after the Mission is completed
// Like trigger next mission step via Mission Handler, rewards or so on
[_taskID, "SUCCEEDED"] call BFUNC(taskSetState);
if (_endSuccess) then {
@ -104,7 +84,4 @@ if (_result == 1) then {
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
};
// Reset Mission Spot
// Like delete Markers or other stuff for example Logging
};

View File

@ -0,0 +1,32 @@
#include "..\script_component.hpp"
params [["_logic", objNull, [objNull]], ["_units", [], [[]]], ["_activated", true, [true]]];
if !(_activated) exitWith {};
private _taskID = _logic getVariable ["TaskID", ""];
private _limitFail = _logic getVariable ["LimitFail", -1];
private _limitSuccess = _logic getVariable ["LimitSuccess", -1];
private _companyFunds = _logic getVariable ["CompanyFunds", 0];
private _ratingFail = _logic getVariable ["RatingFail", 0];
private _ratingSuccess = _logic getVariable ["RatingSuccess", 0];
private _endSuccess = _logic getVariable ["EndSuccess", false];
private _endFail = _logic getVariable ["EndFail", false];
private _timeLimit = _logic getVariable ["TimeLimit", 0];
diag_log format ["[FORGE] Attack Module Parameters: TaskID: %1, LimitFail: %2, LimitSuccess: %3, Funds: %4, RatingFail: %5, RatingSuccess: %6, EndSuccess: %7, EndFail: %8, Time: %9", _taskID, _limitFail, _limitSuccess, _companyFunds, _ratingFail, _ratingSuccess, _endSuccess, _endFail, _timeLimit];
private _syncedEntities = synchronizedObjects _logic;
diag_log format ["[FORGE] Attack Module Synced Entities: %1", _syncedEntities];
{
[_x, _taskID] spawn FUNC(makeTarget);
} forEach _syncedEntities;
if (_timeLimit == 0) then {
[_taskID, _limitFail, _limitSuccess, _companyFunds, _ratingFail, _ratingSuccess, _endSuccess, _endFail] spawn FUNC(attack);
} else {
[_taskID, _limitFail, _limitSuccess, _companyFunds, _ratingFail, _ratingSuccess, _endSuccess, _endFail, _timeLimit] spawn FUNC(attack);
};
deleteVehicle _logic;

View File

@ -8,11 +8,11 @@
* 0: ID of the task <STRING>
* 1: Amount of entities destroyed to fail the task <NUMBER>
* 2: Amount of ieds defused to complete the task <NUMBER>
* 3: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
* 4: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
* 5: Amount of funds the company recieves if the task is successful <NUMBER> (default: 0)
* 6: Amount of rating the company and player lose if the task is failed <NUMBER> (default: 0)
* 7: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
* 3: Amount of funds the company recieves if the task is successful <NUMBER> (default: 0)
* 4: Amount of rating the company and player lose if the task is failed <NUMBER> (default: 0)
* 5: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
* 6: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
* 7: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
*
* Return Value:
* None
@ -23,41 +23,39 @@
* Public: Yes
*/
// Mission Parameters from Contract via Mission Handler
params [["_taskID", ""], ["_limitFail", -1], ["_limitSuccess", -1], ["_companyFunds", 0], ["_ratingFail", 0], ["_ratingSuccess", 0], ["_endSuccess", false], ["_endFail", false]];
private _result = 0;
// Get the IED(s) assigned to taskID
private _ieds = GVAR(allIEDs) select { (_x getVariable ["assignedTask", ""]) == _taskID };
// Get the entitie(s) assigned to taskID
private _entities = GVAR(allEntities) select { (_x getVariable ["assignedTask", ""]) == _taskID };
// Mission Initialization.
// Mission Watchdog checks for example Defused IEDs, Destroyed entities
waitUntil {
sleep 1; // Use sleep on server side!
// Check if entities are killed
private _entitiesAlive = ({ !alive _x } count _entities);
if (_entitiesAlive >= _limitFail) then { _result = 1; };
// Trigger Conditions
(_result == 1) OR ((GVAR(defusedCount) >= _limitSuccess) && (_entitiesAlive < _limitFail))
sleep 1;
_ieds = GVAR(allIEDs) select { (_x getVariable ["assignedTask", ""]) == _taskID };
count _ieds > 0
};
// Mission Watchdog checks for example Defused IEDs, destroyed entities
if (_result == 1) then {
// Mission Failed
// Clean-up IEDs and entities
waitUntil {
sleep 1;
_entities = GVAR(allEntities) select { (_x getVariable ["assignedTask", ""]) == _taskID };
count _entities > 0
};
private _ieds = GVAR(allIEDs) select { (_x getVariable ["assignedTask", ""]) == _taskID };
private _entities = GVAR(allEntities) select { (_x getVariable ["assignedTask", ""]) == _taskID };
waitUntil {
sleep 1;
private _entitiesDestroyed = ({ !alive _x } count _entities);
if (_entitiesDestroyed >= _limitFail) then { _result = 1; };
(_result == 1) or ((GVAR(defusedCount) >= _limitSuccess) && (_entitiesDestroyed < _limitFail))
};
if (_result == 1) then {
{ deleteVehicle _x } forEach _ieds;
{ deleteVehicle _x } forEach _entities;
// Do stuff after the Mission is failed
// Like trigger next mission step via Mission Handler, punishment or so on
[_taskID, "FAILED"] call BFUNC(taskSetState);
if (_endFail) then {
@ -70,15 +68,9 @@ if (_result == 1) then {
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
} else {
// Mission Complete
// Clean-up IEDs and entities
{ deleteVehicle _x } forEach _ieds;
{ deleteVehicle _x } forEach _entities;
// Do stuff after the Mission is completed
// Like trigger next mission step via Mission Handler, rewards or so on
[_taskID, "SUCCEEDED"] call BFUNC(taskSetState);
if (_endSuccess) then {
@ -94,7 +86,4 @@ if (_result == 1) then {
["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
};
// Reset Mission Spot
// Like delete Markers or other stuff for example Logging
GVAR(defusedCount) = 0;

View File

@ -0,0 +1,45 @@
#include "..\script_component.hpp"
params [["_logic", objNull, [objNull]], ["_units", [], [[]]], ["_activated", true, [true]]];
if !(_activated) exitWith {};
private _taskID = _logic getVariable ["TaskID", ""];
private _limitFail = _logic getVariable ["LimitFail", -1];
private _limitSuccess = _logic getVariable ["LimitSuccess", -1];
private _companyFunds = _logic getVariable ["CompanyFunds", 0];
private _ratingFail = _logic getVariable ["RatingFail", 0];
private _ratingSuccess = _logic getVariable ["RatingSuccess", 0];
private _endSuccess = _logic getVariable ["EndSuccess", false];
private _endFail = _logic getVariable ["EndFail", false];
private _timeLimit = _logic getVariable ["TimeLimit", 0];
diag_log format ["[FORGE] Defuse Module Parameters: TaskID: %1, LimitFail: %2, LimitSuccess: %3, Funds: %4, RatingFail: %5, RatingSuccess: %6, EndSuccess: %7, EndFail: %8, Time: %9", _taskID, _limitFail, _limitSuccess, _companyFunds, _ratingFail, _ratingSuccess, _endSuccess, _endFail, _timeLimit];
private _syncedModules = synchronizedObjects _logic;
diag_log format ["[FORGE] Defuse Module Synced Modules: %1", _syncedModules];
private _iedModule = (_syncedModules select { typeOf _x == "FORGE_Module_Explosives" }) select 0;
private _protectedModule = (_syncedModules select { typeOf _x == "FORGE_Module_Protected" }) select 0;
private _explosiveEntities = synchronizedObjects _iedModule;
diag_log format ["[FORGE] Defuse Module Explosive Entites: %1", _explosiveEntities];
private _protectedEntities = synchronizedObjects _protectedModule;
diag_log format ["[FORGE] Defuse Module Protected Entities: %1", _protectedEntities];
{
if (!isNull _x) then {
[_x, _taskID, _timeLimit] spawn FUNC(makeIED);
};
} forEach _explosiveEntities;
{
if (!isNull _x) then {
[_x, _taskID] spawn FUNC(makeObject);
};
} forEach _protectedEntities;
[_taskID, _limitFail, _limitSuccess, _companyFunds, _ratingFail, _ratingSuccess, _endSuccess, _endFail] spawn FUNC(defuse);
deleteVehicle _logic;

View File

@ -8,11 +8,11 @@
* 0: ID of the task <STRING>
* 1: Amount of targets escaped to fail the task <NUMBER>
* 2: Amount of targets eliminated to complete the task <NUMBER>
* 3: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
* 4: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
* 5: Amount of funds the company recieves if the task is successful <NUMBER> (default: 0)
* 6: Amount of rating the company and player lose if the task is failed <NUMBER> (default: 0)
* 7: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
* 3: Amount of funds the company recieves if the task is successful <NUMBER> (default: 0)
* 4: Amount of rating the company and player lose if the task is failed <NUMBER> (default: 0)
* 5: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
* 6: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
* 7: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
* 8: Amount of time before target(s) escape <NUMBER> (default: nil)
*
* Return Value:
@ -25,53 +25,38 @@
* Public: Yes
*/
// Mission Parameters from Contract via Mission Handler
params [["_taskID", ""], ["_limitFail", -1], ["_limitSuccess", -1], ["_companyFunds", 0], ["_ratingFail", 0], ["_ratingSuccess", 0], ["_endSuccess", false], ["_endFail", false], "_time"];
private _result = 0;
// Get the targets assigned to taskID
waitUntil {
sleep 1;
_targets = GVAR(allTargets) select { (_x getVariable ["assignedTask", ""]) == _taskID };
count _targets > 0
};
private _targets = GVAR(allTargets) select { (_x getVariable ["assignedTask", ""]) == _taskID };
private _startTime = if (!isNil "_time") then { floor(time) } else { nil };
// Mission Initialization.
if (!isNil "_time") then {
// Mission Watchdog checks for example Timeout, Destroyed Targets
private _startTime = floor(time);
waitUntil {
sleep 1; // Use sleep on server side!
waitUntil {
sleep 1;
// Timeout check
private _currTime = floor(time);
if (_currTime - _startTime >= _time) then { _result = 1; };
private _targetsDestroyed = ({ !alive _x } count _targets);
// Check if targets are killed
private _targetsAlive = ({ !alive _x } count _targets);
if (!isNil "_time") then {
private _timeExpired = (floor time - _startTime >= _time);
// Trigger Conditions
(_result == 1) OR (_targetsAlive >= _limitSuccess)
};
} else {
// Mission Watchdog checks for example killed Targets
waitUntil {
sleep 1; // Use sleep on server side!
if (_targetsDestroyed < _limitSuccess && _timeExpired) then { _result = 1; };
// Check if targets are killed
private _targetsAlive = ({ !alive _x } count _targets);
// Trigger Conditions
(_targetsAlive >= _limitSuccess)
(_result == 1) or (_targetsDestroyed >= _limitSuccess)
} else {
(_targetsDestroyed >= _limitSuccess)
};
};
if (_result == 1) then {
// Mission Failed
// Clean-up Targets
{ deleteVehicle _x } forEach _targets;
// Do stuff after the Mission is failed
// Like trigger next mission step via Mission Handler, punishment or so on
[_taskID, "FAILED"] call BFUNC(taskSetState);
if (_endFail) then {
@ -84,14 +69,8 @@ if (_result == 1) then {
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
} else {
// Mission Complete
// Clean-up Targets
{ deleteVehicle _x } forEach _targets;
// Do stuff after the Mission is completed
// Like trigger next mission step via Mission Handler, rewards or so on
[_taskID, "SUCCEEDED"] call BFUNC(taskSetState);
if (_endSuccess) then {
@ -105,7 +84,4 @@ if (_result == 1) then {
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
};
// Reset Mission Spot
// Like delete Markers or other stuff for example Logging
};

View File

@ -0,0 +1,32 @@
#include "..\script_component.hpp"
params [["_logic", objNull, [objNull]], ["_units", [], [[]]], ["_activated", true, [true]]];
if !(_activated) exitWith {};
private _taskID = _logic getVariable ["TaskID", ""];
private _limitFail = _logic getVariable ["LimitFail", -1];
private _limitSuccess = _logic getVariable ["LimitSuccess", -1];
private _companyFunds = _logic getVariable ["CompanyFunds", 0];
private _ratingFail = _logic getVariable ["RatingFail", 0];
private _ratingSuccess = _logic getVariable ["RatingSuccess", 0];
private _endSuccess = _logic getVariable ["EndSuccess", false];
private _endFail = _logic getVariable ["EndFail", false];
private _timeLimit = _logic getVariable ["TimeLimit", 0];
diag_log format ["[FORGE] Destroy Module Parameters: TaskID: %1, LimitFail: %2, LimitSuccess: %3, Funds: %4, RatingFail: %5, RatingSuccess: %6, EndSuccess: %7, EndFail: %8, Time: %9", _taskID, _limitFail, _limitSuccess, _companyFunds, _ratingFail, _ratingSuccess, _endSuccess, _endFail, _timeLimit];
private _syncedEntities = synchronizedObjects _logic;
diag_log format ["[FORGE] Destroy Module Synced Entities: %1", _syncedEntities];
{
[_x, _taskID] spawn FUNC(makeTarget);
} forEach _syncedEntities;
if (_timeLimit == 0) then {
[_taskID, _limitFail, _limitSuccess, _companyFunds, _ratingFail, _ratingSuccess, _endSuccess, _endFail] spawn FUNC(destroy);
} else {
[_taskID, _limitFail, _limitSuccess, _companyFunds, _ratingFail, _ratingSuccess, _endSuccess, _endFail, _timeLimit] spawn FUNC(destroy);
};
deleteVehicle _logic;

View File

@ -0,0 +1,5 @@
#include "..\script_component.hpp"
params [["_logic", objNull, [objNull]], ["_units", [], [[]]], ["_activated", true, [true]]];
if !(_activated) exitWith {};

View File

@ -22,9 +22,6 @@ params [["_taskType", "", [""]], ["_cntParams", [], [[]]], ["_minRating", 0, [0]
private _thread = 0;
// Trigger before the task starts or what ever you need
// For example block accepting new tasks, lock shops, player save and so on
GVAR(acceptTask) = false;
if (isNil "companyRating") then { companyRating = 0; };
@ -35,7 +32,6 @@ if (_companyRating < _minRating) exitWith {
hint format ["The company rating of %1 does not meet or exceed the minimum required rating of %2.", _companyRating, _minRating];
};
// Start the task
switch (_taskType) do {
case "attack": {
private _thread = _cntParams spawn FUNC(attack);
@ -64,7 +60,4 @@ switch (_taskType) do {
diag_log "Mision Handler Done";
// Do Stuff what you need to be done after the task
// For example allow accepting new tasks, open shops and so on
GVAR(acceptTask) = true;

View File

@ -20,6 +20,8 @@
params [["_entity", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_typeOf", "", [""]], ["_time", 0, [0]]];
private _nearPlayers = [];
switch (_typeOf) do {
case "hostage": {
_entity setCaptive true;
@ -28,7 +30,7 @@ switch (_typeOf) do {
waitUntil {
sleep 1;
private _nearPlayers = allPlayers inAreaArray [ASLToAGL getPosASL _entity, 2, 2, 0, false, 2];
_nearPlayers = allPlayers inAreaArray [ASLToAGL getPosASL _entity, 2, 2, 0, false, 2];
count _nearPlayers > 0
};
@ -43,7 +45,7 @@ switch (_typeOf) do {
case "hvt": {
waitUntil {
sleep 1;
private _nearPlayers = allPlayers inAreaArray [ASLToAGL getPosASL _entity, 2, 2, 0, false, 2];
_nearPlayers = allPlayers inAreaArray [ASLToAGL getPosASL _entity, 2, 2, 0, false, 2];
count _nearPlayers > 0
};
@ -51,14 +53,16 @@ switch (_typeOf) do {
doStop _entity;
};
case "ied": {
_time = _time -1;
sleep 1;
while { alive _entity && _time > 0} do {
if (_time > 10) then { _entity say3D "FORGE_timerBeep" };
if (_time <= 10 && _time > 5) then { _entity say3D "FORGE_timerBeepShort" };
if (_time <= 5) then { _entity say3D "FORGE_timerEnd" };
if (_time <= 0) exitWith { _entity setDamage 1 };
_time = _time -1;
sleep 1;
};
if (!alive _entity) exitWith {};
if (_time > 10) then { _entity say3D "FORGE_timerBeep" };
if (_time <= 10 && _time > 5) then { _entity say3D "FORGE_timerBeepShort" };
if (_time <= 5) then { _entity say3D "FORGE_timerEnd" };
if (_time <= 0) exitWith { _entity setDamage 1 };
if (alive _entity && _time <= 0) then { _entity setDamage 1 };
};
};

View File

@ -9,12 +9,12 @@
* 1: Amount of hostages KIA to fail the task <NUMBER>
* 2: Amount of hostages rescued to complete the task <NUMBER>
* 3: Marker name for the extraction zone <STRING>
* 4: Subcategory of task <ARRAY> (default: [false, true])
* 5: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
* 6: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
* 7: Amount of funds the company recieves if the task is successful <NUMBER> (default: 0)
* 8: Amount of rating the company and player lose if the task is failed <NUMBER> (default: 0)
* 9: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
* 4: Amount of funds the company recieves if the task is successful <NUMBER> (default: 0)
* 5: Amount of rating the company and player lose if the task is failed <NUMBER> (default: 0)
* 6: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
* 7: Subcategory of task <ARRAY> (default: [false, true])
* 8: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
* 9: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
* 10: Amount of time before hostage(s) die <NUMBER> (default: nil)
* 11: Marker name for the cbrn zone <STRING> (default: nil)
*
@ -29,80 +29,61 @@
* Public: Yes
*/
// Mission Parameters from Contract via Mission Handler
params [["_taskID", ""], ["_limitFail", -1], ["_limitSuccess", -1], ["_extZone", ""], ["_companyFunds", 0], ["_ratingFail", 0], ["_ratingSuccess", 0], ["_type", [["_cbrn", false], ["_hostage", true]]], ["_endSuccess", false], ["_endFail", false], "_time", ["_cbrnZone", ""]];
private _cbrn = (_this select 8) select 0;
private _hostage = (_this select 8) select 1;
private _nearPlayers = [];
private _cbrn = (_this select 7) select 0;
private _hostage = (_this select 7) select 1;
private _result = 0;
// Get the hostages
waitUntil {
sleep 1;
_hostages = GVAR(allHostages) select { (_x getVariable ["assignedTask", ""]) == _taskID };
count _hostages > 0
};
waitUntil {
sleep 1;
_shooters = GVAR(allShooters) select { (_x getVariable ["assignedTask", ""]) == _taskID };
count _shooters > 0
};
private _hostages = GVAR(allHostages) select { (_x getVariable ["assignedTask", ""]) == _taskID };
// Get the shooters
private _shooters = GVAR(allShooters) select { (_x getVariable ["assignedTask", ""]) == _taskID };
private _startTime = if (!isNil "_time") then { floor(time) } else { nil };
// Mission Initialization.
if (!isNil "_time") then {
// Mission Watchdog checks for example Timeout, killed Hostages, killed Shooters
private _startTime = floor(time);
waitUntil {
sleep 1; // Use sleep on server side!
waitUntil {
sleep 1;
// Check if hostages are killed
private _hostagesAlive = ({ !alive _x } count _hostages);
if (_hostagesAlive >= _limitFail) then { _result = 1; };
private _hostagesFreed = ({ !captive _x } count _hostages);
private _hostagesInZone = ({ _x inArea _extZone } count _hostages);
private _hostagesKilled = ({ !alive _x } count _hostages);
private _shootersAlive = ({ alive _x } count _shooters);
// Check if hostages are in extraction zone
private _hostagesInZone = ({ _x inArea _extZone } count _hostages);
// Check if hostages are captive
private _hostagesCaptive = ({ !captive _x } count _hostages);
// Check if shooters are killed
private _shootersAlive = ({ alive _x } count _shooters);
// Timeout check
private _currTime = floor(time);
if ((_hostagesCaptive < _limitSuccess) && (_currTime - _startTime >= _time)) then { _result = 1; };
// Trigger Conditions
(_result == 1) OR (_hostagesInZone >= _limitSuccess) OR ((!isNil "_shooters") && (_shootersAlive <= 0))
};
} else {
// Mission Watchdog checks for example killed Hostages, killed Shooters
waitUntil {
sleep 1; // Use sleep on server side!
// Check if hostages are killed
private _hostagesAlive = ({ !alive _x } count _hostages);
if (_hostagesAlive >= _limitFail) then { _result = 1; };
// Check if hostages are in extraction zone
private _hostagesInZone = ({ _x inArea _extZone } count _hostages);
// Check if shooters are killed
private _shootersAlive = ({ alive _x } count _shooters);
// Trigger Conditions
(_result == 1) OR (_hostagesInZone >= _limitSuccess) OR ((!isNil "_shooters") && (_shootersAlive <= 0))
if (!isNil "_time") then {
private _timeExpired = (floor time - _startTime >= _time);
if (_hostagesFreed < _limitSuccess && _timeExpired) then { _result = 1; };
if (_hostagesKilled >= _limitFail) then { _result = 1; };
(_result == 1) or
((_hostagesInZone >= _limitSuccess) && (_hostagesKilled < _limitFail)) or
((!isNil "_shooters") && (_shootersAlive <= 0) && (_hostagesInZone >= _limitSuccess) && (_hostagesKilled < _limitFail))
} else {
if (_hostagesKilled >= _limitFail) then { _result = 1; };
(_result == 1) or
((_hostagesInZone >= _limitSuccess) && (_hostagesKilled < _limitFail)) or
((!isNil "_shooters") && (_shootersAlive <= 0) && (_hostagesInZone >= _limitSuccess) && (_hostagesKilled < _limitFail))
};
};
if (_result == 1) then {
// Mission Failed
// Do stuff after the Mission is failed
// Like trigger next mission step via Mission Handler, punishment or so on
// Check if task is typeOf CBRN
if (_cbrn) then {
"SmokeShellYellow" createVehicle getMarkerPos _cbrnZone;
sleep 5;
{
{
if (captive _x) then {
_x setDamage 0.9;
_x playMove "acts_executionvictim_kill_end";
@ -114,7 +95,6 @@ if (_result == 1) then {
} forEach _hostages;
};
// Check if task is typeOf Hostage(s)
if (_hostage) then {
{
_x enableAIFeature ["MOVE", true];
@ -128,8 +108,6 @@ if (_result == 1) then {
sleep 5;
};
// Clean-up Hostages and Shooters
{ deleteVehicle _x } forEach _hostages;
{ deleteVehicle _x } forEach _shooters;
@ -145,15 +123,9 @@ if (_result == 1) then {
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
} else {
// Mission Complete
// Clean-up Hostages and Shooters
{ deleteVehicle _x } forEach _hostages;
{ deleteVehicle _x } forEach _shooters;
// Do stuff after the Mission is completed
// Like trigger next mission step via Mission Handler, rewards or so on
[_taskID, "SUCCEEDED"] call BFUNC(taskSetState);
if (_endSuccess) then {
@ -167,7 +139,4 @@ if (_result == 1) then {
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
};
// Reset Mission Spot
// Like delete Markers or other stuff for example Logging
};

View File

@ -0,0 +1,54 @@
#include "..\script_component.hpp"
params [["_logic", objNull, [objNull]], ["_units", [], [[]]], ["_activated", true, [true]]];
if !(_activated) exitWith {};
private _taskID = _logic getVariable ["TaskID", ""];
private _limitFail = _logic getVariable ["LimitFail", -1];
private _limitSuccess = _logic getVariable ["LimitSuccess", -1];
private _extraction = _logic getVariable ["ExtZone", ""];
private _companyFunds = _logic getVariable ["CompanyFunds", 0];
private _ratingFail = _logic getVariable ["RatingFail", 0];
private _ratingSuccess = _logic getVariable ["RatingSuccess", 0];
private _cbrn = _logic getVariable ["CBRN", false];
private _execution = _logic getVariable ["Execution", false];
private _endSuccess = _logic getVariable ["EndSuccess", false];
private _endFail = _logic getVariable ["EndFail", false];
private _timeLimit = _logic getVariable ["TimeLimit", 0];
private _cbrnZone = _logic getVariable ["CBRNZone", ""];
diag_log format ["[FORGE] Hostage Module Parameters: TaskID: %1, LimitFail: %2, LimitSuccess: %3, ExtractionZone: %4, Funds: %5, RatingFail: %6, RatingSuccess: %7, CBRN: %8, Execution: %9, EndSuccess: %10, EndFail: %11, Time: %12, CBRNZone: %13",
_taskID, _limitFail, _limitSuccess, _extraction, _companyFunds, _ratingFail, _ratingSuccess, _cbrn, _execution, _endSuccess, _endFail, _timeLimit, _cbrnZone];
private _syncedModules = synchronizedObjects _logic;
diag_log format ["[FORGE] Hostage Module Synced Entities: %1", _syncedModules];
private _hostageModule = (_syncedModules select { typeOf _x == "FORGE_Module_Hostages" }) select 0;
private _shooterModule = (_syncedModules select { typeOf _x == "FORGE_Module_Shooters" }) select 0;
private _hostageEntities = synchronizedObjects _hostageModule;
diag_log format ["[FORGE] Hostage Module Hostage Entities: %1", _hostageEntities];
private _shooterEntities = synchronizedObjects _shooterModule;
diag_log format ["[FORGE] Hostage Module Shooter Entities: %1", _shooterEntities];
{
if (!isNull _x && (_x isNotEqualTo str objNull)) then {
[_x, _taskID] spawn FUNC(makeHostage);
};
} forEach _hostageEntities;
{
if (!isNull _x && (_x isNotEqualTo str objNull)) then {
[_x, _taskID] spawn FUNC(makeShooter);
};
} forEach _shooterEntities;
if (_timeLimit == 0) then {
[_taskID, _limitFail, _limitSuccess, _extraction, _companyFunds, _ratingFail, _ratingSuccess, [_cbrn, _execution], _endSuccess, _endFail] spawn FUNC(hostage);
} else {
[_taskID, _limitFail, _limitSuccess, _extraction, _companyFunds, _ratingFail, _ratingSuccess, [_cbrn, _execution], _endSuccess, _endFail, _timeLimit, _cbrnZone] spawn FUNC(hostage);
};
deleteVehicle _logic;

View File

@ -0,0 +1,5 @@
#include "..\script_component.hpp"
params [["_logic", objNull, [objNull]], ["_units", [], [[]]], ["_activated", true, [true]]];
if !(_activated) exitWith {};

View File

@ -9,12 +9,12 @@
* 1: Amount of HVTs KIA to fail the task <NUMBER>
* 2: Amount of HVTs Captured or KIA to complete the task <NUMBER>
* 3: Marker name for the extraction zone <STRING>
* 4: Subcategory of task <ARRAY> (default: [true, false])
* 5: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
* 6: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
* 7: Amount of funds the company recieves if the task is successful <NUMBER> (default: 0)
* 8: Amount of rating the company and player lose if the task is failed <NUMBER> (default: 0)
* 9: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
* 4: Amount of funds the company recieves if the task is successful <NUMBER> (default: 0)
* 5: Amount of rating the company and player lose if the task is failed <NUMBER> (default: 0)
* 6: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
* 7: Subcategory of task <ARRAY> (default: [true, false])
* 8: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
* 9: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
* 10: Amount of time before hvt(s) die <NUMBER> (default: nil)
*
* Return Value:
@ -29,67 +29,46 @@
* Public: Yes
*/
// Mission Parameters from Contract via Mission Handler
params [["_taskID", ""], ["_limitFail", -1], ["_limitSuccess", -1], ["_extZone", ""], ["_companyFunds", 0], ["_ratingFail", 0], ["_ratingSuccess", 0], ["_type", [["_capture", true], ["_eliminate", false]]], ["_endSuccess", false], ["_endFail", false], "_time"];
private _capture = (_this select 7) select 0;
private _eliminate = (_this select 7) select 1;
private _nearPlayers = [];
private _result = 0;
waitUntil {
sleep 1;
_hvts = GVAR(allHVTs) select { (_x getVariable ["assignedTask", ""]) == _taskID };
count _hvts > 0
};
private _hvts = GVAR(allHVTs) select { (_x getVariable ["assignedTask", ""]) == _taskID };
private _startTime = if (!isNil "_time") then { floor(time) } else { nil };
// Mission Initialization.
if (!isNil "_time") then {
// Mission Watchdog checks for example Timeout, Captured/Killed HVTs
private _startTime = floor(time);
waitUntil {
sleep 1; // Use sleep on server side!
waitUntil {
sleep 1;
// Check if hvts are killed
private _hvtsAlive = ({ !alive _x } count _hvts);
if (_capture && (_hvtsAlive >= _limitFail)) then { _result = 1; };
private _hvtsCaptive = ({ captive _x } count _hvts);
private _hvtsKilled = ({ !alive _x } count _hvts);
private _hvtsInZone = ({ _x inArea _extZone } count _hvts);
// Check if hvts are in extraction zone
private _hvtsInZone = ({ _x inArea _extZone } count _hvts);
if (!isNil "_time") then {
private _timeExpired = (floor time - _startTime >= _time);
// Check if hvts are captive
private _hvtsCaptive = ({ captive _x } count _hvts);
if (_capture && _hvtsKilled >= _limitFail) then { _result = 1; };
if (_capture && _hvtsCaptive < _limitSuccess && _timeExpired) then { _result = 1; };
if (_eliminate && _hvtsKilled < _limitSuccess && _timeExpired) then { _result = 1; };
// Timeout check
private _currTime = floor(time);
if ((_hvtsCaptive < _limitSuccess) && (_currTime - _startTime >= _time)) then { _result = 1; };
(_result == 1) or (_capture && (_hvtsInZone >= _limitSuccess) && (_hvtsKilled < _limitFail)) or (_eliminate && (_hvtsKilled >= _limitSuccess))
} else {
if (_capture && (_hvtsKilled >= _limitFail)) then { _result = 1; };
// Trigger Conditions
(_result == 1) OR (_hvtsInZone >= _limitSuccess) OR (_hvtsAlive >= _limitSuccess)
};
} else {
// Mission Watchdog checks for example Captured/Killed HVTs
waitUntil {
sleep 1; // Use sleep on server side!
// Check if hvts are killed
private _hvtsAlive = ({ !alive _x } count _hvts);
if (_capture && (_hvtsAlive >= _limitFail)) then { _result = 1; };
// Check if hvts are in extraction zone
private _hvtsInZone = ({ _x inArea _extZone } count _hvts);
// Check if hvts are captive
private _hvtsCaptive = ({ captive _x } count _hvts);
// Trigger Conditions
(_result == 1) OR (_hvtsInZone >= _limitSuccess) OR (_hvtsAlive >= _limitSuccess)
(_result == 1) or (_capture && (_hvtsInZone >= _limitSuccess) && (_hvtsKilled < _limitFail)) or (_eliminate && (_hvtsKilled >= _limitSuccess))
};
};
if (_result == 1) then {
// Mission Failed
// Clean-up HVTs
{ deleteVehicle _x } forEach _hvts;
// Do stuff after the Mission is failed
// Like trigger next mission step via Mission Handler, punishment or so on
[_taskID, "FAILED"] call BFUNC(taskSetState);
if (_endFail) then {
@ -102,14 +81,8 @@ if (_result == 1) then {
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
} else {
// Mission Complete
// Clean-up HVTs
{ deleteVehicle _x } forEach _hvts;
// Do stuff after the Mission is completed
// Like trigger next mission step via Mission Handler, rewards or so on
[_taskID, "SUCCEEDED"] call BFUNC(taskSetState);
if (_endSuccess) then {
@ -123,7 +96,4 @@ if (_result == 1) then {
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
};
// Reset Mission Spot
// Like delete Markers or other stuff for example Logging
};

View File

@ -0,0 +1,38 @@
#include "..\script_component.hpp"
params [["_logic", objNull, [objNull]], ["_units", [], [[]]], ["_activated", true, [true]]];
if !(_activated) exitWith {};
private _taskID = _logic getVariable ["TaskID", ""];
private _limitFail = _logic getVariable ["LimitFail", -1];
private _limitSuccess = _logic getVariable ["LimitSuccess", -1];
private _extraction = _logic getVariable ["ExtZone", ""];
private _companyFunds = _logic getVariable ["CompanyFunds", 0];
private _ratingFail = _logic getVariable ["RatingFail", 0];
private _ratingSuccess = _logic getVariable ["RatingSuccess", 0];
private _capture = _logic getVariable ["CaptureHVT", true];
private _eliminate = _logic getVariable ["EliminateHVT", false];
private _endSuccess = _logic getVariable ["EndSuccess", false];
private _endFail = _logic getVariable ["EndFail", false];
private _timeLimit = _logic getVariable ["TimeLimit", 0];
diag_log format ["[FORGE] HVT Module Parameters: TaskID: %1, LimitFail: %2, LimitSuccess: %3, ExtractionZone: %4, Funds: %5, RatingFail: %6, RatingSuccess: %7, CaptureHvt: %8, EliminateHvt: %9, EndSuccess: %10, EndFail: %11, Time: %12",
_taskID, _limitFail, _limitSuccess, _extraction, _companyFunds, _ratingFail, _ratingSuccess, _capture, _eliminate, _endSuccess, _endFail, _timeLimit];
private _syncedEntities = synchronizedObjects _logic;
diag_log format ["[FORGE] HVT Module Synced Entities: %1", _syncedEntities];
{
if (!isNull _x && (_x isNotEqualTo str objNull)) then {
[_x, _taskID] spawn FUNC(makeHVT);
};
} forEach _syncedEntities;
if (_timeLimit == 0) then {
[_taskID, _limitFail, _limitSuccess, _extraction, _companyFunds, _ratingFail, _ratingSuccess, [_capture, _eliminate], _endSuccess, _endFail] spawn FUNC(hvt);
} else {
[_taskID, _limitFail, _limitSuccess, _extraction, _companyFunds, _ratingFail, _ratingSuccess, [_capture, _eliminate], _endSuccess, _endFail, _timeLimit] spawn FUNC(hvt);
};
deleteVehicle _logic;

View File

@ -19,25 +19,9 @@
params [["_entity", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_taskID", "", [""]]];
// Check stuff
// if (isNull _entity) exitWith {[COMPONENT_NAME, "ERROR", "Unit is not found", true] call forge_server_main_fnc_log};
// if (_taskID == "") exitWith {[COMPONENT_NAME, "ERROR", "Task ID is empty", true] call forge_server_main_fnc_log};
// Register hvt
SETVAR(_entity,assignedTask,_taskID);
// Add unit to hvt array
private _index = GVAR(allHVTs) pushBackUnique _entity;
GVAR(allHVTs) pushBackUnique _entity;
if (alive _entity) then {
[_entity, "hvt"] spawn FUNC(heartBeat);
};
// Log
// [COMPONENT_NAME, "DEBUG", format [
// "Unit (%1) is registered as a hvt. HVT array: %2", _entity, str GVAR(allHVTs)
// ]] call forge_server_main_fnc_log;
// if (_index == -1) then {
// [COMPONENT_NAME, "WARNING", format ["Unit (%1) is already a hvt", _entity], true] call forge_server_main_fnc_log;
// };
};

View File

@ -19,28 +19,11 @@
params [["_entity", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_taskID", "", [""]]];
private _nearPlayers = [];
diag_log format ["[FORGE] Make Hostage: %1", _this];
// Check stuff
// if (isNull _entity) exitWith {[COMPONENT_NAME, "ERROR", "Unit is not found", true] call forge_server_main_fnc_log};
// if (_taskID == "") exitWith {[COMPONENT_NAME, "ERROR", "Task ID is empty", true] call forge_server_main_fnc_log};
// Register hostage
SETVAR(_entity,assignedTask,_taskID);
GVAR(allHostages) pushBackUnique _entity;
// Add unit to hostage array
private _index = GVAR(allHostages) pushBackUnique _entity;
// Log
// [COMPONENT_NAME, "DEBUG", format [
// "Unit (%1) is registered as a hostage. Hostage array: %2", _entity, str GVAR(allHostages)
// ]] call forge_server_main_fnc_log;
// if (_index == -1) then {
// [COMPONENT_NAME, "WARNING", format ["Unit (%1) is already a hostage", _entity], true] call forge_server_main_fnc_log;
// };
// Animation Loop
if (alive _entity) then {
[_entity, "hostage"] spawn FUNC(heartBeat);
};

View File

@ -20,30 +20,7 @@
params [["_entity", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_taskID", "", [""]], ["_time", 0, [0]]];
// Check if IED is defined
// if (isNull _entity) exitWith {
// [COMPONENT_NAME, "ERROR", "IED is not found", true] call forge_server_main_fnc_log
// };
// Check if taskID is defined
// if (_taskID == "") exitWith {
// [COMPONENT_NAME, "ERROR", "Task ID is empty", true] call forge_server_main_fnc_log
// };
// Assigns IED to taskID
SETVAR(_entity,assignedTask,_taskID);
GVAR(allIEDs) pushBackUnique _entity;
// Add IED to IED array
private _index = GVAR(allIEDs) pushBackUnique _entity;
// Log
// [COMPONENT_NAME, "DEBUG", format ["Object (%1) is registered as an IED. IED array: %2", _entity, str GVAR(allIEDs)]] call forge_server_main_fnc_log;
// if (_index == -1) then {
// [COMPONENT_NAME, "WARNING", format ["Object (%1) is already an IED", _entity], true] call forge_server_main_fnc_log;
// };
// Countdown timer
while { (_time > 0) && alive _entity } do {
[_entity, "ied", _time] spawn FUNC(heartBeat);
};
[_entity, "ied", _time] spawn FUNC(heartBeat);

View File

@ -19,25 +19,5 @@
params [["_entity", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_taskID", "", [""]]];
// Check if item is defined
// if (isNull _entity) exitWith {
// [COMPONENT_NAME, "ERROR", "Item is not found", true] call forge_server_main_fnc_log
// };
// Check if taskID is defined
// if (_taskID == "") exitWith {
// [COMPONENT_NAME, "ERROR", "Task ID is empty", true] call forge_server_main_fnc_log
// };
// Assign object to taskID
SETVAR(_entity,assignedTask,_taskID);
// Add object to object array
private _index = GVAR(allEntities) pushBackUnique _entity;
// Log
// [COMPONENT_NAME, "DEBUG", format ["Item (%1) is registered as an object. Object array: %2", _entity, str GVAR(allEntities)]] call forge_server_main_fnc_log;
// if (_index == -1) then {
// [COMPONENT_NAME, "WARNING", format ["Item (%1) is already an object", _entity], true] call forge_server_main_fnc_log;
// };
GVAR(allEntities) pushBackUnique _entity;

View File

@ -0,0 +1,25 @@
#include "..\script_component.hpp"
/*
* Author: Creedcoder, J. Schmidt
* Registers an AI unit as a shooter/POW.
*
* Arguments:
* 0: The AI unit <OBJECT>
* 1: ID of the task <STRING>
*
* Return Value:
* None
*
* Example:
* [this, "task_name"] spawn forge_client_task_fnc_makeShooter;
*
* Public: Yes
*/
params [["_entity", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_taskID", "", [""]]];
diag_log format ["[FORGE] Make Shooter: %1", _this];
SETVAR(_entity,assignedTask,_taskID);
GVAR(allShooters) pushBackUnique _entity;

View File

@ -19,21 +19,5 @@
params [["_entity", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_taskID", "", [""]]];
// Check if unit is defined
// if (isNull _entity) exitWith {[COMPONENT_NAME, "ERROR", "Unit is not found", true] call forge_server_main_fnc_log};
// Check if taskID is defined
// if (_taskID == "") exitWith {[COMPONENT_NAME, "ERROR", "Task ID is empty", true] call forge_server_main_fnc_log};
// Assign unit to taskID
SETVAR(_entity,assignedTask,_taskID);
// Add unit to target array
private _index = GVAR(allTargets) pushBackUnique _entity;
// Log
// [COMPONENT_NAME, "DEBUG", format ["Unit (%1) is registered as a target. Target array: %2", _entity, str GVAR(allTargets)]] call forge_server_main_fnc_log;
// if (_index == -1) then {
// [COMPONENT_NAME, "WARNING", format ["Unit (%1) is already a target", _entity], true] call forge_server_main_fnc_log;
// };
GVAR(allTargets) pushBackUnique _entity;

View File

@ -0,0 +1,5 @@
#include "..\script_component.hpp"
params [["_logic", objNull, [objNull]], ["_units", [], [[]]], ["_activated", true, [true]]];
if !(_activated) exitWith {};

View File

@ -0,0 +1,5 @@
#include "..\script_component.hpp"
params [["_logic", objNull, [objNull]], ["_units", [], [[]]], ["_activated", true, [true]]];
if !(_activated) exitWith {};