Jump to content
Sign in to follow this  
MorrisBoy94

Making a trigger to make task complete and make give hint

Recommended Posts

Hello

I am currently making a spec-ops mission where the target are two Zeus AA guns. I would like to make a trigger that marks off a task as complete when the Zeus' are destroyed

and gives a message saying the aa are destroyed.

Any and all help is appreciated.

Thank you

Share this post


Link to post
Share on other sites

Hi there. I'm a complete novice at this, but I will hazard a guess for you!

On Act:

[b]taskname[/b] setTaskState "Succeeded"; hint "[b]Your Text Here[/b]"

Hope that is something in the right direction for you!

Share this post


Link to post
Share on other sites

Hi,

Create a Briefing.sqf, and a briefing html -(just put this in your mission folder nothing to do with the briefing html)

and put in the folder of your mission

briefing.sqf

player createDiaryRecord["Diary", ["Briefing", "Your Objective is to locate and destroy two Zeus AA guns. "]];

tskarea2 = player createSimpleTask["Zeus AA gun 2"];
tskarea2 setSimpleTaskDescription["Locate Zeus AA gun 2 and destroy it <marker name='m2'>here</marker>.", "Destroy Zeus AA gun 2 .", "Destroy Zeus AA gun 2."];
tskarea2 setSimpleTaskDestination (getMarkerPos "m2");

tskarea1 = player createSimpleTask["Zeus AA gun 1."];
tskarea1 setSimpleTaskDescription["Locate Zeus AA gun 1 and destroy it <marker name='m1'>here</marker>.", "Destroy Zeus AA gun 1.", "Destroy Zeus AA gun 1."];
tskarea1 setSimpleTaskDestination (getMarkerPos "m1");


player setCurrentTask area1;
player setCurrentTask area2;

Create an

init.sqf

if (isServer) then
{
[] execVM "briefing.sqf";
};

if(true) exitWith {};

putt in the folder of your mission.

INGAME (Editor)

Place:

Zeus AA gun 1, and

Zeus AA gun 2

Create a Marker

name it m1 give it a radius of 20x20

Create a Marker

name it m1 give it a radius of 20x20

color black, and border fill

put this marker over the Zeus AA gun 1

Create a Marker

name it m2 give it a radius of 20x20

color black, and border fill

put this marker over the Zeus AA gun 2

Name:

your Zeus AA gun 1---> AAg1

Name:

your Zeus AA gun 2---> AAg2

Create a trigger:

condition: !alive AAg1

On Act: hint "The Zeus AA gun 1 has been destroyed!."; tskarea1 setTaskState "SUCCEEDED";m1obj=true;publicvariable "m1obj"

Create a trigger:

condition: !alive AAg2

On Act: hint "The Zeus AA gun 2 has been destroyed!."; tskarea2 setTaskState "SUCCEEDED";m2obj=true;publicvariable "m2obj"

note trigger size is 0x0

=================

Notes in general, the names for the aa guns do not have to be those exact name, same for the marker you put down over the aa guns,

but if you use a different name then you have to make sue that the brifing and triggers have the names corresponding too.

So basically what happens is you destroy gun 1 a hint will pop up on the screen and say whats in the hint.

you will also have under tasks when completed turn green.

If you want a demo mission I have one.

hope that helps.

Edited by Gnter Severloh

Share this post


Link to post
Share on other sites

Your very welcome, keep in mind that what i had posted is only one of many ways to do briefings, tasks and hints.

Are you able to create Briefing scripts and init files ok, or do you need a tool for that?

Share this post


Link to post
Share on other sites

This is what i got after adding scripts for the note section made in ARMA Briefing Manager

player createDiaryRecord["Notes", ["Equipment","Authorised Equipment<br/><br/>4 x MP5SD 9mm Submachine Guns<br/>20 x MP5SD 9mm magazines<br/>3 x Satchel Charges<br/>4 x Night-Vision Goggles"]];

