Jump to content
Sign in to follow this  
fasterthanlight

Briefing.sqf help

Recommended Posts

I am making a mission on Elephant Island and the first task is to kill the insurgents near Theo's house.

I can do a task hint no problem, but I need it to come up in tasks under the map.

Here is what the task hint says;

taskhint ["Take your squad of Marines and proceed south to Theo's place. You will encounter heavy resistance. Eliminate them or scare them off.", [0, 0, 1, 1], "tasknew"]

I have an init.sqf setup already. It says

execVM "briefing.sqf";

What goes in the briefing EXACTLY? Also, this is a SP map.

Share this post


Link to post
Share on other sites

Yes. The first one gets created immediately and the 2nd, 3rd, and 4th tasks get added only after the previous one is completed.

Share this post


Link to post
Share on other sites

Hi...

There are a lot of tutorials around regarding tasks.

Anyway, this is how you briefing.sqf could look like:

Task1Create = true; // Create Task 1 at the beginning

[] spawn {
// CREATE TASK
waitUntil {!(isNil "Task1Create")};
Task1 = player createSimpleTask ["Task"];
Task1 setSimpleTaskDescription ["Take your squad of Marines and proceed south to Theo's place. You will encounter heavy resistance. Eliminate them or scare them off.","Move to Theos place","Move"];
Task1 setTaskState "Created";
taskhint ["New Task:\nMove to Theos place", [1, 1, 1, 1], "taskNew"];

// TASK SOLVED
waitUntil {!(isNil "Task1Solved")};
Task1 setTaskState "Succeeded";
taskhint ["New Task:\nMove to Theos place", [1, 1, 1, 1], "taskDone"];
player addRating 1000;
};

[] spawn {
// CREATE TASK
waitUntil {!(isNil "Task2Create")};
Task2 = player createSimpleTask ["Task"];
Task2 setSimpleTaskDescription ["Loooooooooooong description for task 2 ...........","Task 2 title goes here","task waypoint text here"];
Task2 setTaskState "Created";
taskhint ["New Task:\nTask 2 title goes here", [1, 1, 1, 1], "taskNew"]

// TASK SOLVED
waitUntil {!(isNil "Task2Solved")};
Task2 setTaskState "Succeeded";
taskhint ["Task Solved:\nTask 2 title goes here", [1, 1, 1, 1], "taskDone"]
player addRating 1000;
};

Now during the game you can use the variables to change the task status:

Task1Solved = true; // Task 1 solved

Task2Create = true; // Create task 2

Task2Solved = true; // Task 2 solved

and so on...

Share this post


Link to post
Share on other sites

I have pasted that code into the briefing.sqf and it still won't show in SP. I also exported it to MP and it won't show there either.

There is no task option.

Share this post


Link to post
Share on other sites
I have pasted that code into the briefing.sqf and it still won't show in SP. I also exported it to MP and it won't show there either.

There is no task option.

you need to place this in init.sqf maybe:

execVM "briefing.sqf";

Share this post


Link to post
Share on other sites

A briefing.html file might solve the problem

Share this post


Link to post
Share on other sites

Let me back up here. Are you saying that the init must say execVM "briefing.html"; AND the briefing.html must be named in the root?

Share this post


Link to post
Share on other sites

All that did was add the date and time to the loading screen. No tasks in the M menu.

Now I have a breifing and a briefing.sqf file in the mission folder. Sound right?

Share this post


Link to post
Share on other sites

Atleast it did something :)

You need one file called briefing.sqf and one called briefing.html in your mission folder.

This is what I put in my briefing.sqf in one of my missions.

player createDiaryRecord ["Diary", ["Credits", "Credits to blablabla"]];

player createDiaryRecord ["Diary", ["Rally Point", "some text about the spawn."]];

player createDiaryRecord ["Diary", ["Mission", "mission text goes here."]];

task2 = player createSimpleTask ["Hostage"];

task2 setSimpleTaskDestination (getMarkerPos "obj2");

