Compare commits
No commits in common. "39c8648bd6fa041d5dbc368f99d6f7c913316ddd" and "821eea45a9a0bf99a64934a1da28a8ca61e75aee" have entirely different histories.
39c8648bd6
...
821eea45a9
@ -1,6 +0,0 @@
|
|||||||
class CfgFactionClasses {
|
|
||||||
class NO_CATEGORY;
|
|
||||||
class FORGE_Modules: NO_CATEGORY {
|
|
||||||
displayName = "FORGE";
|
|
||||||
};
|
|
||||||
};
|
|
@ -1,791 +0,0 @@
|
|||||||
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;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
@ -1,22 +1,12 @@
|
|||||||
PREP(attack);
|
PREP(attack);
|
||||||
PREP(attackModule);
|
|
||||||
PREP(defuse);
|
PREP(defuse);
|
||||||
PREP(defuseModule);
|
|
||||||
PREP(destroy);
|
PREP(destroy);
|
||||||
PREP(destroyModule);
|
|
||||||
PREP(explosivesModule);
|
|
||||||
PREP(handler);
|
PREP(handler);
|
||||||
PREP(heartBeat);
|
PREP(heartBeat);
|
||||||
PREP(hostage);
|
PREP(hostage);
|
||||||
PREP(hostageModule);
|
|
||||||
PREP(hostagesModule);
|
|
||||||
PREP(hvt);
|
PREP(hvt);
|
||||||
PREP(hvtModule);
|
|
||||||
PREP(makeHostage);
|
PREP(makeHostage);
|
||||||
PREP(makeHVT);
|
PREP(makeHVT);
|
||||||
PREP(makeIED);
|
PREP(makeIED);
|
||||||
PREP(makeObject);
|
PREP(makeObject);
|
||||||
PREP(makeShooter);
|
PREP(makeTarget);
|
||||||
PREP(makeTarget);
|
|
||||||
PREP(protectedModule);
|
|
||||||
PREP(shootersModule);
|
|
@ -1,7 +1,5 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
GVAR(defusedCount) = 0;
|
|
||||||
|
|
||||||
["ace_explosives_defuse", {
|
["ace_explosives_defuse", {
|
||||||
GVAR(defusedCount) = GVAR(defusedCount) + 1;
|
GVAR(defusedCount) = GVAR(defusedCount) + 1;
|
||||||
}] call CFUNC(addEventHandler);
|
}] call CFUNC(addEventHandler);
|
@ -13,6 +13,4 @@ class CfgPatches {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
#include "CfgEventHandlers.hpp"
|
#include "CfgEventHandlers.hpp"
|
||||||
#include "CfgFactionClasses.hpp"
|
|
||||||
#include "CfgVehicles.hpp"
|
|
@ -8,11 +8,11 @@
|
|||||||
* 0: ID of the task <STRING>
|
* 0: ID of the task <STRING>
|
||||||
* 1: Amount of targets escaped to fail the task <NUMBER>
|
* 1: Amount of targets escaped to fail the task <NUMBER>
|
||||||
* 2: Amount of targets eliminated to complete the task <NUMBER>
|
* 2: Amount of targets eliminated to complete the task <NUMBER>
|
||||||
* 3: Amount of funds the company recieves if the task is successful <NUMBER> (default: 0)
|
* 3: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
|
||||||
* 4: Amount of rating the company and player lose if the task is failed <NUMBER> (default: 0)
|
* 4: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
|
||||||
* 5: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
|
* 5: Amount of funds the company recieves if the task is successful <NUMBER> (default: 0)
|
||||||
* 6: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
|
* 6: Amount of rating the company and player lose if the task is failed <NUMBER> (default: 0)
|
||||||
* 7: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
|
* 7: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
|
||||||
* 8: Amount of time before target(s) escape <NUMBER> (default: nil)
|
* 8: Amount of time before target(s) escape <NUMBER> (default: nil)
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
@ -25,38 +25,52 @@
|
|||||||
* Public: Yes
|
* 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"];
|
params [["_taskID", ""], ["_limitFail", -1], ["_limitSuccess", -1], ["_companyFunds", 0], ["_ratingFail", 0], ["_ratingSuccess", 0], ["_endSuccess", false], ["_endFail", false], "_time"];
|
||||||
|
|
||||||
private _result = 0;
|
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 _targets = GVAR(allTargets) select { (_x getVariable ["assignedTask", ""]) == _taskID };
|
||||||
private _startTime = if (!isNil "_time") then { floor(time) } else { nil };
|
|
||||||
|
|
||||||
waitUntil {
|
// Mission Initialization.
|
||||||
sleep 1;
|
if (!isNil "_time") then {
|
||||||
|
// Mission Watchdog checks for example Timeout, killed Targets
|
||||||
|
private _startTime = floor(time);
|
||||||
|
waitUntil {
|
||||||
|
sleep 1; // Use sleep on server side!
|
||||||
|
|
||||||
private _targetsKilled = ({ !alive _x } count _targets);
|
// Timeout check
|
||||||
|
private _currTime = floor(time);
|
||||||
|
if (_currTime - _startTime >= _time) then { _result = 1; };
|
||||||
|
|
||||||
if (!isNil "_time") then {
|
// Check if targets are killed
|
||||||
private _timeExpired = (floor time - _startTime >= _time);
|
private _targetsAlive = ({ !alive _x } count _targets);
|
||||||
|
|
||||||
if (_targetsKilled < _limitSuccess && _timeExpired) then { _result = 1; };
|
// Trigger Conditions
|
||||||
|
(_result == 1) OR (_targetsAlive >= _limitSuccess)
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
// Mission Watchdog checks for example Killed targets
|
||||||
|
waitUntil {
|
||||||
|
sleep 1; // Use sleep on server side!
|
||||||
|
|
||||||
(_result == 1) or (_targetsKilled >= _limitSuccess)
|
// Check if targets are killed
|
||||||
} else {
|
private _targetsAlive = ({ !alive _x } count _targets);
|
||||||
(_targetsKilled >= _limitSuccess)
|
|
||||||
|
// Trigger Conditions
|
||||||
|
(_targetsAlive >= _limitSuccess)
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_result == 1) then {
|
if (_result == 1) then {
|
||||||
|
// Mission Failed
|
||||||
|
// Clean-up Targets
|
||||||
|
|
||||||
{ deleteVehicle _x } forEach _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);
|
[_taskID, "FAILED"] call BFUNC(taskSetState);
|
||||||
|
|
||||||
if (_endFail) then {
|
if (_endFail) then {
|
||||||
@ -69,8 +83,14 @@ if (_result == 1) then {
|
|||||||
|
|
||||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||||
} else {
|
} else {
|
||||||
|
// Mission Complete
|
||||||
|
// Clean-up Targets
|
||||||
|
|
||||||
{ deleteVehicle _x } forEach _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);
|
[_taskID, "SUCCEEDED"] call BFUNC(taskSetState);
|
||||||
|
|
||||||
if (_endSuccess) then {
|
if (_endSuccess) then {
|
||||||
@ -84,4 +104,7 @@ if (_result == 1) then {
|
|||||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||||
|
|
||||||
["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
|
["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Reset Mission Spot
|
||||||
|
// Like delete Markers or other stuff for example Logging
|
@ -1,32 +0,0 @@
|
|||||||
#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;
|
|
@ -8,11 +8,11 @@
|
|||||||
* 0: ID of the task <STRING>
|
* 0: ID of the task <STRING>
|
||||||
* 1: Amount of entities destroyed to fail the task <NUMBER>
|
* 1: Amount of entities destroyed to fail the task <NUMBER>
|
||||||
* 2: Amount of ieds defused to complete the task <NUMBER>
|
* 2: Amount of ieds defused to complete the task <NUMBER>
|
||||||
* 3: Amount of funds the company recieves if the task is successful <NUMBER> (default: 0)
|
* 3: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
|
||||||
* 4: Amount of rating the company and player lose if the task is failed <NUMBER> (default: 0)
|
* 4: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
|
||||||
* 5: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
|
* 5: Amount of funds the company recieves if the task is successful <NUMBER> (default: 0)
|
||||||
* 6: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
|
* 6: Amount of rating the company and player lose if the task is failed <NUMBER> (default: 0)
|
||||||
* 7: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
|
* 7: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* None
|
* None
|
||||||
@ -23,39 +23,41 @@
|
|||||||
* Public: Yes
|
* 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]];
|
params [["_taskID", ""], ["_limitFail", -1], ["_limitSuccess", -1], ["_companyFunds", 0], ["_ratingFail", 0], ["_ratingSuccess", 0], ["_endSuccess", false], ["_endFail", false]];
|
||||||
|
|
||||||
private _result = 0;
|
private _result = 0;
|
||||||
|
|
||||||
waitUntil {
|
// Get the IED(s) assigned to taskID
|
||||||
sleep 1;
|
|
||||||
_ieds = GVAR(allIEDs) select { (_x getVariable ["assignedTask", ""]) == _taskID };
|
|
||||||
count _ieds > 0
|
|
||||||
};
|
|
||||||
|
|
||||||
waitUntil {
|
|
||||||
sleep 1;
|
|
||||||
_entities = GVAR(allEntities) select { (_x getVariable ["assignedTask", ""]) == _taskID };
|
|
||||||
count _entities > 0
|
|
||||||
};
|
|
||||||
|
|
||||||
private _ieds = GVAR(allIEDs) select { (_x getVariable ["assignedTask", ""]) == _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 };
|
private _entities = GVAR(allEntities) select { (_x getVariable ["assignedTask", ""]) == _taskID };
|
||||||
|
|
||||||
|
// Mission Initialization.
|
||||||
|
// Mission Watchdog checks for example Defused IEDs, Destroyed entities
|
||||||
waitUntil {
|
waitUntil {
|
||||||
sleep 1;
|
sleep 1; // Use sleep on server side!
|
||||||
|
|
||||||
private _entitiesDestroyed = ({ !alive _x } count _entities);
|
// Check if entities are killed
|
||||||
|
private _entitiesAlive = ({ !alive _x } count _entities);
|
||||||
|
if (_entitiesAlive >= _limitFail) then { _result = 1; };
|
||||||
|
|
||||||
if (_entitiesDestroyed >= _limitFail) then { _result = 1; };
|
// Trigger Conditions
|
||||||
|
(_result == 1) OR ((GVAR(defusedCount) >= _limitSuccess) && (_entitiesAlive < _limitFail))
|
||||||
(_result == 1) or ((GVAR(defusedCount) >= _limitSuccess) && (_entitiesDestroyed < _limitFail))
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Mission Watchdog checks for example Defused IEDs, destroyed entities
|
||||||
if (_result == 1) then {
|
if (_result == 1) then {
|
||||||
|
// Mission Failed
|
||||||
|
// Clean-up IEDs and entities
|
||||||
|
|
||||||
{ deleteVehicle _x } forEach _ieds;
|
{ deleteVehicle _x } forEach _ieds;
|
||||||
{ deleteVehicle _x } forEach _entities;
|
{ 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);
|
[_taskID, "FAILED"] call BFUNC(taskSetState);
|
||||||
|
|
||||||
if (_endFail) then {
|
if (_endFail) then {
|
||||||
@ -68,9 +70,15 @@ if (_result == 1) then {
|
|||||||
|
|
||||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||||
} else {
|
} else {
|
||||||
|
// Mission Complete
|
||||||
|
// Clean-up IEDs and entities
|
||||||
|
|
||||||
{ deleteVehicle _x } forEach _ieds;
|
{ deleteVehicle _x } forEach _ieds;
|
||||||
{ deleteVehicle _x } forEach _entities;
|
{ 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);
|
[_taskID, "SUCCEEDED"] call BFUNC(taskSetState);
|
||||||
|
|
||||||
if (_endSuccess) then {
|
if (_endSuccess) then {
|
||||||
@ -86,4 +94,7 @@ if (_result == 1) then {
|
|||||||
["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
|
["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Reset Mission Spot
|
||||||
|
// Like delete Markers or other stuff for example Logging
|
||||||
|
|
||||||
GVAR(defusedCount) = 0;
|
GVAR(defusedCount) = 0;
|
@ -1,45 +0,0 @@
|
|||||||
#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;
|
|
@ -8,11 +8,11 @@
|
|||||||
* 0: ID of the task <STRING>
|
* 0: ID of the task <STRING>
|
||||||
* 1: Amount of targets escaped to fail the task <NUMBER>
|
* 1: Amount of targets escaped to fail the task <NUMBER>
|
||||||
* 2: Amount of targets eliminated to complete the task <NUMBER>
|
* 2: Amount of targets eliminated to complete the task <NUMBER>
|
||||||
* 3: Amount of funds the company recieves if the task is successful <NUMBER> (default: 0)
|
* 3: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
|
||||||
* 4: Amount of rating the company and player lose if the task is failed <NUMBER> (default: 0)
|
* 4: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
|
||||||
* 5: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
|
* 5: Amount of funds the company recieves if the task is successful <NUMBER> (default: 0)
|
||||||
* 6: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
|
* 6: Amount of rating the company and player lose if the task is failed <NUMBER> (default: 0)
|
||||||
* 7: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
|
* 7: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
|
||||||
* 8: Amount of time before target(s) escape <NUMBER> (default: nil)
|
* 8: Amount of time before target(s) escape <NUMBER> (default: nil)
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
@ -25,38 +25,53 @@
|
|||||||
* Public: Yes
|
* 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"];
|
params [["_taskID", ""], ["_limitFail", -1], ["_limitSuccess", -1], ["_companyFunds", 0], ["_ratingFail", 0], ["_ratingSuccess", 0], ["_endSuccess", false], ["_endFail", false], "_time"];
|
||||||
|
|
||||||
private _result = 0;
|
private _result = 0;
|
||||||
|
|
||||||
waitUntil {
|
// Get the targets assigned to taskID
|
||||||
sleep 1;
|
|
||||||
_targets = GVAR(allTargets) select { (_x getVariable ["assignedTask", ""]) == _taskID };
|
|
||||||
count _targets > 0
|
|
||||||
};
|
|
||||||
|
|
||||||
private _targets = GVAR(allTargets) select { (_x getVariable ["assignedTask", ""]) == _taskID };
|
private _targets = GVAR(allTargets) select { (_x getVariable ["assignedTask", ""]) == _taskID };
|
||||||
private _startTime = if (!isNil "_time") then { floor(time) } else { nil };
|
|
||||||
|
|
||||||
waitUntil {
|
// Mission Initialization.
|
||||||
sleep 1;
|
if (!isNil "_time") then {
|
||||||
|
// Mission Watchdog checks for example Timeout, Destroyed Targets
|
||||||
|
private _startTime = floor(time);
|
||||||
|
waitUntil {
|
||||||
|
sleep 1; // Use sleep on server side!
|
||||||
|
|
||||||
private _targetsDestroyed = ({ !alive _x } count _targets);
|
// Timeout check
|
||||||
|
private _currTime = floor(time);
|
||||||
|
if (_currTime - _startTime >= _time) then { _result = 1; };
|
||||||
|
|
||||||
if (!isNil "_time") then {
|
// Check if targets are killed
|
||||||
private _timeExpired = (floor time - _startTime >= _time);
|
private _targetsAlive = ({ !alive _x } count _targets);
|
||||||
|
|
||||||
if (_targetsDestroyed < _limitSuccess && _timeExpired) then { _result = 1; };
|
// Trigger Conditions
|
||||||
|
(_result == 1) OR (_targetsAlive >= _limitSuccess)
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
// Mission Watchdog checks for example killed Targets
|
||||||
|
waitUntil {
|
||||||
|
sleep 1; // Use sleep on server side!
|
||||||
|
|
||||||
(_result == 1) or (_targetsDestroyed >= _limitSuccess)
|
// Check if targets are killed
|
||||||
} else {
|
private _targetsAlive = ({ !alive _x } count _targets);
|
||||||
(_targetsDestroyed >= _limitSuccess)
|
|
||||||
|
// Trigger Conditions
|
||||||
|
(_targetsAlive >= _limitSuccess)
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_result == 1) then {
|
if (_result == 1) then {
|
||||||
|
// Mission Failed
|
||||||
|
// Clean-up Targets
|
||||||
|
|
||||||
{ deleteVehicle _x } forEach _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);
|
[_taskID, "FAILED"] call BFUNC(taskSetState);
|
||||||
|
|
||||||
if (_endFail) then {
|
if (_endFail) then {
|
||||||
@ -69,8 +84,14 @@ if (_result == 1) then {
|
|||||||
|
|
||||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||||
} else {
|
} else {
|
||||||
|
// Mission Complete
|
||||||
|
// Clean-up Targets
|
||||||
|
|
||||||
{ deleteVehicle _x } forEach _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);
|
[_taskID, "SUCCEEDED"] call BFUNC(taskSetState);
|
||||||
|
|
||||||
if (_endSuccess) then {
|
if (_endSuccess) then {
|
||||||
@ -84,4 +105,7 @@ if (_result == 1) then {
|
|||||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||||
|
|
||||||
["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
|
["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Reset Mission Spot
|
||||||
|
// Like delete Markers or other stuff for example Logging
|
@ -1,32 +0,0 @@
|
|||||||
#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;
|
|
@ -1,5 +0,0 @@
|
|||||||
#include "..\script_component.hpp"
|
|
||||||
|
|
||||||
params [["_logic", objNull, [objNull]], ["_units", [], [[]]], ["_activated", true, [true]]];
|
|
||||||
|
|
||||||
if !(_activated) exitWith {};
|
|
@ -22,6 +22,9 @@ params [["_taskType", "", [""]], ["_cntParams", [], [[]]], ["_minRating", 0, [0]
|
|||||||
|
|
||||||
private _thread = 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;
|
GVAR(acceptTask) = false;
|
||||||
|
|
||||||
if (isNil "companyRating") then { companyRating = 0; };
|
if (isNil "companyRating") then { companyRating = 0; };
|
||||||
@ -32,6 +35,7 @@ if (_companyRating < _minRating) exitWith {
|
|||||||
hint format ["The company rating of %1 does not meet or exceed the minimum required rating of %2.", _companyRating, _minRating];
|
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 {
|
switch (_taskType) do {
|
||||||
case "attack": {
|
case "attack": {
|
||||||
private _thread = _cntParams spawn FUNC(attack);
|
private _thread = _cntParams spawn FUNC(attack);
|
||||||
@ -60,4 +64,7 @@ switch (_taskType) do {
|
|||||||
|
|
||||||
diag_log "Mision Handler Done";
|
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;
|
GVAR(acceptTask) = true;
|
@ -20,8 +20,6 @@
|
|||||||
|
|
||||||
params [["_entity", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_typeOf", "", [""]], ["_time", 0, [0]]];
|
params [["_entity", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_typeOf", "", [""]], ["_time", 0, [0]]];
|
||||||
|
|
||||||
private _nearPlayers = [];
|
|
||||||
|
|
||||||
switch (_typeOf) do {
|
switch (_typeOf) do {
|
||||||
case "hostage": {
|
case "hostage": {
|
||||||
_entity setCaptive true;
|
_entity setCaptive true;
|
||||||
@ -30,7 +28,7 @@ switch (_typeOf) do {
|
|||||||
|
|
||||||
waitUntil {
|
waitUntil {
|
||||||
sleep 1;
|
sleep 1;
|
||||||
_nearPlayers = allPlayers inAreaArray [ASLToAGL getPosASL _entity, 2, 2, 0, false, 2];
|
private _nearPlayers = allPlayers inAreaArray [ASLToAGL getPosASL _entity, 2, 2, 0, false, 2];
|
||||||
count _nearPlayers > 0
|
count _nearPlayers > 0
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -45,7 +43,7 @@ switch (_typeOf) do {
|
|||||||
case "hvt": {
|
case "hvt": {
|
||||||
waitUntil {
|
waitUntil {
|
||||||
sleep 1;
|
sleep 1;
|
||||||
_nearPlayers = allPlayers inAreaArray [ASLToAGL getPosASL _entity, 2, 2, 0, false, 2];
|
private _nearPlayers = allPlayers inAreaArray [ASLToAGL getPosASL _entity, 2, 2, 0, false, 2];
|
||||||
count _nearPlayers > 0
|
count _nearPlayers > 0
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -53,16 +51,14 @@ switch (_typeOf) do {
|
|||||||
doStop _entity;
|
doStop _entity;
|
||||||
};
|
};
|
||||||
case "ied": {
|
case "ied": {
|
||||||
while { alive _entity && _time > 0} do {
|
_time = _time -1;
|
||||||
if (_time > 10) then { _entity say3D "FORGE_timerBeep" };
|
sleep 1;
|
||||||
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 && _time <= 0) then { _entity setDamage 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 };
|
||||||
};
|
};
|
||||||
};
|
};
|
@ -9,12 +9,12 @@
|
|||||||
* 1: Amount of hostages KIA to fail the task <NUMBER>
|
* 1: Amount of hostages KIA to fail the task <NUMBER>
|
||||||
* 2: Amount of hostages rescued to complete the task <NUMBER>
|
* 2: Amount of hostages rescued to complete the task <NUMBER>
|
||||||
* 3: Marker name for the extraction zone <STRING>
|
* 3: Marker name for the extraction zone <STRING>
|
||||||
* 4: Amount of funds the company recieves if the task is successful <NUMBER> (default: 0)
|
* 4: Subcategory of task <ARRAY> (default: [false, true])
|
||||||
* 5: Amount of rating the company and player lose if the task is failed <NUMBER> (default: 0)
|
* 5: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
|
||||||
* 6: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
|
* 6: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
|
||||||
* 7: Subcategory of task <ARRAY> (default: [false, true])
|
* 7: Amount of funds the company recieves if the task is successful <NUMBER> (default: 0)
|
||||||
* 8: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
|
* 8: Amount of rating the company and player lose if the task is failed <NUMBER> (default: 0)
|
||||||
* 9: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
|
* 9: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
|
||||||
* 10: Amount of time before hostage(s) die <NUMBER> (default: nil)
|
* 10: Amount of time before hostage(s) die <NUMBER> (default: nil)
|
||||||
* 11: Marker name for the cbrn zone <STRING> (default: nil)
|
* 11: Marker name for the cbrn zone <STRING> (default: nil)
|
||||||
*
|
*
|
||||||
@ -29,61 +29,80 @@
|
|||||||
* Public: Yes
|
* 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", ""]];
|
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 7) select 0;
|
private _cbrn = (_this select 8) select 0;
|
||||||
private _hostage = (_this select 7) select 1;
|
private _hostage = (_this select 8) select 1;
|
||||||
|
private _nearPlayers = [];
|
||||||
private _result = 0;
|
private _result = 0;
|
||||||
|
|
||||||
waitUntil {
|
// Get the hostages
|
||||||
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 };
|
private _hostages = GVAR(allHostages) select { (_x getVariable ["assignedTask", ""]) == _taskID };
|
||||||
|
|
||||||
|
// Get the shooters
|
||||||
private _shooters = GVAR(allShooters) select { (_x getVariable ["assignedTask", ""]) == _taskID };
|
private _shooters = GVAR(allShooters) select { (_x getVariable ["assignedTask", ""]) == _taskID };
|
||||||
private _startTime = if (!isNil "_time") then { floor(time) } else { nil };
|
|
||||||
|
|
||||||
waitUntil {
|
// Mission Initialization.
|
||||||
sleep 1;
|
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!
|
||||||
|
|
||||||
private _hostagesFreed = ({ !captive _x } count _hostages);
|
// Check if hostages are killed
|
||||||
private _hostagesInZone = ({ _x inArea _extZone } count _hostages);
|
private _hostagesAlive = ({ !alive _x } count _hostages);
|
||||||
private _hostagesKilled = ({ !alive _x } count _hostages);
|
if (_hostagesAlive >= _limitFail) then { _result = 1; };
|
||||||
private _shootersAlive = ({ alive _x } count _shooters);
|
|
||||||
|
|
||||||
if (!isNil "_time") then {
|
// Check if hostages are in extraction zone
|
||||||
private _timeExpired = (floor time - _startTime >= _time);
|
private _hostagesInZone = ({ _x inArea _extZone } count _hostages);
|
||||||
|
|
||||||
if (_hostagesFreed < _limitSuccess && _timeExpired) then { _result = 1; };
|
// Check if hostages are captive
|
||||||
if (_hostagesKilled >= _limitFail) then { _result = 1; };
|
private _hostagesCaptive = ({ !captive _x } count _hostages);
|
||||||
|
|
||||||
(_result == 1) or
|
// Check if shooters are killed
|
||||||
((_hostagesInZone >= _limitSuccess) && (_hostagesKilled < _limitFail)) or
|
private _shootersAlive = ({ alive _x } count _shooters);
|
||||||
((!isNil "_shooters") && (_shootersAlive <= 0) && (_hostagesInZone >= _limitSuccess) && (_hostagesKilled < _limitFail))
|
|
||||||
} else {
|
// Timeout check
|
||||||
if (_hostagesKilled >= _limitFail) then { _result = 1; };
|
private _currTime = floor(time);
|
||||||
|
if ((_hostagesCaptive < _limitSuccess) && (_currTime - _startTime >= _time)) then { _result = 1; };
|
||||||
(_result == 1) or
|
|
||||||
((_hostagesInZone >= _limitSuccess) && (_hostagesKilled < _limitFail)) or
|
// Trigger Conditions
|
||||||
((!isNil "_shooters") && (_shootersAlive <= 0) && (_hostagesInZone >= _limitSuccess) && (_hostagesKilled < _limitFail))
|
(_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 (_result == 1) then {
|
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 {
|
if (_cbrn) then {
|
||||||
"SmokeShellYellow" createVehicle getMarkerPos _cbrnZone;
|
"SmokeShellYellow" createVehicle getMarkerPos _cbrnZone;
|
||||||
|
|
||||||
sleep 5;
|
sleep 5;
|
||||||
|
|
||||||
{
|
{
|
||||||
if (captive _x) then {
|
if (captive _x) then {
|
||||||
_x setDamage 0.9;
|
_x setDamage 0.9;
|
||||||
_x playMove "acts_executionvictim_kill_end";
|
_x playMove "acts_executionvictim_kill_end";
|
||||||
@ -95,6 +114,7 @@ if (_result == 1) then {
|
|||||||
} forEach _hostages;
|
} forEach _hostages;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Check if task is typeOf Hostage(s)
|
||||||
if (_hostage) then {
|
if (_hostage) then {
|
||||||
{
|
{
|
||||||
_x enableAIFeature ["MOVE", true];
|
_x enableAIFeature ["MOVE", true];
|
||||||
@ -108,6 +128,8 @@ if (_result == 1) then {
|
|||||||
sleep 5;
|
sleep 5;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Clean-up Hostages and Shooters
|
||||||
|
|
||||||
{ deleteVehicle _x } forEach _hostages;
|
{ deleteVehicle _x } forEach _hostages;
|
||||||
{ deleteVehicle _x } forEach _shooters;
|
{ deleteVehicle _x } forEach _shooters;
|
||||||
|
|
||||||
@ -123,9 +145,15 @@ if (_result == 1) then {
|
|||||||
|
|
||||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||||
} else {
|
} else {
|
||||||
|
// Mission Complete
|
||||||
|
// Clean-up Hostages and Shooters
|
||||||
|
|
||||||
{ deleteVehicle _x } forEach _hostages;
|
{ deleteVehicle _x } forEach _hostages;
|
||||||
{ deleteVehicle _x } forEach _shooters;
|
{ 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);
|
[_taskID, "SUCCEEDED"] call BFUNC(taskSetState);
|
||||||
|
|
||||||
if (_endSuccess) then {
|
if (_endSuccess) then {
|
||||||
@ -139,4 +167,7 @@ if (_result == 1) then {
|
|||||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||||
|
|
||||||
["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
|
["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Reset Mission Spot
|
||||||
|
// Like delete Markers or other stuff for example Logging
|
@ -1,54 +0,0 @@
|
|||||||
#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;
|
|
@ -1,5 +0,0 @@
|
|||||||
#include "..\script_component.hpp"
|
|
||||||
|
|
||||||
params [["_logic", objNull, [objNull]], ["_units", [], [[]]], ["_activated", true, [true]]];
|
|
||||||
|
|
||||||
if !(_activated) exitWith {};
|
|
@ -9,12 +9,12 @@
|
|||||||
* 1: Amount of HVTs KIA to fail the task <NUMBER>
|
* 1: Amount of HVTs KIA to fail the task <NUMBER>
|
||||||
* 2: Amount of HVTs Captured or KIA to complete the task <NUMBER>
|
* 2: Amount of HVTs Captured or KIA to complete the task <NUMBER>
|
||||||
* 3: Marker name for the extraction zone <STRING>
|
* 3: Marker name for the extraction zone <STRING>
|
||||||
* 4: Amount of funds the company recieves if the task is successful <NUMBER> (default: 0)
|
* 4: Subcategory of task <ARRAY> (default: [true, false])
|
||||||
* 5: Amount of rating the company and player lose if the task is failed <NUMBER> (default: 0)
|
* 5: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
|
||||||
* 6: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
|
* 6: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
|
||||||
* 7: Subcategory of task <ARRAY> (default: [true, false])
|
* 7: Amount of funds the company recieves if the task is successful <NUMBER> (default: 0)
|
||||||
* 8: Should the mission end (MissionSuccess) if the task is successful <BOOL> (default: false)
|
* 8: Amount of rating the company and player lose if the task is failed <NUMBER> (default: 0)
|
||||||
* 9: Should the mission end (MissionFailed) if the task is failed <BOOL> (default: false)
|
* 9: Amount of rating the company and player recieve if the task is successful <NUMBER> (default: 0)
|
||||||
* 10: Amount of time before hvt(s) die <NUMBER> (default: nil)
|
* 10: Amount of time before hvt(s) die <NUMBER> (default: nil)
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
@ -29,46 +29,67 @@
|
|||||||
* Public: Yes
|
* 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"];
|
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 _capture = (_this select 7) select 0;
|
||||||
private _eliminate = (_this select 7) select 1;
|
private _eliminate = (_this select 7) select 1;
|
||||||
|
private _nearPlayers = [];
|
||||||
private _result = 0;
|
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 _hvts = GVAR(allHVTs) select { (_x getVariable ["assignedTask", ""]) == _taskID };
|
||||||
private _startTime = if (!isNil "_time") then { floor(time) } else { nil };
|
|
||||||
|
|
||||||
waitUntil {
|
// Mission Initialization.
|
||||||
sleep 1;
|
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!
|
||||||
|
|
||||||
private _hvtsCaptive = ({ captive _x } count _hvts);
|
// Check if hvts are killed
|
||||||
private _hvtsKilled = ({ !alive _x } count _hvts);
|
private _hvtsAlive = ({ !alive _x } count _hvts);
|
||||||
private _hvtsInZone = ({ _x inArea _extZone } count _hvts);
|
if (_capture && (_hvtsAlive >= _limitFail)) then { _result = 1; };
|
||||||
|
|
||||||
if (!isNil "_time") then {
|
// Check if hvts are in extraction zone
|
||||||
private _timeExpired = (floor time - _startTime >= _time);
|
private _hvtsInZone = ({ _x inArea _extZone } count _hvts);
|
||||||
|
|
||||||
if (_capture && _hvtsKilled >= _limitFail) then { _result = 1; };
|
// Check if hvts are captive
|
||||||
if (_capture && _hvtsCaptive < _limitSuccess && _timeExpired) then { _result = 1; };
|
private _hvtsCaptive = ({ captive _x } count _hvts);
|
||||||
if (_eliminate && _hvtsKilled < _limitSuccess && _timeExpired) then { _result = 1; };
|
|
||||||
|
|
||||||
(_result == 1) or (_capture && (_hvtsInZone >= _limitSuccess) && (_hvtsKilled < _limitFail)) or (_eliminate && (_hvtsKilled >= _limitSuccess))
|
// Timeout check
|
||||||
} else {
|
private _currTime = floor(time);
|
||||||
if (_capture && (_hvtsKilled >= _limitFail)) then { _result = 1; };
|
if ((_hvtsCaptive < _limitSuccess) && (_currTime - _startTime >= _time)) then { _result = 1; };
|
||||||
|
|
||||||
(_result == 1) or (_capture && (_hvtsInZone >= _limitSuccess) && (_hvtsKilled < _limitFail)) or (_eliminate && (_hvtsKilled >= _limitSuccess))
|
// 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)
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_result == 1) then {
|
if (_result == 1) then {
|
||||||
|
// Mission Failed
|
||||||
|
// Clean-up HVTs
|
||||||
{ deleteVehicle _x } forEach _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);
|
[_taskID, "FAILED"] call BFUNC(taskSetState);
|
||||||
|
|
||||||
if (_endFail) then {
|
if (_endFail) then {
|
||||||
@ -81,8 +102,14 @@ if (_result == 1) then {
|
|||||||
|
|
||||||
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
{ [_x, _ratingFail] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||||
} else {
|
} else {
|
||||||
|
// Mission Complete
|
||||||
|
// Clean-up HVTs
|
||||||
|
|
||||||
{ deleteVehicle _x } forEach _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);
|
[_taskID, "SUCCEEDED"] call BFUNC(taskSetState);
|
||||||
|
|
||||||
if (_endSuccess) then {
|
if (_endSuccess) then {
|
||||||
@ -96,4 +123,7 @@ if (_result == 1) then {
|
|||||||
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
{ [_x, _ratingSuccess] remoteExec ["addRating", -2] } forEach allPlayers;
|
||||||
|
|
||||||
["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
|
["advance", _companyFunds] remoteExecCall ["forge_server_money_fnc_handleFunds", 2];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Reset Mission Spot
|
||||||
|
// Like delete Markers or other stuff for example Logging
|
@ -1,38 +0,0 @@
|
|||||||
#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;
|
|
@ -19,9 +19,25 @@
|
|||||||
|
|
||||||
params [["_entity", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_taskID", "", [""]]];
|
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);
|
SETVAR(_entity,assignedTask,_taskID);
|
||||||
GVAR(allHVTs) pushBackUnique _entity;
|
|
||||||
|
// Add unit to hvt array
|
||||||
|
private _index = GVAR(allHVTs) pushBackUnique _entity;
|
||||||
|
|
||||||
if (alive _entity) then {
|
if (alive _entity) then {
|
||||||
[_entity, "hvt"] spawn FUNC(heartBeat);
|
[_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;
|
||||||
|
// };
|
@ -19,11 +19,28 @@
|
|||||||
|
|
||||||
params [["_entity", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_taskID", "", [""]]];
|
params [["_entity", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_taskID", "", [""]]];
|
||||||
|
|
||||||
diag_log format ["[FORGE] Make Hostage: %1", _this];
|
private _nearPlayers = [];
|
||||||
|
|
||||||
|
// 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);
|
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 {
|
if (alive _entity) then {
|
||||||
[_entity, "hostage"] spawn FUNC(heartBeat);
|
[_entity, "hostage"] spawn FUNC(heartBeat);
|
||||||
};
|
};
|
@ -20,7 +20,30 @@
|
|||||||
|
|
||||||
params [["_entity", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_taskID", "", [""]], ["_time", 0, [0]]];
|
params [["_entity", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_taskID", "", [""]], ["_time", 0, [0]]];
|
||||||
|
|
||||||
SETVAR(_entity,assignedTask,_taskID);
|
// Check if IED is defined
|
||||||
GVAR(allIEDs) pushBackUnique _entity;
|
// if (isNull _entity) exitWith {
|
||||||
|
// [COMPONENT_NAME, "ERROR", "IED is not found", true] call forge_server_main_fnc_log
|
||||||
|
// };
|
||||||
|
|
||||||
[_entity, "ied", _time] spawn FUNC(heartBeat);
|
// 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);
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
};
|
@ -19,5 +19,25 @@
|
|||||||
|
|
||||||
params [["_entity", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_taskID", "", [""]]];
|
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);
|
SETVAR(_entity,assignedTask,_taskID);
|
||||||
GVAR(allEntities) pushBackUnique _entity;
|
|
||||||
|
// 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;
|
||||||
|
// };
|
@ -1,25 +0,0 @@
|
|||||||
#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;
|
|
@ -19,5 +19,21 @@
|
|||||||
|
|
||||||
params [["_entity", nil, [objNull, 0, [], sideUnknown, grpNull, ""]], ["_taskID", "", [""]]];
|
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);
|
SETVAR(_entity,assignedTask,_taskID);
|
||||||
GVAR(allTargets) pushBackUnique _entity;
|
|
||||||
|
// 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;
|
||||||
|
// };
|
@ -1,5 +0,0 @@
|
|||||||
#include "..\script_component.hpp"
|
|
||||||
|
|
||||||
params [["_logic", objNull, [objNull]], ["_units", [], [[]]], ["_activated", true, [true]]];
|
|
||||||
|
|
||||||
if !(_activated) exitWith {};
|
|
@ -1,5 +0,0 @@
|
|||||||
#include "..\script_component.hpp"
|
|
||||||
|
|
||||||
params [["_logic", objNull, [objNull]], ["_units", [], [[]]], ["_activated", true, [true]]];
|
|
||||||
|
|
||||||
if !(_activated) exitWith {};
|
|
Loading…
x
Reference in New Issue
Block a user