No announcement yet.

Briefing disappears after respawn in MP Arma 2

  • Filter
  • Time
  • Show
Clear All
new posts

  • Briefing disappears after respawn in MP Arma 2

    Yesterday we played my Arma 2 CoOp mission, Shock and Awe. I don't know why, but after respawn briefing disappears and its nothing over there, but map. I think it also happens when someone joined the game during the session.

    For respawn I used default: "respawn_west" and I think this is the reason. Maybe I should write the briefing just for "West" side?

    I'm confused, here is the copy of briefing:

    Originally posted by init.sqs

    execVM "briefing.sqf"

    Originally posted by briefing.sqs

    // Function file for Armed Assault
    // Created by: TODO: Author Name

    // last created entries go on top, so reverse the order

    // some examples ///

    //// Set a Task as current Task (will highlight the task marker, and show the task on the HUD)
    //player setCurrentTask tskExample1;

    //// set a task to completed or failed (put this in a trigger or something)
    // tskExample1 setTaskState "SUCCEEDED";
    // tskExample1 setTaskState "FAILED";

    // //// example of random task
    // // bob is a enemy mortar gun, with a probability of presence of 50%,
    // // so if he exists, add the task to destroy it
    // if (alive bob) then { // if the mortar is present, give the task to destroy it
    // tskMortar = player createSimpleTask["objective3"]; // adds a task w/o desc or marker
    // tskMortar setSimpleTaskDescription["Find and destroy the mortar NAPA forces are using to shell nearby civilian towns.", "Destroy mortar", "Destroy Mortar"];
    // };

    // create a simple note in the briefing
    player createDiaryRecord["Diary", ["Mission", "We will take out enemy AA defences, which are located on the <marker name='aa'>hill</marker>. Then, destroy <marker name='aaradar'>AA Radar</marker> that is not too far from the first objective. When airspace around the border open, we will use our helicopters to raid the <marker name='airfield'>airport</marker>. Our intel is sure that they have own <marker name='zu23'>AA missiles</marker>, so it is not recommended for pilots to get really close to the base. When our guys will be spotted around the airport, Chernarus <marker name='planes'>jets</marker> will take off to give their soldiers Close Air Support. If this happens, you can try block <marker name='runway'>runway</marker> with some vehicles. This might keep the planes on the ground. Remeber that you can block runway only on <marker name='run'>limited distance</marker> (orange rectangle), because farther away planes will be able to take off. When everybody is ready, we will return on the board of the <marker name='c130'>C-130</marker> to <marker name='rterritory'>Russian Territory</marker>. We heard about Chernarus army killing civilians, who opposed their government. There are some <marker name='grave'>mass graves</marker> and we want pictures of it, to show to the world. We are attacking another country and this will help take some of worlds attention from our sholders.<br><br> Good Luck Marines! Mission made by Mike (Mikee) for Tactical Gamer, have fun!"]];
    player createDiaryRecord["Diary", ["Situation", "Three days ago our plane <marker name='c130'>C-130 Hercules</marker> was forced by enemy jets to land on military <marker name='airfield'>airport</marker> in Chernarus. <marker name='crew'>Crew</marker> was arested. Oficially, the plane got lost and flew into Chernarus airspace accidently. Really, crew on the board of C-130 was doing intelligence reconnaissance. Of course, U.S. government is denying everything. However, we can't play this game any longer, because equipment of the plane shows that we are lying. It would be best if crew, together with the plane just came back to U.S. We have green light. If everything go they way it suppose, Chernarus government won't be able to give out any evidence and we will make it look as rescue of pilots from hostile country. Our president made emergency call to Russian President Dmitrij Miedwiediew just yesterday and Russians were so kindly to let us use one of their <marker name='base'>bases</marker>, which is located close the Chernarus <marker name='border'>border</marker>."]];

    // <br/> is a line break, forcing the text behind it to go on a new line

    tskExample5 = player createSimpleTask["Mass Graves"]; // adds a task w/o desc or marker
    tskExample5 setSimpleTaskDescription["Find the <marker name='grave'>mass graves</marker>. <br/><br/>", "Mass Graves", "Task HUD Title"];
    tskExample5 setSimpleTaskDestination (getMarkerPos "grave"); // make sure you've added a marker!

    // create a task
    tskExample4 = player createSimpleTask["Crew"]; // adds a task w/o desc or marker
    tskExample4 setSimpleTaskDescription["Free C-130's <marker name='crew'>crew</marker>. <br/><br/>", "Crew", "Task HUD Title"];
    tskExample4 setSimpleTaskDestination (getMarkerPos "crew"); // make sure you've added a marker!

    // create a task
    tskExample3 = player createSimpleTask["Airbase"]; // adds a task w/o desc or marker
    tskExample3 setSimpleTaskDescription["Raid enemy <marker name='airfield'>airport</marker> and evacuate on the board of <marker name='c130'>C-130</marker> to <marker name='rterritory'>friendly territory</marker>. <br/><br/>", "Airbase", "Task HUD Title"];
    tskExample3 setSimpleTaskDestination (getMarkerPos "c130"); // make sure you've added a marker!

    // create a task
    tskExample2 = player createSimpleTask["Anti-Air radar"]; // adds a task w/o desc or marker
    tskExample2 setSimpleTaskDescription["Destroy enemy <marker name='aaradar'>radar</marker>. This will open up airspace farther inside the country. <br/><br/>", "Anti-Air radar", "Task HUD Title"];
    tskExample2 setSimpleTaskDestination (getMarkerPos "aaradar"); // make sure you've added a marker!

    // create a task
    tskExample1 = player createSimpleTask["Anti-Air defences"]; // adds a task w/o desc or marker
    tskExample1 setSimpleTaskDescription["Destroy Shilka and AA missiles located on <marker name='aa'>this</marker> hill. <br/><br/>", "Anti-Air defences", "Task HUD Title"];
    tskExample1 setSimpleTaskDestination (getMarkerPos "aa"); // make sure you've added a marker!

  • #2
    Re: Briefing disappears after respawn in MP Arma 2

    I encountered this as well... Basically you have to call the briefing script on respawn to get it back. This goes for any other updates as well, like completed tasks, new tasks since first spawn, etc.

    I'll see if I can find the exact code. All I can remember is I put a new event handler on the init of each unit so that when they respawned it would call the briefing. This was before I started using the revive script.


    Write this in the init from all your playable units:
    this addEventHandler ["killed", {_this execVM "respawn_player.sqf";}];

    sleep playerRespawnTime;
    player exec "briefing.sqs";
    Last edited by dagi; 07-17-2009, 10:12 AM.


    • #3
      Re: Briefing disappears after respawn in MP Arma 2

      Yea, it would be nice if someone help me out with this problem :).


      • #4
        Re: Briefing disappears after respawn in MP Arma 2

        Here's a briefing from a map I did that has the fix to the problem you are having

          *	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
                     player createDiaryRecord["Diary", ["Notice To Pilots", "Russian troops have multiple anti-air weapons located throughout the country, be careful."]];
                     player createDiaryRecord["Diary", ["Guerrillas", "Insurgents have moved out of the towns and into the forests. Intel reports they may have friendly relations with the Russians."]];
                     tskDestroyWestSubstation = player createSimpleTask["Destroy West Substation"]; 
                     tskDestroyWestSubstation setSimpleTaskDescription["Completely destroy the substation", "Destroy West Substation", "Destroy Substation"];
                     tskDestroyWestSubstation setSimpleTaskDestination (getMarkerPos "SubStationMark");
                     tskDestroyEastSubstation = player createSimpleTask["Destroy East Substation"]; 
                     tskDestroyEastSubstation setSimpleTaskDescription["Completely destroy the substation", "Destroy East Substation", "Destroy Substation"];
                     tskDestroyEastSubstation setSimpleTaskDestination (getMarkerPos "SubStationMark_1");
                     tskGreenMountain = player createSimpleTask["Destroy Green Mountain Radio Generator"]; 
                     tskGreenMountain setSimpleTaskDescription["Destroy the power generator supplying the Green Mountain radio station", "Destroy Green Mountain Radio Generator", "Destroy Generator"];
                     tskGreenMountain setSimpleTaskDestination (getMarkerPos "Radio_1");
                     tskPulkovo = player createSimpleTask["Destroy Pulkovo Radio Tower"]; 
                     tskPulkovo setSimpleTaskDescription["Destroy the Radio Tower near Pulkovo", "Destroy Pulkovo Radio Tower", "Destroy Radio Tower"];
                     tskPulkovo setSimpleTaskDestination (getMarkerPos "Radio_4");
                     tskPopIvan = player createSimpleTask["Destroy Pop Ivan Radio Tower"]; 
                     tskPopIvan setSimpleTaskDescription["Destroy the Radio Tower near Pop Ivan", "Destroy Pop Ivan Radio Tower", "Destroy Radio Tower"];
                     tskPopIvan setSimpleTaskDestination (getMarkerPos "Radio");
                     tskVysota = player createSimpleTask["Destroy Vysota Radio Tower"]; 
                     tskVysota setSimpleTaskDescription["Destroy the Radio Tower near Vysota", "Destroy Vysota Radio Tower", "Destroy Radio Tower"];
                     tskVysota setSimpleTaskDestination (getMarkerPos "Radio_3");
                     tskBalota = player createSimpleTask["Destroy Balota Radio Tower"]; 
                     tskBalota setSimpleTaskDescription["Destroy the Radio Tower near Balota", "Destroy Balota Radio Tower", "Destroy Radio Tower"];
                     tskBalota setSimpleTaskDestination (getMarkerPos "Radio_2");
                     tskConvoy = player createSimpleTask["Destroy the Fuel Convoy"]; 
                     tskConvoy setSimpleTaskDescription["The fuel convoy has a few known stops but there may be others. Find, intercept and destroy all three fuel trucks.", "Destroy the Fuel Convoy", "Destroy Convoy"];
                     tskConvoy setSimpleTaskDestination (getMarkerPos "Route");
                     tskOfficer = player createSimpleTask["Assasinate Officers"]; 
                     tskOfficer setSimpleTaskDescription["Each known Russian base has an officer. We could severly hamper their ability to fight if they were killed.", "Assasinate Officers", "Kill Officers"];
        	     if (destroyWestSubstation) then { tskDestroyWestSubstation setTaskState "SUCCEEDED"; };
                     if (destroyEastSubstation) then { tskDestroyEastSubstation setTaskState "SUCCEEDED"; };
                     if (greenMountain) then { tskgreenMountain setTaskState "SUCCEEDED"; };
                     if (pulkovo) then { tskPulkovo setTaskState "SUCCEEDED"; };
                     if (popIvan) then { tskPopIvan setTaskState "SUCCEEDED"; };
                     if (vysota) then { tskVysota setTaskState "SUCCEEDED"; };
                     if (balota) then { tskBalota setTaskState "SUCCEEDED"; };
                     if (convoy) then { tskConvoy setTaskState "SUCCEEDED"; };
                     if (officer) then { tskOfficer setTaskState "SUCCEEDED"; };
        	case EAST: // REDFOR briefing goes here
        	case RESISTANCE: // RESISTANCE/INDEPENDENT briefing goes here
        	case CIVILIAN: // CIVILIAN briefing goes here
        // run this file again when respawning (only setup the killed EH once though)
        if ( isNil{player getVariable "mk_killedEHadded"} ) then 
        	player addEventHandler ["killed", 
        		[] spawn {
        			waitUntil { alive player }; // waitUntil player has respawned
        			execVM "briefing.sqf"; 
        	player setVariable ["mk_killedEHadded", true];
        destroyWestSubstation = false;
        destroyEastSubstation = false;
        greenMountain = false;
        pulkovo = false;
        popIvan = false;
        vysota = false;
        balota = false;
        convoy = false;
        officer = false;
        publicVariable "destroyWestSubstation";
        publicVariable "destroyEastSubstation";
        publicVariable "greenMountain";
        publicVariable "pulkovo";
        publicVariable "popIvan";
        publicVariable "vysota";
        publicVariable "balota";
        publicVariable "convoy";
        publicVariable "officer";     
        After every objective the SERVER and only the SERVER updates a variable associated with that objective to true and publicVariables it. Then on every respawn the player reloads the briefing and gets the updated state of things.


        • #5
          Re: Briefing disappears after respawn in MP Arma 2

          Where I should add eventhandler? can you help me out with this?


          • #6
            Re: Briefing disappears after respawn in MP Arma 2

            In the briefing.sqf

            Just read the one I posted as an example. Its not that complicated


            • #7
              Re: Briefing disappears after respawn in MP Arma 2

              Did you ever get this solved? I see a few problems with the posted code .. you are exchanging SQS and SQF freely, and that WILL cause problems. Mainly:

              execVM "briefing.sqf"

              Originally Posted by briefing.sqs
              I am guessing this was just a typo? But, make sure you do not try and call an SQS file with execVM, or use SQF syntax in an SQF file (or vice versa).


              • #8
                Re: Briefing disappears after respawn in MP Arma 2

                Problem solved on BI Forum, here is the answer:

                Originally posted by NeoArmageddon

                You need a eventhandler "killed" for every player. Write this in the Init.sqf:

                _KilledHandler = player addEventHandler ["killed", {_this execVM "playerkilled.sqf"}];

                Now create a "playerkilled.sqf" in your missionfolder and write this to it:

                waituntil {(alive player)};
                execVM "briefing.sqf";

                If the player get killed, the scriptis started... but in the first line it paused until the player respawns (is alive again)... than the scriptexecs the briefing.sqf again.
                Don't forget to make Gamelogic in editor and name it - killed.

                PS: Shock and Awe V2 coming soon.




                TeamSpeak 3 Server


                Twitter Feed