Announcement

Collapse
No announcement yet.

Briefing -- All upcoming mapmakers should follow this

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Briefing -- All upcoming mapmakers should follow this

    I found this awhile back and its VERY helpful. Just copy/paste it into your own briefing.sqf and have init.sqf have a line with:

    Code:
    null = execVM "briefing.sqf";
    Code:
    /*
      *	Unofficial Zeus Briefing Template v0.01
      *
      *
      *	Notes: 
      *		- Use the tsk prefix for any tasks you add. This way you know what the varname is for by just looking at it, and 
      *			aids you in preventing using duplicate varnames.
      *		- To add a newline: 		<br/>
      *		- To add a marker link:	<marker name='mkrObj1'>attack this area!</marker>
      *		- To add an image: 		<img image='somePic.jpg'/>
      *
      *		Required briefing commands:		
      *		- Create Note:			player createDiaryRecord ["Diary", ["*The Note Title*", "*The Note Message*"]]; 
      *		- Create Task:			tskExample = player createSimpleTask ["*The Task Title*"];
      *		- Set Task Description:	tskExample setSimpleTaskDescription ["*Task Message*", "*Task Title*", "*Task HUD Title*"];
      *		
      *		Optional briefing commands:
      * 		- Set Task Destination:	tskExample setSimpleTaskDestination (getMarkerPos "mkrObj1"); // use existing "empty marker" 
      *		- Set the Current Task:	player setCurrentTask tskExample;
      *		
      *		Commands to use in-game:
      *		- Set Task State:		tskExample setTaskState "SUCCEEDED";   // states: "SUCCEEDED"  "FAILED"  "CANCELED" 
      *		- Get Task State:		taskState tskExample;
      *		- Get Task Description:	taskDescription tskExample;   // returns the *task title* as a string
      *		- Show Task Hint:		[tskExample] call mk_fTaskHint; // make sure you've set the taskState before using this function 
      *							
      *
      *	Authors: Jinef & mikey
      */
    
    // since we're working with the player object here, make sure it exists
    waitUntil { !isNil {player} };
    waitUntil { player == player };
      
    switch (side player) do 
    {
    	
    	case WEST: // BLUFOR briefing goes here
    	{
    		if (player in group AlphaSquad) then
    		{};
    	};
    	
    	
    	case EAST: // REDFOR briefing goes here
    	{	
    	};
    	
    	
    	case RESISTANCE: // RESISTANCE/INDEPENDENT briefing goes here
    	{
    		
    		
    	};
    	
    	
    	case CIVILIAN: // CIVILIAN briefing goes here
    	{
    		
    		
    	};
    };

    Note that you can give different tasks for each side and different tasks even for each group. While in those brackets you can EVEN give different markers or hide markers not pertaining to their group.

    I hope I see you all using this sort of system in the future so BLUFOR and OPFOR dont see each others objectives nor do they see each others markers.

    Make sure your logic for failing/completing an objective only runs on players that actually have that objective.
    ---Bellicosity---


  • #2
    Re: Briefing -- All upcoming mapmakers should follow this

    That looks like a good and useful template, except his part:
    Code:
    null = execVM "briefing.sqf";
    Wouldn't that actually assign briefing.sqf's returned value(in this case the script handle) to a variable named null?

    Why not just use
    Code:
    [] execVM "briefing.sqf";

    Comment


    • #3
      Re: Briefing -- All upcoming mapmakers should follow this

      Yeh. I've seen this everywhere :P It's a good template for starters. But meh.

      Comment


      • #4
        Re: Briefing -- All upcoming mapmakers should follow this

        Originally posted by PCLiPSE View Post
        Yeh. I've seen this everywhere :P It's a good template for starters. But meh.
        Well considering like every game I've played here I can see everyone's tasks and markers... I thought I should post it up
        ---Bellicosity---

        Comment


        • #5
          Re: Briefing -- All upcoming mapmakers should follow this

          Good post! Thanks for the info!


          IN GAME ARMA: |TG-Irr| Lq.Snake

          Comment


          • #6
            Re: Briefing -- All upcoming mapmakers should follow this

            null isn't a variable, it's a declaration. Since briefing.sqf isn't a void, it must return a value (the script handle). Declaring the return value to be null is more efficient because it immediately dismisses the return (the return isn't necessary in a standard mission context), and frees up that teeny piece of memory that is otherwise used by the code you suggested.

            Comment


            • #7
              Re: Briefing -- All upcoming mapmakers should follow this

              In Arma1 you could give nil any value you wanted, which was a very elaborate way to screw up scripts if you ask me, but I haven't tested it with null.

              Anyway, this syntax
              Code:
              null = execVM "briefing.sqf";
              specifically instrucs the engine to assign the value after "=" to null.

              This
              Code:
              []execVM "briefing.sqf" = null;
              would get the return value, a script handle in this case, and set it to null. How much this helps with performance I have no idea, but probably not much.

              Comment


              • #8
                Re: Briefing -- All upcoming mapmakers should follow this

                FYI I just tested it ingame, and it goes exactly as I said. In BIS world null is a variable and you can give it any value you want. Using the original syntax assigns the scripthandle to null.

                Comment


                • #9
                  Re: Briefing -- All upcoming mapmakers should follow this

                  well I come from c++ so when I saw someone using null = whatever I just assumed that they were throwing the variable away.

                  Either way, considering I globally never USE null except to throw a variable away, it doesnt make that big of a difference
                  ---Bellicosity---

                  Comment


                  • #10
                    Re: Briefing -- All upcoming mapmakers should follow this

                    Good for beginners, but helpful for everyone. I was surprised how much they changed briefing since OFP and Arma 1.

                    Comment


                    • #11
                      Re: Briefing -- All upcoming mapmakers should follow this

                      Ye, to be honest I wish they had put more effort into other issues with the game rather than completely reworking the mission briefing style, we did a perfectly good job!

                      For those of us with ZEO programming experience it is a major pain in the butt having to learn this new style and format.
                      BlackDog1




                      "What we do in life... echoes in eternity!"

                      Comment


                      • #12
                        Re: Briefing -- All upcoming mapmakers should follow this

                        ZEO? That some kind of Java derivative?

                        Comment


                        • #13
                          Re: Briefing -- All upcoming mapmakers should follow this

                          Originally posted by DLBlue View Post
                          well I come from c++ so when I saw someone using null = whatever I just assumed that they were throwing the variable away.

                          Either way, considering I globally never USE null except to throw a variable away, it doesnt make that big of a difference
                          I hope you're not setting things to null in C++ to throw a variable away... NULL(which is just 0 in C++) should really only be used to check if an object has been instantiated(and even then.........).


                          Originally posted by Blackdog1-22 Reg.SAS
                          For those of us with ZEO programming experience it is a major pain in the butt having to learn this new style and format.
                          Even with a bunch of programming experience this scripting language is weird... I'm just starting to get into it and so far, not so fun.

                          Comment


                          • #14
                            Re: Briefing -- All upcoming mapmakers should follow this

                            Originally posted by blibblob View Post
                            I hope you're not setting things to null in C++ to throw a variable away... NULL(which is just 0 in C++) should really only be used to check if an object has been instantiated(and even then.........).



                            Even with a bunch of programming experience this scripting language is weird... I'm just starting to get into it and so far, not so fun.
                            Ha, no... I just assumed that when they assigned something to null that they were throwing it away because they were assigning it to nothing. The only part C++ plays in this whole thing is getting the idea that null is nothing.
                            ---Bellicosity---

                            Comment


                            • #15
                              Re: Briefing -- All upcoming mapmakers should follow this

                              Bad habit to set script handles to null or nil. If you ever actually NEED that value for something, it is now worthless in the mission as it is no longer actually null or nil, it is the handle returned from the script.

                              Make a random handle name, preferably a descriptive one if you need to have a handle. You generally don't need handles on scripts unless you need to terminate them before they are complete, or if you need to know when one completes. Also, when calling a script from the editor (init lines, triggers, etc.) you need a script handle. So, use a non-existing variable name, I chose "id" because those were the first 2 keys I hit that didn't make a useful variable name ;)

                              Comment

                              Connect

                              Collapse

                              TeamSpeak 3 Server

                              Collapse

                              Advertisement

                              Collapse

                              Twitter Feed

                              Collapse

                              Working...
                              X