Jump to content
Sign in to follow this  
sproyd

Task Completion Animations

Recommended Posts

When completing the Showcase missions I see a cool looking animation on screen when tasks are complete. There is also a cool MISSION COMPLETE one as well.

However, when playing editor missions my tasks do not have any sort of hint or animation by default - I need to press J and go and check them manually (unless of course there is a trigger where something happens which makes it obvious).

How do I get BIS' default animation to play upon completing tasks?

taskcompleted.jpg?noCache=1364125817

taskassigned.jpg?noCache=1364125794

Also I noticed BIS showcase missions go straight to briefing screen whereas my missions go straight into the game - how do I make the go to the briefing screen first?

Share this post


Link to post
Share on other sites

Also I noticed BIS showcase missions go straight to briefing screen whereas my missions go straight into the game - how do I make the go to the briefing screen first?

Are you launching your mission as a preview from the editor? The editor always skips the briefing screen.

Edit: I haven't taken a look at Arma 3's task system yet but in A2 you had to manually script task hints with taskHint.

Edited by SandyBandy

Share this post


Link to post
Share on other sites

Hi,

I assume you're handling tasks using plain scripting commands like createSimpleTask or setTaskState. In order to have notification displayed, you would have to use either task module (in Intel category) or task functions (in Tasks category in function viewer).

Example of singleplayer execution:

[
player, [color="green"]// Task owner(s)[/color]
"myTask1", [color="green"]// Task ID (used when setting task state, destination or description later)[/color]
["The nuke is still out there. Disarm it!", "Disarm the nuke", "Disarm"], [color="green"]// Task description[/color]
position myNuke1, [color="green"]// Task destination[/color]
true [color="green"]// true to set task as current upon creation[/color]
] call BIS_fnc_taskCreate;

Example of multiplayer execution for all members of player's group BIS_grpBlue (the task will then be available also when player respawns to other unit or new player JIPs). This solution works also in SP:

[
[units BIS_grpBlue, "myTask1", ["The nuke is still out there. Disarm it!", "Disarm the nuke", "Disarm"], position myNuke1, true], [color="green"]// Task params[/color]
"bis_fnc_taskCreate", [color="green"]// Task function[/color]
nil, [color="green"]// Execution only on specific client; undefined here, will be by default executed for everyone[/color]
true [color="green"]// True for persistent execution (i.e., also for players connected by JIP)[/color]
] call BIS_fnc_MP;

The task hint won't be displayed for tasks added within 1st second of a mission to prevent announcing tasks added during briefing.

Unpack official missions to see further details, all of them have tasks stored in missionTasks.sqf file.

Share this post


Link to post
Share on other sites

If you are in the editor and want to see your briefing hold down the shift key and click preview, you should start with the briefing screen.

Share this post


Link to post
Share on other sites
If you are in the editor and want to see your briefing hold down the shift key and click preview, you should start with the briefing screen.

Okay - the briefing screen still doesn't come up using this trick or in regular SP Mission pbo? I'm using briefing.sqf based on the tutorial here: http://www.ofpec.com/forum/index.php?topic=33468.0

Share this post


Link to post
Share on other sites

The new method:

Create a file called initBriefing.hpp

This is out of one of the missions Im working on. Its still read from bottom to top.

// Normal briefing
player createDiaryRecord [
"Diary", 
[
	"Info", 
	"<br/>Author - cobra4v320"
]
];

player createDiaryRecord [
"Diary", 
[
	"Service and Support", 
	"<br/>Class I: Your team will be outfitted with light machineguns, rifles, grenade launchers, C4 explosives, and night vision goggles.
	<br/><br/>Class V: You will carry as much ammo as needed to complete the mission.
	<br/><br/>Class VII: Each member of your team will have approximately 3 C4 demo charges, except for the gunner who will be carrying extra ammo for the LMG.
	<br/><br/>Class VIII: Each member of your team will have at a minimum of two IFAK."
]
];

