Jump to content
Sign in to follow this  
Hercx

Hercx Task System

Recommended Posts

PjpqR6B.jpg

Description:

This is the first public release of my task system, it was designed by me for use in SPV's multiplayer missions.The system was built

specifically for ArmA 3 taking advantage of all the new scripting commands available in ArmA 3. the system is currently active in two of

our multiplayer missions a completely rewritten version of Operation Broadsword and a Addons mission Operation Chernarus. In both of these

missions the system works perfectly.

The systems creation came about out of the lack of an easy way to create tasks in a multiplayer game, and keep them in sync to all players

this system takes care of all of this for you. the system also has many features that were as far as I knew unavailable to mission creators

before.

As with any new system there may be some as yet undiscovered bugs, however the system has been as thoroughly tested as possible. It is my hope

that by releasing it for public use this will help prove how robust it is.

I hope you enjoy this release and make good use of it.

Features:

Task Creation for:

A single side

Multiple Sides with ability to set win loose for each one

A single or multiple group, with win loose handling for each

A single player or players

Customization:

customisable messages for task

customisable messages for win/loose states

choose to show task marker or not

Full JIP compatability with legacy tasks

Installation / Usage:

To install this task system simply take the Hercx_taskSystem folder and add it to your missions main directory.

then add the code from the included description.ext and init.sqf files to yours editing where appropriate. If your

mission does not contain these files simply create them and add the code.

Example of proper use of this function:

_taskNumber = [_taskName,_taskPosition,_taskDestinationMarker,_taskMarkerText,_taskSide,_taskTitle,_taskDescription,_taskNotificationText] call Hercx_fnc_taskCreate;
waitUntil {_taskNumber != 0;};

Return Type for this Function is a INT/SCALAR this is the number of the task and it must be used when calling the function Hercx_fnc_taskOutcome so that the outcome of the task can be assigned to the correct task.

Required Arguments from user are:

_taskName - (STRING this is the namespace variable assigned to the task)

_taskPosition -(Marker name as a STRING or position as a 3D or 2D position ARRAY)

_taskDestinationMarker - (BOOL this sets whether the task is marked on the Map or not true for shown false for not shown)

_taskMarkerText - (STRING defines what the marker text will be on the map and if task is set to current task)

