Jump to content
Sign in to follow this  
lightspeed_aust

Dedicated Server - text broadcast to all?

Recommended Posts

I am trying to finish a mission for coop to run on dedi - everything works as intended except the display of text to all players when an objective is complete.

For example, player who locates intel has text displayed to himself only not the rest of the players.

Likewise, for the trigger to close out the game - is supposed to display text to all players "Good work Ghosts, hold position for extraction" and then 10 seconds later set off another trigger which ends game 'End 1'.

What happens is one player can view the text and the game is not ending. Strange I know...

Am I supposed to group the trigger on the whole player team even though they have no effect on the trigger activation?

Is their a something that I am missing so that all players see the text in a dedi and also all are effected by a trigger activation such as endgame?

thanx in advance

Lighty

Share this post


Link to post
Share on other sites

there are alot of topics about trigers (have you checked Mr-Murray's Editing-Guide its a real help). Althoug im not sure about ending the mission. The folowing could help

tskObj1 setTaskState "SUCCEEDED"; // Ob1 has been completed

[tskObj1] call mk_fTaskHint; // tell the player

sleep 7; // wait before giving the player a new task

player setCurrentTask tskObj2; // assign obj2 to the player

[tskObj2] call mk_fTaskHint; // show the player that he received a new task

Share this post


Link to post
Share on other sites

Triggers are local to each machine. All text display commands are local as well.

The secret to MP editing is command called publicVariable. It's used to sync stuff between server and clients.

Here is a generic example of a double trigger approach to make sure something gets triggered/ran on everyone:

Trigger 1

Condition: !alive dude

onAct: obj1 = true; publicvariable "obj1"

Trigger 2

Condition: obj1

onAct: task1 settaskstate "succeeded"

The basic idea is to have a trigger with the condition to suit whatever you are trying to wait for. Once that trigger is fired on any machines, it will set a variable as true and tell everyone else.

Trigger 2 is used to catch the true variable sent from someone. In it's onAct you run the code that should be ran for everyone. It can be anything, set taskstate, display text, end mission.

Another example, for the intel search. This covers only case where you put an area trigger over the intel and wait for a player to just come close enough.

Trigger 1

Condition: this (set trigger side/area etc normally)

onAct: intelFound = true; publicvariable "intelFound"

Trigger 2

Condition: intelFound

onAct: taskIntel settaskstate "succeeded"; hint "Intel was found, yay!";

If you have a version of the intel pickup that uses an action. You can skip the first trigger and use only the 2nd. In the script that runs from the action, you just place: intelFound = true; publicvariable "intelFound"

Share this post


Link to post
Share on other sites

shk - i have seen some of your helpful posts in other threads and was going to PM you if i dint find the answer i was looking for - looks like you came to me anyway lol.

thanx a lot,

Lighty.

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  

×