player createDiaryRecord [
"Diary", 
[
	"Execution", 
	"<br/>Your SEAL team will inserted in grid <marker name='Marker_Start'>023063</marker>. Make your way to the area of operation and complete the objectives.
	<br/><br/>After all of your objectives have been completed make your way back to the sea and to the extraction area located in grid <marker name='Marker_End'>023066</marker>."
]
];

player createDiaryRecord [
"Diary", 
[
	"Mission", 
	"<br/>SEAL Team One has been tasked to disrupt enemy forces in the region. 
	<br/><br/>Task One: Destroy any aircraft located on the <marker name='Marker_AB'>airfield</marker> or in the hangars. 
	<br/><br/>Task Two: Destroy any patrol boats currently docked in the <marker name='Marker_HB'>harbor</marker>. 
	<br/><br/>Task Three: Destroy any vehicles or equipment located in the <marker name='Marker_MP'>motor pool</marker>."
]
];

player createDiaryRecord [
"Diary", 
[
	"Situation", 
	"<br/>Weather: Weather conditions will be mild and visibility will be low. We will be heading towards shore just after midnight so we will have the cover of darkness to our advantage.
	<br/><br/>Terrain: Terrain leading up to the beach is mostly sand and rocks, so it should not be an issue getting to shore. There are small hills and limited areas of cover and concealment. Make sure you have a path to escape if neccessary to exfiltrate.
	<br/><br/>Avenues of Approach: You can hit the <marker name='Marker_HB'>boats in the harbor</marker> first, head to the beach near the <marker name='Marker_AB'>airfield</marker>, or head south east towards the <marker name='Marker_Clear'>observation post</marker> for a better vantage point.
	<br/><br/>Enemy Forces: Iranian Forces will be wearing uniforms and carrying conventional weapons. They will have motorized vehicles for land, sea, and air.
	<br/><br/>Activity: Currently the Iranians are occupying and defending the Stratis Airbase in preparation for further attacks in the region.
	<br/><br/>Strength: There is approximately a platoon sized element or larger defending the airbase, direct assault is not advised.
	<br/><br/>Course of Action: If you are spotted or discovered by Iranian Forces they will attack.
	<br/><br/>Friendly Forces: There are no friendly forces currently on the island of Stratis. There will be no support at this time."
]
];

Then put this in your init.sqf file.

#include "initBriefing.hpp"

Share this post


Link to post
Share on other sites

@Moricky I see that missionTasks.sqf is called automatically. Is this the case for JIP players too? I ask because it seems that in my mission on dedicated, JIP players are not seeing the tasks. Players see them fine if they join from the beginning. As you can see I am using BIS_fnc_MP

I am using the latest A3 DEV version at all times.

missionTasks.sqf: http://pastebin.com/ndUhqTyL

Edited by [KH]Jman

Share this post


Link to post
Share on other sites

I guess you did not review my pastebin link before replying.

Share this post


Link to post
Share on other sites

Which missions have this MissionTasks.sqf and how do I get to them? I have unpacked the multiplayer missions but they don't use it.

edit: nevermind I see the other one does have it, just not escape stratis.

Would it be possible to tell us how you create a task through a trigger during a mission also using the BIS_fnc_MP function?

Share this post


Link to post
Share on other sites

Actually I did. I just somehow looked in the wrong place.

:rolleyes: too much scripting makes you blind like that, sorry.

Ok then, different question. Why did you set the target-parameter to "nil", I think it needs to be "true" if you want it to be executed on all clients.

Share this post


Link to post
Share on other sites

I was my understanding that nil would execute on all clients.

Taken form BI Wiki:

[["Hello World"],"BIS_fnc_guiMessage",nil,true] spawn BIS_fnc_MP;

Send a message containing "Hello World" to every player, including the ones who joins later using JIP.

I will change it to true and see what happens. :)

Edited by [KH]Jman

Share this post


Link to post
Share on other sites

Did you get that working Jman? I haven't had much luck with this and taskSetState or sideRadio. I created some functions like this

Fnc_MPTask = { [_this select 0, _this select 1] call BIS_fnc_taskSetState; }; 

Fnc_MPSideRadio = {(_this select 0) sideRadio (_this select 1)}; 

...and tried running them like this:

[["TaskIDVariable", "Succeeded"] , "Fnc_MPTask"[color="#B22222"],NIL,true[/color]] call BIS_fnc_mp; 

       [[unitname, "Radio_Messagename"] , "Fnc_MPSideRadio", [color="#B22222"]true[/color]] call BIS_fnc_mp; 

They both work fine in SP but only for the server in MP. For the arguments in red, I have also tried true, true and leaving them blank.

Share this post


Link to post
Share on other sites

Yeah sorry for not replying sooner. No it did not work.

Many .sqf files that work for players whom start from the beginning of the mission fail to run at all for JIP players. No diag_log output, nothing. My feeling is that it will need an engine change to address this.

Share this post


Link to post
Share on other sites

I believe that the answer may be in this error:

missionTasks.sqf:

     

       diag_log format["_taskState: %1 Type: %2",_taskState, typeName _taskState];
       diag_log format["_taskID: %1 Type: %2",_taskID, typeName _taskID];

case "objective_1": {
	if (_taskState == "") then {
	[
		[units group player,  // Task owner(s)
		  _taskID, // task ID (used when setting task state, destination or description later)
			["Clear the beach camp of enemy and secure.","Secure beach camp",""], // Task params
		  position objective_target_1,  // task destination
			true //  true to set task as current upon creation
		],
			"BIS_fnc_taskCreate", // task function
			true, // execution on all clients; 
			true // true for persistent execution (i.e., also for players connected by JIP)
	] call BIS_fnc_MP;

	} else {
		if (_taskState == "Current") then {_taskID call BIS_fnc_taskSetCurrent} else {[_taskID, _taskState] call BIS_fnc_taskSetState}
	}
};

Output when player JIP's:

"_taskState: CREATED Type: STRING"
"_taskID: objective_3 Type: STRING"

Error in expression <exitWith {_task = _x select 1}} forEach _taskList;
_task>
 Error position: <_taskList;
_task>
 Error Undefined variable in expression: _tasklist