_taskSide - (this can be a single SIDE e.g. west or an ARRAY of SIDE's e.g. [west,east] or it can be a GROUP e.g. [alpha1-1,alpha2-1] or it can be a player e.g. [player] as this function must be used on server passing a player object will work for assinging to a player aswell)

_taskTitle - (STRING variable keep it as short as possible as these don't get much room on the task tab in the map)

_taskDescription - (STRING this can be pretty much as long as you like just use it to describe your task)

_taskNotificationText - (STRING keep this short as the size of the popup notification window is small and as such large text just doesn't work)

Arguments that MUST NOT BE MODIFIED are :

_taskMPNumber

_taskState

_isActiveTask

_winningSide

Example of proper use of this function:

[_taskNumber,_winningSide] call Hercx_fnc_taskOutcome;

With optional arguments:

[_taskNumber,_winningSide,_taskNotificationTextSucceed,_taskNotificationTextFailed] spawn Hercx_fnc_taskOutcome;

This fuction takes multiple arguments and some may be undefined by the user as there are default values set for these and they are intergral to the functionality of the system, modification of them may cause unpredictable behaviour.

Required Arguments from user are:

_taskNumber - ("SCALAR" this is the task number returned by the function Hercx_fnc_taskCreate)

_winningSide - ("SIDE","ARRAY","OBJECT" this must be a side or an array of sides or an array of "GROUP" type it can also be a player object for a task assigned to a single player)

for a task assigned to a single player that they have failed pass an object of any other kind and this will trigger the fail condition.

Optional Arguments:

_taskNotificationTextSucceed - ("STRING" if this is set the popup notification default value will be overridden and show your custom message)

_taskNotificationTextFailed - ("STRING" if this is set the popup notification default value will be overridden and show your custom message)

Arguments that MUST NOT BE MODIFIED are :

_runOnServer

Known issues:

Known issue task for JIP player notification may close before mission load complete if mission has cut scene intro

Credits & Thanks:

Thanks to BI for releasing this amazing game

To my Team SPV Septem Pro Vita for their support

To the ArmA community for all their great work

Change log:

v0.1

- Initial release

ArmaHolic Download

Edited by Hercx

Share this post


Link to post
Share on other sites
sounds nice but i cant get it to work sorry

hey ICE_AGE0815, well if you give me some more detail on what you are trying to do with it, I can help you get it working.

Share this post


Link to post
Share on other sites

just how to set it up so you get more task and when you get one done the next one comes . even with your demo mission cant get it to work have no idea what i am doing wrong

and thanks for the fast response

the idea is really cool

Share this post


Link to post
Share on other sites

Ok so the system is designed to aid you by transmitting the tasks you want to all the people you want, you still need to create the task parameters and any ai or objective of the task. You have to code the objective yourself and then code what the win or loose state is for your objective. The system is just to aid in the adding of task related to your objectives and giving the information to all clients connected to the multiplayer game.

So for example you want to create an objective to kill a enemy commander, you create the unit and come up with the descriptions, task name and who the task is for and pass it as arguments to the function Hercx_fnc_taskCreate. Hercx_fnc_taskCreate returns a number that is assigned to the task, you have to store that number in a variable and then you have to write code to monitor for the death of the enemy commander. once that happens you call Hercx_fnc_taskOutcome and pass it the task number and the winning side i.e. east,west. when you do that the system will transmit it to all clients and those who were on the winning side get a task complete, those on the loosing side get task failed.

if you make the task for more than one side by passing it an array of sides then the _winningSide variable you pass to Hercx_fnc_taskOutcome must be an array e.g. [west] .

I hope this helps you understand this system better, but if not post your code and I will help you troubleshoot it.

Share this post


Link to post
Share on other sites

When the trigger is fired and the Hercx_fnc_taskOutcome is executed, the task is marked as complete, but there is no pop up message saying this? This is in the demo mission.

Share this post


Link to post
Share on other sites
When the trigger is fired and the Hercx_fnc_taskOutcome is executed, the task is marked as complete, but there is no pop up message saying this? This is in the demo mission.

Yeah just ran the test mission and saw the same, it is because when you run the mission in the editor it is acting as both server and client and the system uses specific code on each, so the condition that runs in the editor is the server condition, this is not how it would operate in a multiplayer game. If you would like to see it working in a multiplayer setting you can check it out on my teams server search SPV in the host filter it is running on both of our milsim servers.

Share this post


Link to post
Share on other sites

So this will only work on a dedicated server?

Ok, so what I did was break up your 'fn_taskOutcome' function in to two functions. 'fn_taskOutcome' has the code that is in the 'if (isServer) then' portion, and 'fn_taskOutcomeClient' has the portion that was in the 'else' statement. I changed the 'BIS_fnc_MP' call to execute the new function 'fn_taskOutcomeClient', which executes on all players in the game, including the server player. This makes this good for local hosted games also.

This should work on a dedicated server also?

Share this post


Link to post
Share on other sites
So this will only work on a dedicated server?

Ok, so what I did was break up your 'fn_taskOutcome' function in to two functions. 'fn_taskOutcome' has the code that is in the 'if (isServer) then' portion, and 'fn_taskOutcomeClient' has the portion that was in the 'else' statement. I changed the 'BIS_fnc_MP' call to execute the new function 'fn_taskOutcomeClient', which executes on all players in the game, including the server player. This makes this good for local hosted games also.

This should work on a dedicated server also?

Yeah what you have described should work fine, if you send me the changes I will review them and as long as they work with the system I'll add them. The system was designed for dedicated servers as that is what my team runs, but I am happy to change it so it works in hosted games as well.

Share this post


Link to post
Share on other sites

Great task system, got it working nicely.

We had an issue where we had two separate win conditions for OPFOR and BLUFOR, Herc was good enough to help us out. In case someone is scouring forums looking for a solution to this kind of problem the code ended up as follows.

We set up two triggers with our conditions for each side winning.

// in your trigger statement for west put

_trg setTriggerStatements ["true","bluforWin = true;",""];

// in your trigger statement for east put

_trg setTriggerStatements ["true","bluforWin = false;",""];

The following was added to the mission file.

//Complete the task
waitUntil{(!isNil ("BluforWin"))};

switch (BluforWin) do
{
   case true:
   {
     _winningSide = [west];
     [_taskNumber,_winningSide] call Hercx_fnc_taskOutcome;
  hint "BLUFOR WINS"; //for testing locally to ensure conditions have been met
   };

   case false:
   {
     _winningSide = [east];
     [_taskNumber,_winningSide] call Hercx_fnc_taskOutcome;
  hint "OPFOR WINS"; //for testing locally to ensure conditions have been met
   };
};

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
Sign in to follow this  

×