Jump to content
Sign in to follow this  
Mikee

Briefing disappears after respawn in MP

Recommended Posts

After playing my Coop mission, briefing disappears after respawn and if someone join to the game in progress. I searched other topics already, but didn't find answer that would satisfact me.

Can someone please explain to me, how to change this briefing, so it doesnt disappears?

execVM "briefing.sqf"

//////////////////////////////////////////////////////////////////

// Function file for Armed Assault

// Created by: TODO: Author Name

//////////////////////////////////////////////////////////////////

if (!isServer) exitWith {};

// create a simple note in the briefing

player createDiaryRecord["Diary", ["Credits", "Mission made by Mike (Mikee) for Tactical Gamer.com. Any questions or suggestions, send me PM to profile (Mikee) on TG Forum or post comments in thread about the mission. Have Fun!"]];

player createDiaryRecord["Diary", ["Enemy Forces", "Chernarus infantry working with Special Police Forces. Probably KA-50 helicopters and unknown amount of T72's and BMP's."]];

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='crew'>prison</marker>, in which our crew is being hold. Finally, we will procede to the airport and return on the board of the <marker name='c130'>C-130</marker> to <marker name='rterritory'>Russian Territory</marker>. <br><br> Good Luck Marines!]];

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

// create a task

tskExample4 = player createSimpleTask["Airbase"]; // adds a task w/o desc or marker

tskExample4 setSimpleTaskDescription["Attack enemy <marker name=airfield'>airbase</marker> and evacuate on the board of <marker name='c130'>C-130</marker> to <marker name='rterritory'>friendly territory</marker>. You can use <marker name='thisairfield'>this</marker> airfield to land the plane after you enter friendly airspace. <br/><br/>", "Airbase", "Airbase];

tskExample4 setSimpleTaskDestination (getMarkerPos "c130"); // make sure you've added a marker!

// create a task

tskExample3 = player createSimpleTask["Crew"]; // adds a task w/o desc or marker

tskExample3 setSimpleTaskDescription["Free C-130's <marker name=crew'>crew</marker>. <br/><br/>", "Crew", "Crew];

tskExample3 setSimpleTaskDestination (getMarkerPos "crew"); // 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", "Anti-Air radar];

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 ZU23 located on <marker name=aa'>this</marker> hill. <br/><br/>", "Anti-Air defences", "Anti-Air defences];

tskExample1 setSimpleTaskDestination (getMarkerPos "aa"); // make sure you've added a marker!

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

{

};

};

Share this post


Link to post
Share on other sites

Its quite simple... just exec the briefing.sqf after respawn.

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.

Share this post


Link to post
Share on other sites

Hope you dont mind me hijacking this thread but I do have a similar problem.

I have made lots of objectives aka Evo style within a mission I am making. Once an objective is complete the area turns from yellow to green. Thats working good. The problem arises when other players JIP. On their maps the areas are still yellow.

How can I update the state of the map/objectives to the players that are JIP please?

Share this post


Link to post
Share on other sites

It's working, thanks a lot :)

Share this post


Link to post
Share on other sites
Hope you dont mind me hijacking this thread but I do have a similar problem.

I have made lots of objectives aka Evo style within a mission I am making. Once an objective is complete the area turns from yellow to green. Thats working good. The problem arises when other players JIP. On their maps the areas are still yellow.

How can I update the state of the map/objectives to the players that are JIP please?

Store the status of a marker/area on the server in a var... like "Zone1Color".

If a player connects, send the var via publicvariable "Zone1Color" to all clients.

The ebst way to realize this on clients is in adding http://community.bistudio.com/wiki/addPublicVariableEventHandler to the init.

Init.sqf

"Zone1Color" addPublicVariableEventHandler {"Zone1Color" setmarkercolor (_this select 1);};

With this you can change the color of a marker global:

Zone1Color=ColorRed;
publicvariable "Zone1Color";

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  

×