Page 1 of 36 1234511 ... LastLast
Results 1 to 10 of 354

  Click here to go to the first Developer post in this thread.  

Thread: Basic Briefing howto

  1. #1

    Basic Briefing howto

    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:
    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/>
    Ampersand: &amp;
    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.



    Templates

    I've made briefing.sqf and briefing.html templates. Grab them at ofpec:

    http://www.ofpec.com/forum/index.php?topic=33468.0
    Last edited by Mike84; Jul 29 2009 at 09:58.

  2. #2
    Quite useful, but should'nt stuff like this be posted in the community wiki though?

  3. #3
    When you select this task as current task, the marker will light up.
    Hmm, is there a way to not make it 'light up', since often we will use separate markers for different types of tasks (attack, defend)?
    Regards
    Carl Gustaffa - left this game due becoming Steam Exclusive

  4. #4
    Suspended Member
    Join Date
    Dec 16 2007
    Posts
    205
    Author of the Thread
    well, if you put a destination to the task it will create a marker. So if you dont want the game-engine to add a marker there, just omit the setSimple taskDestination command

  5. #5
    Quote Originally Posted by CarlGustaffa View Post
    Hmm, is there a way to not make it 'light up', since often we will use separate markers for different types of tasks (attack, defend)?
    True, use an invisible marker to get the same effect you saw in the campaign, ie. the orange marker thing. I was wondering why BIS had put the invis marker on top until i figured that out.

  6. #6
    Thanks for the guide mate! Did you figure out how to use links inside the briefing and is it possible to add something to the map section of the briefing as well?

    greetings
    I’m aware of that!

  7. #7
    Thank god! I've been racking my brains over getting a briefing to work for the last couple of hours and was just about to start another thread.

    Edit- Not working for me, guess I'll have to wait for something more idiot proof.

    Edit edit- Finally got it
    Last edited by froggyluv; Jun 5 2009 at 04:54.
    ~The bearly literate pugilist~

    Force AI to use their proper weapon! http://feedback.arma3.com/view.php?id=8829

    Stop discrimination! Fight for bot rights for them to thrive indoors! http://feedback.arma3.com/view.php?id=8671 -Please revote this! Previous one was mistakenly directed to DevHeaven only!

    Add Distance to Target/Gear Menus: http://feedback.arma3.com/view.php?id=8666

    Spoiler:

  8. #8
    Finally! I couldn't find anything about new briefings, thanks!

  9. #9
    CWR² Developer SaOk's Avatar
    Join Date
    Nov 23 2006
    Location
    Helsinki, Finland
    Posts
    1,342
    How can I hide a task at start and make it active (visible) later? Or is it possible to add tasks in middle of the other tasks during the mission? Having the tasks in right order would be important in bigger and complex missions.

  10. #10
    CWR² Developer SaOk's Avatar
    Join Date
    Nov 23 2006
    Location
    Helsinki, Finland
    Posts
    1,342
    Thanks - that works great.

Page 1 of 36 1234511 ... LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •