Advertisement

Author Topic: How to make a basic briefing in ArmA 2  (Read 52421 times)

0 Members and 1 Guest are viewing this topic.

Offline mikey

  • Former Staff
  • ****
  • Whitespace Whore
How to make a basic briefing in ArmA 2
« on: 05 Jun 2009, 17:12:53 »
How to make a basic Briefing in ArmA 2


In ArmA 2 BIS has decided redo the briefing system. The well known 'briefing.html' is still being used, but only for the debriefing.
The actual briefing is added by script commands, which I advise you to put in a 'briefing.sqf', and give you the ability to add 'Notes' and 'Tasks' to the briefing menu.

Ok, let's start with the simple stuff. Make a file called 'briefing.sqf' and make sure this gets executed through the 'init.sqf'. Add the following to your init.sqf:
Code: [Select]
execVM "briefing.sqf";
Now we can add the briefing commands to the briefing.sqf file, and keep the other files of your mission clean.


Adding Notes:

player createDiaryRecord ["Diary", ["Title 1", "Message 1"]];

This adds a note called 'Title 1', and when you click on that a bigger message screen comes up with 'Message 1'. This is great, but we really need some formatting and ability to add links and pictures.

Linebreak/newline: <br/>
Link to marker: <marker name='obj1'>Link to Marker</marker>
Show an image: <img image='somePic.jpg'/>
Show an image and manipulate the image width and height: <img image='somePic.jpg' width='200' height='200'/>

Some examples:
player createDiaryRecord ["Diary", ["Title 2", "Isn't whitespace awesome? <br/><br/><br/>Yes it totally is!"]];
player createDiaryRecord ["Diary", ["Title 1", "We have an objective <marker name='mkrObj1'>here</marker> and one <marker name='mkrObj2'>there</marker>"]];


Ok, you should now understand how to make a note, and what the possibilities are in the briefing message window, so let's add some tasks.



Adding Tasks

You can make tasks whenever you want (at mission start, or at any time you like duing a mission), and you can customize them a lot, but let's start with a simple one:
tskExample1 = player createSimpleTask ["Task Title 1"];

This add only adds a task called 'Task Title 1', but the message box is empty. We fix this with the following command:
tskExample1 setSimpleTaskDescription ["Task Message 1", "Task Title 1", "Task HUD Title 1"];

This sets a description to the task. The first array element is the message (like the message from the notes), the second element is the title (yes, we already defined that, but we have to redefine it here), and the third element is what gets shown on the HUD.

Note: The formatting tags that I've shown you earlier work with tasks as well.


So now that we have a task with a title and message, we can also add an objective marker to the task so we know where the objectives actually are:
tskExample1 setSimpleTaskDestination (getMarkerPos "mkrObj1");

Make sure you have an empty marker called 'mkrObj1', and you'll see a semi-transparant circular marker which will light up when you set the task as active.


Other commands

Well,now you know how to make notes and tasks, but we also need to control those tasks during the mission.

We force a task upon a player by executing this on his machine:
player setCurrentTask tskExample1;

This will highlight the objective marker, and show him the through the HUD where the objective is.


Now all that there's left, is setting the task status:
tskExample1 setTaskState "SUCCEEDED";
tskExample1 setTaskState "FAILED";
tskExample1 setTaskState "CANCELED";
tskExample1 setTaskState "CREATED";

