C2iSTAR Custom Task Template

  1. 7 years ago

    I think there is an opportunity to create some additional objectives for C2iSTAR. However, I need some direction as far as scripting for this module.

    If someone can provide me a simple template script that does the following, I will love you forever.

    1. Allows player to select task creation position via tablet (same as every other task currently in the system)
    2. Spawns custom composition

    I could totally see this being used to create a whole mess of custom tasks like a simple "destroy the weapon cache" - without Zeus.

  2. Tupolov

    19 Aug 2017 Administrator
    Edited 7 years ago by Tupolov

    You can pretty much take the base tasks to do this.

    The Destroy Vehicles or Destroy Building task can be copied and adjusted as necessary.

    The files you need:

    1. \x\alive\addons\main\static\Tasks.hpp - add the following but change the word Building for whatever you want to destroy and edit as appropriate.

    // Destroy Building Task
    
    	_options = [];
    
    	_tasksData = [] call ALIVE_fnc_hashCreate;
    
    	_taskData = [] call ALIVE_fnc_hashCreate;
    	[_taskData,"title","Destroy Building near %1"] call ALIVE_fnc_hashSet;
    	[_taskData,"description","Destroy the %2 near %1!"] call ALIVE_fnc_hashSet;
    	[_tasksData,"Parent",_taskData] call ALIVE_fnc_hashSet;
    
    	_taskData = [] call ALIVE_fnc_hashCreate;
    	[_taskData,"title","Destroy %1"] call ALIVE_fnc_hashSet;
    	[_taskData,"description","We received intelligence about a strategically important %3 near %1! Destroy the %2!"] call ALIVE_fnc_hashSet;
    	[_taskData,"chat_start",[["HQ","We received intelligence about a strategically relevant position near %1! Destroy the objective!"],["PLAYERS","Roger that"]]] call ALIVE_fnc_hashSet;
    	[_taskData,"chat_success",[["PLAYERS","The objective has been destroyed!"],["HQ","Roger that, well done!"]]] call ALIVE_fnc_hashSet;
    	[_taskData,"reward",["forcePool",10]] call ALIVE_fnc_hashSet;
    	[_tasksData,"Destroy",_taskData] call ALIVE_fnc_hashSet;
    
    	_options set [count _options,_tasksData];
    
    	[ALIVE_generatedTasks, "DestroyBuilding", ["Destroy Installation",_options]] call ALIVE_fnc_hashSet;

    2. Copy \x\alive\addons\mil_c2istar\tasks\fnc_taskDestroyBuilding.sqf (or DestroyVehicle) and name it fnc_taskDestroyMyThing.sqf. Edit the code as necessary

    3. Update \x\alive\addons\mil_c2istar\CfgFunctions.hpp with your new fnc_taskDestroyMyThing.sqf entry.

  3. 6 years ago

    Hi!,

    it is possible to define this task at mission folder an C2ISTAR autotask use it defined at staticdata.sqf?

    thanks!!

 

or Sign Up to reply!