File A3\functions_f\Tasks\fn_taskReal.sqf, line 35
Error in expression <ent = _x call BIS_fnc_taskCurrent;
if (_taskCurrent == _taskName && _state != ">
 Error position: <_taskCurrent == _taskName && _state != ">
 Error Undefined variable in expression: _taskcurrent
File A3\functions_f\Tasks\fn_taskSetState.sqf, line 57

It appears that BI's JIP code is still broken/buggy and as I say many .sqf files that work for players whom start from the beginning of the mission fail to run at all for JIP players (even if placed in initJIPcompatible.sqf). No diag_log output, nothing.

Edited by [KH]Jman

Share this post


Link to post
Share on other sites

hi...

i didnt study all the post but it looks like nobody mentioned it befor...

...to the original question...

this is done by BIS_fnc_taskSetState and the task have to be created by BIS_fnc_taskCreate

_null = [player, "TaskName", ["Task description", "Task title", "Waypoint title"], "MarkerNameRepresentingWaypoint", true] call BIS_fnc_taskCreate;

last boolean is 'set as current!.... true... false....

if true message will be 'Task Assigned' and task will be set as current

if false message will be 'Task Created' and current task stays as it is

huge drawback is that task created this way is valid only per live... so if player dies and respawns with task still assigned u cant use BIS_fnc_taskSetState to change the task states... at least i didnt found anyway how to do that.. :(

Share this post


Link to post
Share on other sites

Use the Intel module in the editor, excellent tutorial here:

Share this post


Link to post
Share on other sites

For task completion animations I'm using notifications. First you must difine classes in description.ext

class CfgNotifications { 

   class TaskSucceeded 
   { 
       title = "TASK COMPLETED"; 
       iconPicture = "\A3\ui_f\data\map\MapControl\taskicondone_ca.paa"; 
       description = "%1"; 
       color[]={0,255,0,1};
   }; 
   class TaskFailed 
   { 
       title = "TASK FAILED"; 
       iconPicture = "\A3\ui_f\data\map\MapControl\taskiconfailed_ca.paa"; 
       description = "%1"; 
       color[]={255,0,0,1};

   }; 
   class TaskCanceled { 
       title = "TASK CANCELED"; 
       iconPicture = "\A3\ui_f\data\map\MapControl\taskiconcanceled_ca.paa"; 
       description = "%1";
       color[]={255,0,0,1};

   }; 
   class TaskAssigned  { 
       title = "TASK ASSIGNED"; 
       iconPicture = "\A3\ui_f\data\map\Mapcontrol\taskIcon_ca.paa"; 
       description = "%1"; 

   }; 

  class TaskCreated  { 
       title = "TASK CREATED"; 
       iconPicture = "\A3\ui_f\data\map\MapControl\taskiconcreated_ca.paa"; 
       description = "%1"; 

   }; 
};

and then you call it

["TaskSucceeded", ["Attack enemy"]] call bis_fnc_showNotification;

or

["TaskFailed", ["Attack enemy"]] call bis_fnc_showNotification;

and so on.

Share this post


Link to post
Share on other sites

Sproyd use is briefing this better for Arma3 :rthumb:

Works in multiplayer even after respawn, and after activation by a player other than the host or chef group :yay:

BRIEFING.SQF

FNC_tasknum_succeeded =

{

// player has finished the task

// Mark it accomplished.

taskNum setTaskState "Succeeded";

// Create next task

// (appears only when the code is initiated by the trigger)

taskNum+1 = player createSimpleTask ["Title task+1"];

taskNum+1 setSimpleTaskDescription [

"Text description corresponding to the task+1",

"Title menu task+1",

"Title mkr map corresponding to the task+1"

];

taskNum+1 setSimpleTaskDestination (getMarkerPos "mkrobj2");

// defined as task to realize

player setCurrentTask taskNum+1;

};

// Creation apparent task in briefing

// (next task is no apparent for moment)

taskNum = player createSimpleTask ["Title task"];

taskNum setSimpleTaskDescription [

"Text description corresponding to the task",

"Title menu task",

"Title mkr map corresponding to the task"

];

taskNum setSimpleTaskDestination (getMarkerPos "mkrobj1");

// defined as task to realize

player setCurrentTask taskNum;

player createDiaryRecord ["Diary", ["Crédit", "Text Description crédit and the thanking"]];

player createDiaryRecord ["Diary", ["Informations", "Text description informations"]];

player createDiaryRecord ["Diary", ["Context", "Text description context <marker name="Name_mkr_task_num"">Name place of mkr</marker> <br /><br />

<img image='PICTURE.PAA or .JPG' height='64' width='64' /&gt]];

TRIGGER

First Trigger (time 2s),

On Act :

call FNC_taskNum_succeeded; ["TaskSucceeded",["Title text corresponding realize taskNum"]] call bis_fnc_showNotification; taskNum* = true;

(realize the class Notification in Description.ext, see cfgNotification : https://community.bistudio.com/wiki/Notification)

Second trigger (time 7s),

Condition :

taskNum*

On Act :

["TaskAssigned",["Title text corresponding realize taskNum"]] call bis_fnc_showNotification;

(see code BIS_fnc_showNotification : https://community.bistudio.com/wiki/BIS_fnc_showNotification)

Third Trigger :

"End1" call BIS_fnc_endMission; (realize in Description.ext, see debriefing : http://community.bistudio.com/wiki/Debriefing)

special thanks for Karel Moriky;)

Picture editor :

editordv.jpg[/img]

Display menu briefing :

The task2 in briefing is not apparent. She is apparent when the trigger n°2 is activated

taskbriefing.jpg[/img]

Display in game :

dbriefingrsultatettaskv.jpg[/img]

Sorry for my english langage, at school I prefered to learn how to kiss girls, instead of learning foreign languages and the screenshots are french briefing

Edited by JonyBIgood

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  

×