"SUCCEEDED" = Makes the checkbox green
"FAILED" = Puts a red cross in the checkbox
"CANCELED" = Puts a grey diagonal line through the checkbox
"CREATED" = Clears the checkbox (makes it look like you've just created it)


You can also show the state of the task with the taskHint command, but since that command is kinda hard to use, we're gonna use a function that I've made to make a lot easier to show the task state.


How to make task hints

If you wanna make taskHints that look like this:

then go and grab my taskHint function  at http://www.ofpec.com/forum/index.php?topic=33768.0


And that's pretty much it for a basic briefing. I'll try to add more advanced stuff to it when I have some more time.


Some templates you can use:
« Last Edit: 12 Nov 2009, 13:28:20 by mikey »

Offline kju

  • Members
  • *
    • PvPScene - The ArmA II multiplayer community
Re: How to make a basic briefing in ArmA 2
« Reply #1 on: 05 Jun 2009, 18:18:30 »
wow - thanks a lot for sharing mikey  :good:

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: How to make a basic briefing in ArmA 2
« Reply #2 on: 06 Jun 2009, 02:47:42 »
This is great stuff, how about a demo mission ticking the tasks complete too?
Xbox Rocks

Offline Binkowski

  • OFP-fanatic
  • OFPEC Patron
  • ****
    • My Personal Website
Re: How to make a basic briefing in ArmA 2
« Reply #3 on: 06 Jun 2009, 03:07:46 »
Thanks for sharing! It really helps, and as hoz requested, demo mission?  ;)

Offline fleepee

  • Members
  • *
  • Enter the Matrix!
Re: How to make a basic briefing in ArmA 2
« Reply #4 on: 20 Jun 2009, 20:15:55 »
really helpfull, glad I found it! :D

Offline loki72

  • Former Staff
  • ****
    • Loki's Nightmare
Re: How to make a basic briefing in ArmA 2
« Reply #5 on: 20 Jun 2009, 22:04:35 »
has then been (accepted) as a tutorial yet? i know it saved me from listening to ppl say 'there's no tasks in your mission'.. if anyone actually tried it yet. :blink: :P

but good job for sure
« Last Edit: 20 Jun 2009, 22:34:13 by loki72 »

Offline fleepee

  • Members
  • *
  • Enter the Matrix!
Re: How to make a basic briefing in ArmA 2
« Reply #6 on: 23 Jun 2009, 09:43:57 »
does anybody knows how to add pictures in those briefing?! ???

Offline misein

  • Members
  • *
Re: How to make a basic briefing in ArmA 2
« Reply #7 on: 24 Jun 2009, 00:51:46 »
Quote
<img image='img\C3_PLHlagushina_ca.paa' width='256' />

;)

Offline etjester

  • Members
  • *
Re: How to make a basic briefing in ArmA 2
« Reply #8 on: 24 Jun 2009, 06:55:54 »
Hi.

I've been using the technique in the OP to make objectives, and it works as intended for single player.  However, I've had trouble making multiplayer missions.  I'm using RespawnType 5 to allow players to use teamswitch upon death to enter the body of another Playable soldier.  However, any active objectives and objective markers don't seem to reappear after the respawn.  Objectives that are subsequently created during the mission will still appear, but I'm wondering how to make a player respawn with all the objectives they had prior to their death.

Any suggestions?

Offline mikey

  • Former Staff
  • ****
  • Whitespace Whore
Re: How to make a basic briefing in ArmA 2
« Reply #9 on: 24 Jun 2009, 14:40:27 »
try my briefing template which I know works with group respawn, but I've never ever tried Side respawn nor teamswitching. so ymmv...


Updated:

added
Code: [Select]
waitUntil { !isNil {player} };
waitUntil { player == player };
because of reports that the briefing didnt run at all for some reason



exchanged
Code: [Select]
format ["%1", player getVariable "mk_killedEHadded"] == "<null>" for
Code: [Select]
isNil{player getVariable "mk_killedEHadded"}because it looks better (and probably saves a few cycles)


People who've had problems should definitely give this a try.



edit:
** the above might be obsolete, check the latest version of the template in the first post **
« Last Edit: 20 Jul 2009, 13:08:43 by mikey »

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re: How to make a basic briefing in ArmA 2
« Reply #10 on: 24 Jun 2009, 22:31:13 »
Really helpful. * Downloading for future use *
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Offline etjester

  • Members
  • *
Re: How to make a basic briefing in ArmA 2
« Reply #11 on: 25 Jun 2009, 15:02:09 »
try my briefing template which I know works with group respawn, but I've never ever tried Side respawn nor teamswitching. so ymmv...

