Jump to content
engima

Engima's Simple Tasks Script Release

Recommended Posts

y4mzaydyd9qtNX7Mgq7TeKp3mLHVPcuzPMLxaAFQ

 

Engima's Simple Tasks v1.17

by Engima

 
Description:
Engima's Simple Tasks is a script that manages mission objectives (tasks) in a mission.

The idéa behind this task system is to simplify task management in multiplayer missions. With this script you do not need to think about locality and call contexts. All tasks are always synchronized for all players on the network, which is often suitable for a COOP mission.
 
Download:
Download Link at Armaholic.
Also released as CPack Engima.SimpleTasks for the TypeSqf Editor.
 
Installation:
1. Copy folder "Engima" and file "MissionTasks.sqf" to root of your mission folder.
2. Create the file "init.sqf" in your mission folder (if you don't already have it). Add the following line to the top of the init.sqf:

call compile preprocessFileLineNumbers "Engima\SimpleTasks\Init.sqf";

3. Customize the list of mission's initial tasks in the file "MissionTasks.sqf".
 
Usage:
Edit the file "MissionTasks.sqf" in the mission's root folder to set up initial mission tasks. Information about how to do this you can find in file "Engima\SimpleTasks\Documentation.sqf" that is included in the package.
There are a bunch of functions that can read and manipulate your tasks. You can get and set task state, description, destination and target, as well as creating new tasks and deleting existing tasks. Here are some examples.
To set task state on an existing task:

["ExampleTask", "SUCCEEDED."] call ENGTASKS_SetTaskState;

To create a new task:

["NewTask", "This is new task."] call ENGTASKS_CreateTask;

To set description on an existing task:

["NewTask", ["Short description.", "A very long description"]] call ENGTASKS_SetTaskDescription;

All functions can be called from any context, and task list / task state is updated on all machines in the network, including JIP. For a complete reference, see file "Engima\SimpleTasks\Documentation.sqf".

How to update from older version:
Manually:
1. Remove the folder Engima\SimpleTasks and replace it with the corresponding folder in the download package (do not replace file MissionTasks.sqf in root folder.)

TypeSqf Editor:
1. Open the CPack console and run command "update Engima.SimpleTasks".

Change log:

v.1.17
- Fixed: Task destination and task target didn't work.

v.1.16
- Fixed bug that caused script error if none of the initial tasks had state ASSIGNED.

v1.15
- Task set to status ASSIGNED is now automatically selected as "current task".

v1.10
- Tasks can now have long descriptions.
- New function: ENGTASKS_GetTaskFullDescription.

v1.0
- New function: DeleteTask.
- New set functions: SetTaskDescription, SetTaskDestination, SetTaskTarget.
- New get functions: GetTaskDescription, GetTaskState, GetTaskDestination, GetTaskTarget.
- Added parameter "showNotification" on all setter functions.
- Fixed: Didn't work when team switching.

v0.8
- First version
 
Requirements:
Tested in Arma 3.

  • Like 5

Share this post


Link to post
Share on other sites

It's automatically synchronized among players in multiplayer. No need to think of locality and function call contexts. All players always have the same tasks and task states. I've found this is most often how I want it to be in my COOP missions, so i simplified that as much as I could.

Share this post


Link to post
Share on other sites

Nice!

 

 

 * ENGTASKS_CreateTask
 * Description:        Creates a task on all machines.

Maybe you can add the possibility to create a task only for person x or side y.

This might be good for TvT or COOP.

 

 

if (count _this > 2) then { _taskState = _this select 2; } else { _taskState = "CREATED"; };

Maybe for future use you might want to use param

_taskState = param[2, "CREATED"];

Share this post


Link to post
Share on other sites

This looks great!

 

  I have added all the necessary files and folders to a Mission WIP,

added the pre-process line to the init.sqf,

however the tasks I set in MissionTasks.sqf are not initializing?

 

Here is what I have in the MissionTasks.sqf:

ENGTASKS_TaskList = [
    ["ClearMGArea", "Clear the Area around the MG Emplacements", "ASSIGNED"]
    ];

How did I miss something?!

 

*Update:- I was running several mods for the Mission, and without them, the self-same MissionTask loads fine...

 

Any chance of test running engima alongside @IF and finding out why it breaks?

Share this post


Link to post
Share on other sites

Maybe you can add the possibility to create a task only for person x or side y.

This might be good for TvT or COOP.

 

Maybe for future use you might want to use param

_taskState = param[2, "CREATED"];

Yes. Problem with that is that it will not be "simple" anymore. But maybe I can release a similar but in that sense "advanced" version of the script. Thanks for the tip on param btw!

Share this post


Link to post
Share on other sites

Hey Enigma! Awesome script! It's work very well so far.

 

I noticed you have no entry for a long desciption, or I don't know how to enter it, only the task name (basically the script handle) and the short description (actual name of the task) which is shown on the notifications. can you add a the ability to add the long description so players can go into the map/task and read in detail what is required of the task??

 

Also can you add a function to set a desired task as current for evryone on the server and JIP?

Share this post


Link to post
Share on other sites

Fantastic work, after nexus patch this can save my life :)

 