player createDiaryRecord["Notes",["Situation","Guerilla forces have occupied the region of Chernarus for the past 2 months. NATO only recieved word of the occupation 2 weeks ago from an CDF communications officer who has not been contact with NATO since. The reports recieved from the CDF officer contained infomation regarding civllians being taken prisoner, and the guerillas using armoured vehicles for spearheads against the CDF forces.<br/><br/>As the only nearby force in the North Pacific Ocean, the HMS Illustrious "Lusty" has been sent to respond and gain a foothold until reinforcement from other vessels arrive in the area."]];

player createDiaryRecord["Notes",["Briefing","Mission Date - 11th April 2012<br/>Mission Start Time - 3:55 AM<br/><br/>At 6:15 AM, the first UK attack wave will assault Kamenka in the south western area of Chernarus. Intel has reported that two Zeus AA guns have been sighted in the woods to the far west of Kamenka, however were unable to gain a specific location due to too much atmospheric interference. <br/><br/>Viper team will enter the area via HALO jump at 3:45AM from a C-130 transport. They will be split into two groups, callsigns "Viper 1" and "Viper 2" each will have a designated drop zone being grid reference "<marker name=inst1'>006025</marker>" and "<marker name='inst2'>003039</marker>". Once both groups have touched down, they will begin moving towards the general area, the AA guns have been <marker name='m1'>sighted</marker> and dismantle them with Satchel Charges.<br/><br/>After the AA guns are destroyed, Viper 1 & 2 will head to the <marker name='m3'>safe zone</marker> and wait until the attack wave begins their assault on Kamenka.]];

tskarea1 = player createSimpleTask["Zeus AA gun 1."];

tskarea1 setSimpleTaskDescription["Locate Zeus AA gun 1 and destroy it <marker name=m1'>here</marker>.", "Destroy Zeus AA gun 1.", "Destroy Zeus AA gun 1.];

tskarea1 setSimpleTaskDestination (getMarkerPos "m1");

tskarea2 = player createSimpleTask["Zeus AA gun 2"];

tskarea2 setSimpleTaskDescription["Locate Zeus AA gun 2 and destroy it <marker name=m2'>here</marker>.", "Destroy Zeus AA gun 2 .", "Destroy Zeus AA gun 2.];

tskarea2 setSimpleTaskDestination (getMarkerPos "m2");

tskarea3 = player createSimpleTask["Safe Zone"];

tskarea3 setSimpleTaskDescription["Head to the <marker name=m3'>woods</marker> west of Kamenka and await the attack force's arrival.","Safe Zone","Safe Zone];

tskarea3 setSimpleTaskDestination (getMarkerPos "m3");

player setCurrentTask area1;

player setCurrentTask area2;

player setCurrentTask area3;

Edited by MorrisBoy94

Share this post


Link to post
Share on other sites

No, for some reason it wont show. Here my init file in case that helps

if (isServer) then

{

[] execVM "briefing.sqf";

};

if(true) exitWith {};

Share this post


Link to post
Share on other sites

try with just

[] execVM "briefing.sqf";

I actually have my own Briefing issue going on, which just started, I see my briefings np on my

own created server, but when i put my missions on my game server they dont show, when before they did.

How are you playing your mission, a created server via the game itself as in you host,

or do you have a game server you are loading the mission onto?

Share this post


Link to post
Share on other sites
try with just

[] execVM "briefing.sqf";

I actually have my own Briefing issue going on, which just started, I see my briefings np on my

own created server, but when i put my missions on my game server they dont show, when before they did.

Hi Günter

If you're logging on to the server from a different machine & the script is running on the server, wouldn't the init entry have to be

if (!isServer) then
{
[] execVM "briefing.sqf";
};

if(true) exitWith {};

or am I completely misunderstanding how !isServer works?

Share this post


Link to post
Share on other sites

Ya I would think so, but the code

if (!isServer) then
{
[] execVM "briefing.sqf";
};

if(true) exitWith {};

has always worked for me, now the briefings dont show up for me or my buddy on my gameserver (server I connect too) (look up WarMod combined Ops in mp).

Only with missions I made, I never had the issue before, now all a sudden they dont show.

Share this post


Link to post
Share on other sites

I know its quite obvious that this is a closed thread, but the information best stated on how to do this here. I just have have one question though, using the briefing.sqf, how could I make it where only 1 task is showing at one time until the completion of another? Have been looking for quite a while now and I honestly like the way this works.

Share this post


Link to post
Share on other sites

Hi!

I'm using this form in Init.sqf:

SHK_createTask = { // "name" call SHK_createTask

if isserver then {

SHK_Jiptasks set [count SHK_Jiptasks,_this];

publicvariable "SHK_Jiptasks";

};

if !isdedicated then {

/* -- add extra tasks below -- */

switch _this do {

case "basec": {

hint "We've defeated enemy and brought stability in region!";

[objNull, ObjNull, taskbase, "SUCCEEDED"] execVM "CA\Modules\MP\data

\scriptCommands\taskHint.sqf";

};

case "siezec": {

hint "Take over enemy base!";

[objNull, ObjNull, tasksieze, "SUCCEEDED"] execVM "CA\Modules\MP\data

\scriptCommands\taskHint.sqf";

taskbase = player createSimpleTask ["Take over enemy base"];

taskbase setSimpleTaskDescription ["Take over enemy base near Prigorodki!",

"Take over enemy base", "Take over"];

taskbase setSimpleTaskDestination (getMarkerPos "basey");

player setCurrentTask taskbase;

};

case "tankc": {

hint "Seize Chernogorsk!";

[objNull, ObjNull, tasktank, "SUCCEEDED"] execVM "CA\Modules\MP\data

\scriptCommands\taskHint.sqf";

tasksieze = player createSimpleTask ["Sieze Chernogorsk"];

tasksieze setSimpleTaskDescription ["Sieze Chernogorsk back from the

enemy!", "Seize Chernogorsk", "Seize Chernogorsk"];

tasksieze setSimpleTaskDestination (getMarkerPos "siezey");

player setCurrentTask tasksieze;

};

/* -- add extra tasks above -- */

};

};

};

SHK_updateTask = { // ["name","state"] call SHK_updateTask

if isserver then {

SHK_Jiptasks set [count SHK_Jiptasks,_this];

publicvariable "SHK_Jiptasks";

};

if !isdedicated then {

call compile format ["task%1 settaskstate ""%2""",(_this select 0),

(_this select 1)];

};

};

if isserver then { SHK_Jiptasks = [] };

if !isdedicated then {

[] spawn {

waitUntil {!isnull player};

player createDiaryRecord["Diary", ["Info", "<br/>Author - FilaMOD<br/>"]];

player createDiaryRecord ["Diary", ["Briefing", "Our mission is to bring

stability in region. We must defeate enemy in Chernogorsk and near

Prigorodki!"]];

/* -- add briefing tasks below -- */

tasktank = player createSimpleTask ["Destroy convoy"];

tasktank setSimpleTaskDescription ["Near power transformator the enemy

convoy has ran out of gas. Destroy tanks in convoy before they refuel!",

"Destroy tanks in convoy", "Destroy tanks in convoy"];

tasktank setSimpleTaskDestination (getMarkerPos "tanky");

player setCurrentTask tasktank;

/* -- add briefing tasks above -- */

waituntil {!isnil "SHK_Jiptasks"};

{

switch (typename _x) do {

case (typename ""): { _x call SHK_createTask };

case (typename []): { call compile format ["task%1 settaskstate

""%2""",(_x select 0),(_x select 1)] };

};

} foreach SHK_Jiptasks;

};

};

You can see i have 3 tasks which appears one after another and the 3 trigers:

On act:

["tank","succeeded"] call SHK_updateTask; "tankc" call SHK_createTask

On act:

["sieze","succeeded"] call SHK_updateTask; "siezec" call SHK_createTask

On act:

["base","succeeded"] call SHK_updateTask; "basec" call SHK_createTask

Hope that help :)

Share this post


Link to post
Share on other sites

I'll give it a shot, looks a bit complicated for me, but gotta learn sometime.

Share this post


Link to post
Share on other sites

This might be useful to some:

In the On Act field of the first trigger write Hint “Task one complete.â€

In the On Act field of the second trigger write Hint “Task two complete.â€

In the On Act field of the third trigger write Hint “Task three complete.â€

If you want any of these messages to appear for 20 seconds for example then in the Condition field of the trigger (or triggers) write time > 20.

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  

×