This works, but it treats all objectives as unfinished upon respawn. If you complete an objective and then die, it will tell you that the objective isn't completed yet when you spawn again.

Offline Ext3rmin4tor

  • Members
  • *
Re: How to make a basic briefing in ArmA 2
« Reply #12 on: 27 Jun 2009, 19:33:31 »
What about multilanguage briefings? Do you need to use stringtable.csv to make them?
How can you shoot women and children?
Easy! Ya' just don't lead'em so much! Ain't war hell?!!

Offline bronx187

  • Members
  • *
Re: How to make a basic briefing in ArmA 2
« Reply #13 on: 28 Jun 2009, 14:24:11 »
hi there i was very happy reading this only i have put the files in my mission folder (my document/arma 2/user/usermissions.... briefing.sqf and a init.sqf
only it is not working, now the only thing i know is that i inserted in my init.sqf only execVM"briefing.sqf"; maybe thats a problem pls anyone help me

thanks,

Offline Ext3rmin4tor

  • Members
  • *
Re: How to make a basic briefing in ArmA 2
« Reply #14 on: 28 Jun 2009, 23:44:33 »
the line is

[] execVM "briefing.sqf"
How can you shoot women and children?
Easy! Ya' just don't lead'em so much! Ain't war hell?!!

Offline fleepee

  • Members
  • *
  • Enter the Matrix!
Re: How to make a basic briefing in ArmA 2
« Reply #15 on: 29 Jun 2009, 07:47:53 »
Quote
What about multilanguage briefings? Do you need to use stringtable.csv to make them?

Yes, that's what I've done... ;)

Re: How to make a basic briefing in ArmA 2
« Reply #16 on: 06 Jul 2009, 20:01:09 »
<SOLVED>

Hello,

I'm trying to have completion of task1 create a new task: task4. Here is the code I'm using:

Code: [Select]
if task4trigger == go then {
task4 = player createSimpleTask["Free Hostages"];
task4 setSimpleTaskDescription["Free the <marker name=""taskmarker4"">hostages</marker>.", "Free Hostages", "Free Hostages"];
task4 setSimpleTaskDestination markerpos "taskmarker4";
};

task1 = player createSimpleTask["Insertion"];
task1 setSimpleTaskDescription["Infiltrate into the area of operations by Zodiac <marker name=""taskmarker1"">here</marker>.", "Insertion", "Insertion"];
task1 setSimpleTaskDestination markerpos "taskmarker1";
player setCurrentTask task1;

In the editor I have a radio-activated trigger with the following in On Act:

Code: [Select]
task1 setTaskState "SUCCEEDED"; task4trigger = go

Unfortunately no new tasks show up. Any help would be appreciated. :)

<SOLVED>

EDIT: I got it to work in the trigger on act field:

Code: [Select]
task2 setTaskState "SUCCEEDED";
hint "New objective added: Rescue the hostages";
 _taskmarker3 = createMarker ["taskmarker3", position campfire];
"taskmarker3" setMarkerType "mil_objective";
"taskmarker3" setMarkerText "Rescue hostages";
"taskmarker3" setMarkerPos getMarkerPos "taskmarker3ghost";
task3 = recon1 createSimpleTask["Rescue Hostages"];
task3 setSimpleTaskDestination (getMarkerPos "taskmarker3ghost");
task3 setSimpleTaskDescription["Rescue the hostages from their Russian captors.", "Hostage Rescue", "Hostage Rescue"]


« Last Edit: 07 Jul 2009, 21:41:11 by [BBE] Soul Assassin »

Offline Rommel92

  • Members
  • *