Just one thing, I will use his work to create scripted tasks like this:

fn_spawnCommsMission = {

	hint "UPDATED SPECIAL OPS";
	//creating the marker
	
	_markerArray = ["commsmkr_1","commsmkr_2","commsmkr_3","commsmkr_4","commsmkr_5","commsmkr_6"];
	_rnd 	= floor (random (count(_markerArray)));
	_mrkSpawnPos = getMarkerPos (_markerArray select _rnd);  

	_markerSO = createMarker ["mob_comms", _mrkSpawnPos];
	_markerSO setMarkerShape "empty";

	//creating the vehicle
	
	_newPos = [getMarkerPos _markerSO, 100, 500, 10, 0, 0, 0] call BIS_fnc_findSafePos;
	
	_movilhq = createVehicle ["rhs_gaz66_r142_msv", _newPos, [], 0, "NONE"];
	
	_isFlat_comms = [getMarkerPos _markerSO,500] call getFlatArea;
	_movilhq setPos _isFlat_comms;
	
	_camonet = createVehicle ["CamoNet_OPFOR_big_F", getPos _movilhq, [], 0, "CAN_COLLIDE"];
	
	_markerrtw = createMarker ["rtwmarker", getPos _movilhq];
	_markerrtw setMarkerType "o_support";
	_markerrtw setMarkerColor "ColorRed";
	_markerrtw setMarkerSize [1,1];
	_markerrtw setMarkertext "OPFOR Mobile Comms";
	
	["taskcomms", "Destroy Mobile Comms", "CREATED", true] call ENGTASKS_CreateTask;
	["taskcomms", getMarkerPos "rtwmarker", false] call ENGTASKS_SetTaskDestination;
	
	sleep 10;
	
	_grp1S = [getpos _movilhq, EAST, (configfile >> "CfgGroups" >> "East" >> "LOP_SLA" >> "Infantry" >> "LOP_SLA_Patrol_section")] call BIS_fnc_spawnGroup;
	nul = [_grp1S,getpos _movilhq] call BIS_fnc_taskDefend;
	
	_grp2S = [getpos _movilhq, EAST, (configfile >> "CfgGroups" >> "East" >> "LOP_SLA" >> "Infantry" >> "LOP_SLA_Rifle_squad")] call BIS_fnc_spawnGroup;
	nul = [_grp2S,getpos _movilhq, 150] call BIS_fnc_taskPatrol;

	waitUntil {!alive _movilhq};
	
	["taskcomms", "SUCCEEDED"] call ENGTASKS_SetTaskState;
	
	sleep 10;

	deleteMarker _markerSO;
	deleteMarker _markerrtw;
	deleteVehicle _movilhq;
	deleteVehicle _camonet;
	{deleteVehicle _x} forEach units _grp1S;
	deleteGroup _grp1S;
	{deleteVehicle _x} forEach units _grp2S;
	deleteGroup _grp2S;

	_myHint ="Good Job!";
	GlobalHint = _myHint;
	publicVariable "GlobalHint";
	hintsilent parseText _myHint;
	
	["taskcomms"] call ENGTASKS_DeleteTask;
};