task2 setSimpleTaskDescription ["Rescue the <marker name=obj2'>hostage</marker> in the village.","Hostage","];

task1 = player createSimpleTask ["Radio Tower"];

task1 setSimpleTaskDestination (getMarkerPos "obj1");

task1 setSimpleTaskDescription ["Destroy the <marker name=obj1'>radio tower</marker> on the top of Misty Peak.","Radio Tower","];

task1 setTaskState "Assigned";

obj1 and obj2 are markers on the map.

And I start that with [] execVM "briefing.sqf"; in the init.sqf file.

Make sure you name the file briefing.sqf and not briefing.sqf.txt

Edited by zigzag

Share this post


Link to post
Share on other sites

That had something to do with it. The file was named Briefing.sql.html. I removed the .html and resaved the game. Ran it and the task immediately shows up. Nice! It is also available in the M options.

How can I get that task to stay up for more than 5 seconds or so?

Also, how do I condition the task to complete once all enemies are dead?

Then, a pause and have the task 2 come up?

---------- Post added at 01:23 AM ---------- Previous post was at 12:21 AM ----------

I have put this into a trigger;

"1" objStatus "DONE"; tskobj_1 setTaskState "SUCCEEDED"; player setCurrentTask tskobj_2

Is this right?

condition is opfor; not present.

Edited by fasterthanlight

Share this post


Link to post
Share on other sites

sxp2high you have been really helpful. I appreciate it.

I have this in the On ACT trigger

Task1Solved = true; Task2Create = true;

The first task will resolve when the opfor are eliminated, but task 2 won't generate.

Here is the code for task 2;

[] spawn {

// CREATE TASK

waitUntil {!(isNil "Task2Create")};

Task2 = player createSimpleTask ["Task"];

Task2 setSimpleTaskDescription ["Move West to the airport and destroy the druglord's F14.","task waypoint text here"];

Task2 setTaskState "Created";

taskhint ["New Task:\nMove West to the airport and destroy the druglord's F14.", [1, 1, 1, 1], "taskNew"]

// TASK SOLVED

waitUntil {!(isNil "Task2Solved")};

Task2 setTaskState "Succeeded";

taskhint ["Task Solved:\nThe druglord was planning on using this F14 to kill his govenrment's president. Now he can't. Good job.", [1, 1, 1, 1], "taskDone"]

player addRating 1000;

What's missing? I seem to expect that the task 2 will generate right after task 2 completes.

Share this post


Link to post
Share on other sites

I also have this script that works well as a briefing.

//task1

Task1 = player createSimpleTask ["Theo's Place"];

Task1 setSimpleTaskDescription ["Move your Marines south to Theo's Place. Eliminate the hostiles from his property", "Theo's Place", "TASK HUD TITLE"];

Task1 setSimpleTaskDestination (getMarkerPos "Task1");

taskhint ["Message from command:\nCheck your tasks for first assignment.", [1, 1, 1, 1], "taskNew"];

//task2

Task2 = player createsimpletask ["Airport"];

Task2 setsimpletaskdescription ["Move your Marines West to the airport and destroy the drugboss's F-14. He is planning on using it to kill the country's President", "Airport", "Task Hud Title"];

Task2 setsimpletaskdestination (getmarkerPos "Task2");

taskhint [:Message from command;\nCheck your tasks for your second assignment.", [1,1,1,1], "tasknew"];

//task3

Task3 = player createsimpletask ["Drugboss"];

Task3 setsimpletaskdescription ["Move your Marines NW into the grove and eliminate the drugoss", "Drugboss", "Task Hud Title"];

Task3 setsimpletaskdescription (getmarkerpos "Task3");

taskhint [Message from command;\nCheck your tasks for your third and final assignment." [1,1,1,1], "tasknew"];

However, it places them all at the same time in the tasks menu.

What do I need in a trigger to activate 2 after 1, and 3 after 2?

Share this post


Link to post
Share on other sites

For the script:

place before // task2:

waitUntil {(taskState Task1) == "Succeeded"};

place before // task3:

waitUntil {(taskState Task2) == "Succeeded"};

will wait until task1 is completed, then create task2, and so on.

alternative for a trigger condition:

(taskState Task2) == "Succeeded"

trigger fires when Task2 is completed.

When trying to script or making scripts and not getting it, investigate, most imortantly, search the wiki.

http://community.bistudio.com/wiki/createSimpleTask

All relevant info already there.

Edited by Demonized

Share this post


Link to post
Share on other sites

I put the waituntil in the briefing.

It still says objective completed when we clear Theo's Place, but it won't activate the second task.

Is this code right for the on act?

"1" objStatus "DONE"; tskobj_1 setTaskState "SUCCEEDED"; player setCurrentTask tskobj_2

Share this post


Link to post
Share on other sites

why use objStatus when you already have setTaskState?

tskobj_1 setTaskState "Succeeded";

and you cant set a curent task when its not yet created, better place this line in the script after the task creation:

unitname setCurrentTask tskobj_2;

Share this post


Link to post
Share on other sites

I was not sure about which ones to include.

The task1 settaskstate "succeeded" works very well.

Thanks all for your help.

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  

×