Re: How to make a basic briefing in ArmA 2
« Reply #17 on: 07 Jul 2009, 06:09:14 »
Heres how I set up mine:
Code: [Select]
_briefing =
[
[
"Command and Signals",
[
"Order of Seniority",
"Call signs (C/S)",
"Location of HQ"
]
],
[
"Administration and Logistics",
[
"Weapons and Ammunition",
"Equipment and Special Equipment",
"Equipment (Maps, watches and radios etc), Special Equipment (Laser Markers, Satchel Charges etc)",
"Medical"
]
],
[
"Execution",
[
...
]
],
[
"Mission",
[
...
]
],
[
"Situation",
[
...
"Neutral Forces",
...
"Friendly Forces",
...
"Enemy Forces"
]
]
];
{
_title = _x select 0;
_messages = _x select 1;
{
player createDiaryRecord ["Diary", [_title, _x]];
}foreach _messages;
} foreach _briefing;

tasksInMission = [];
tasksInMission set [1, player createSimpleTask ["taskRTB"]];
(tasksInMission select 1) setSimpleTaskDescription ["1st Platoon must return to C.HQ NLT 070000h July 2009", "Return to C.HQ", "RTB"];
(tasksInMission select 1) setSimpleTaskDestination (getMarkerPos "respawn_west");

tasksInMission set [0, player createSimpleTask ["taskClearTAOR"]];
(tasksInMission select 0) setSimpleTaskDescription ["TAOR must be clear NLT 062200h July 2009", "Patrol TAOR Alpha", "TAOR"];
(tasksInMission select 0) setSimpleTaskDestination (getMarkerPos "taskMkrTAOR");

"tasksPublicVariable" addPublicVariableEventHandler {
{
_state = "SUCCEEDED";
if (count _x > 1) then {
_state = (_x select 1);
};
(_x select 0) setTaskState _state;
if (count _x > 2) then {
_color = "ColorGreen";
if (count _x > 3) then {
_color = (_x select 3);
};
(_x select 2) setMarkerColorLocal _color;
};
} foreach (_this select 0);
};

Offline VanhA

  • Members
  • *
Re: How to make a basic briefing in ArmA 2
« Reply #18 on: 09 Jul 2009, 08:46:05 »
I've had the briefing working fine so far.But I've only had 2 objectives.
Now I'm making a new one with 4 objectives and ran into a problem where only 2 of them show up.
(Objectives 3 & 4 aka two first ones in the briefing.sqf)

Is there some limit how many objectives  are shown at briefing?  :blink:

BR
VanhA

Offline Rommel92

  • Members
  • *
Re: How to make a basic briefing in ArmA 2
« Reply #19 on: 09 Jul 2009, 16:56:36 »
There is no limit AFAIK. No problems as so far as I've seen.

Offline VanhA

  • Members
  • *
Re: How to make a basic briefing in ArmA 2
« Reply #20 on: 10 Jul 2009, 08:47:15 »
True.
When I tried it with template by Mikey I got it working fine.
Sorted.  :good:

Offline mikey

  • Former Staff
  • ****
  • Whitespace Whore
Re: How to make a basic briefing in ArmA 2
« Reply #21 on: 19 Jul 2009, 15:42:43 »
Updated the tutorial and the briefing template to 0.02

Changelog:
- Added an example to manipulate image width and/or height
- Added info about my mk_taskHint function
- No longer using "isNil {player}" anymore, since that was so 2006  (thnx to spooner for that one) :)
- Changed the variable name used for briefing respawn
- No longer a Zeus briefing, so the template name was changed

Future plans:
Making a briefing template that will use public var's, so the task states will be synced on JIP and when respawning.

Offline hoz

  • OFPEC Site
  • Administrator
  • *****
Re: How to make a basic briefing in ArmA 2
« Reply #22 on: 30 Jul 2009, 16:08:32 »
mikey, could you include / package the files up into a demo mission as well?
Xbox Rocks

Offline mikey

  • Former Staff
  • ****
  • Whitespace Whore
Re: How to make a basic briefing in ArmA 2
« Reply #23 on: 01 Aug 2009, 16:27:39 »
Simple example mission added.

Offline Trexian

  • Members
  • *
Re: How to make a basic briefing in ArmA 2
« Reply #24 on: 15 Sep 2009, 14:36:29 »
Quote
<img image='img\C3_PLHlagushina_ca.paa' width='256' />