Testing on dedicated server I receive an error about 69 line of Engima\SimpleTasks\Common\Functions.sqf

	if (count _taskTargetDestination > 0) then {
		_isDestination = typename (_taskTargetDestination select 0) == "SCALAR";
		_isTarget = !_isDestination;

However everything seems to work correctly, perhaps there is something I am doing wrong, can you help me?

 

Greets and thanks.

  • Like 1

Share this post


Link to post
Share on other sites

Hi m4rt14l

 

I tried to recreate the error you had, but cannot find anything. It would help if you provided the exact error message that you got. And where is your script executed? On server? Anyway, I've tried server and client, but only thing I can think of right now is that maybe your marker "rtwmarker" does not exist?

 

Regards

Share this post


Link to post
Share on other sites

Hey Enigma! Awesome script! It's work very well so far.

 

I noticed you have no entry for a long desciption, or I don't know how to enter it, only the task name (basically the script handle) and the short description (actual name of the task) which is shown on the notifications. can you add a the ability to add the long description so players can go into the map/task and read in detail what is required of the task??

 

Also can you add a function to set a desired task as current for evryone on the server and JIP?

 

Ability to add long descriptions now added!

Good luck!

Share this post


Link to post
Share on other sites

@ enigma thank you for the script I was never that good with the whole setup of tasks with arma2.

Question when I setup your script I get all three tasks to pick but when I click one nothing shows up on the map. What do I need to do to make the tasks show up?  How can I make up different tasks in a mission.  I know its me not you lol :) what am I doing wrong.

 

1.Get AT Launcher

2.Move To Road

3.Kill Enemy Tank

Share this post


Link to post
Share on other sites

@ enigma thank you for the script I was never that good with the whole setup of tasks with arma2.

Question when I setup your script I get all three tasks to pick but when I click one nothing shows up on the map. What do I need to do to make the tasks show up?  How can I make up different tasks in a mission.  I know its me not you lol :) what am I doing wrong.

 

1.Get AT Launcher

2.Move To Road

3.Kill Enemy Tank

Hi

As you have already found out those tasks are preedited examples. So first of all you are supposed to delete them and add the ones you want in your mission. But lets use them as reference for now.

The task "Move to road" should have a position. The initial tasks are described as arrays, one on each line, in the file MissionTasks.sqf. Change the line for the task to:

["MoveToRoad", "Go to the road", "CREATED", getMarkerPos "roadMarker"],
I make the assimption that you have a marker named "roadMarker" somewhere on a road on the map. Now, if you set the task as current (that you do by clicking "Set as current task" in game), the position will show up on the map.

When you finally get there you could i.e. use a trigger with condition "anyone present" that executes the following command:

["MoveToRoad", "SUCCEEDED"] call ENGTASKS_setTaskState;
Instead of a position you can also send in an object, like this:

["KillEnemyTank", "Kill the tank.", "CREATED", [enemyTank1, true]],
Here you send in an array with two values. The first (enemyTank1) is the tank, and the second (true) is to specify wether you want the exakt position be shown in the HUD, or if you only want to show what your character knows about the tank. Like: "it's supposed to be on the marked area, but it could have changed since it was a while ago its precense was reported".

All this is well documented with examples in file "Engima\SimpleTasks\Documentation.sqf" in the download pack.

Share this post


Link to post
Share on other sites

Updated mod v1.15 available at withSIX. Download now by clicking:

banner-420x120.png

Hey engima , you can upload updates or new mods to withSIX yourself now!

Make your own promo page, get the power to release your work at your own point of choosing.

To learn more, follow this guide.

Share this post


Link to post
Share on other sites

Ok, new version released to fix an embarrasing mistake...

v.1.16

- Fixed bug that caused script error if none of the initial tasks had state ASSIGNED.

Share this post


Link to post
Share on other sites

New mod v1.16 available at withSIX. Download now by clicking:

banner-420x120.png

Hey engima , you can upload updates or new mods to withSIX yourself now!

Make your own promo page, get the power to release your work at your own point of choosing.

To learn more, follow this guide.

Share this post


Link to post
Share on other sites

Yo, how do you set the task destination?

 

["MoveToRoad", "Move to road.", "CREATED", getMarkerPos "road_marker"] as it says in the documentation does not work.

 

I get some kind of "undefined variable in expression" error.

Maybe something changed with the latest Arma updates.

  • Like 1

Share this post


Link to post
Share on other sites

Ok, thanks for notifying me about the problem, Mojo_Dog. I've found the problem and will release a fix as soon as I get the chance to (this evening).

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×