Is .paa the only acceptable format for pics in the briefing now?  I coulda sworn I used jpg in A1.   :scratch:

And, I have an old .paa plugin for photoshop, but had heard there may be different compression now?  Any confirmation of that?

TIA.
T

Edit: oh, and what's the max size? :)
« Last Edit: 15 Sep 2009, 14:59:09 by Trexian »
Sic semper tyrannosauro.

Offline mikey

  • Former Staff
  • ****
  • Whitespace Whore
Re: How to make a basic briefing in ArmA 2
« Reply #25 on: 15 Sep 2009, 15:52:54 »
You can use jpg's as wel, and I do not know of a max image size, but don't forget that the little briefing window isn't that big to begin with...


edit:
kegetys made an update for his PS paa plugin
« Last Edit: 15 Sep 2009, 15:54:43 by mikey »

Offline Trexian

  • Members
  • *
Re: How to make a basic briefing in ArmA 2
« Reply #26 on: 15 Sep 2009, 16:36:36 »
Yeah, but I think I screwed something up.  I had jpgs, but they were just black in the briefing.  And I agree - there ain't much room there. :)

Thanks for the Kegetys update! :)
Sic semper tyrannosauro.

Offline mikey

  • Former Staff
  • ****
  • Whitespace Whore
Re: How to make a basic briefing in ArmA 2
« Reply #27 on: 15 Sep 2009, 16:50:10 »
I sometimes used to have problems with black jpg's as well in arma1. I think it had to do something with the compression or amount of compression used, or the colourspace, i dunno. Sometimes it's a black art getting something to work with BIS games  ;)

Offline Undeceived

  • Members
  • *
    • My missions and campaigns
Re: How to make a basic briefing in ArmA 2
« Reply #28 on: 25 Sep 2009, 10:05:07 »
Thank you very much for this, mikey!
Current project: Black Lands (Arma 3)

Offline K9PT

  • Members
  • *
Re: How to make a basic briefing in ArmA 2
« Reply #29 on: 23 Aug 2010, 21:58:52 »
Quote
What about multilanguage briefings? Do you need to use stringtable.csv to make them?

Yes, that's what I've done... ;)


How you do this?

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: How to make a basic briefing in ArmA 2
« Reply #30 on: 04 Sep 2010, 08:35:00 »
@K9PT

Most probably by using the stringtable exactly as it's supposed to be used, e.g.:

Code: [Select]
LANGUAGE, "English", "Swedish Chef"

STR_Task1, "Attack the meatball fortress.", "Bork bork bork bork köttbullar bork bork";
STR_Task1Desc1, "Meatball fortress", "Bork bork köttbullar";
STR_Task1Desc2, "Meatballs!", "Bork!";

And then use localize instead of writing out the actual pieces of string:

Code: [Select]
Task1 setSimpleTaskDescription [localize "STR_Task1", localize "STR_Task1Desc1", localize "STR_Task1Desc2"];
It's actually a lot easier than the old method which presupposed a different language .html for each language! But then again, the briefing.html is still needed for the debriefing, so I guess you'll still need to add them  ::)

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline Variable

  • Members
  • *
  • Fighting for peace is like fucking for virginity
    • Comrades in Arms
Re: How to make a basic briefing in ArmA 2
« Reply #31 on: 28 May 2011, 13:27:16 »
Hi, and thank you!
Where should the image must be saved in order to be displayed in the briefing?
Ok, managed that, but now the picture is showing all white. Can someone help?
This is my code:
Code: [Select]
<img image='warheads.jpg' width='200' height='200'/>
« Last Edit: 28 May 2011, 13:56:16 by Variable »

Offline Variable

  • Members
  • *
  • Fighting for peace is like fucking for virginity
    • Comrades in Arms
Re: How to make a basic briefing in ArmA 2
« Reply #32 on: 04 Jun 2011, 00:59:40 »
Managed to fix the problem by converting the JPEG image to PAA.