Jump to content
Sign in to follow this  
alleycat

Hints and MP

Recommended Posts

1. If I fire a hint from a trigger or script, will this be broadcast among all players?

2. How to send hints to only one player? Is that considered "local"?

Share this post


Link to post
Share on other sites

It depends on the triggers condition. For the script it depends on where you run it. If you only run it on the server then the hint will appear on the server only. If it is a dedicated then that is pointless.

Say your trigger has this

condition: !alive scud_launcher.

And you on act is a

hint "The scud is destroyed!".

That will only work if every knows what the scud_launcher is. If it is placed in the editor then it will work. If it is spawned in a if (isServer) then { spawn scud here } then no since the other peoples machines do not know what scud_launcher is. Only the server does. If you want the server to tell the others then publicVariable it after creation:

publicVariable "scud_launcher";

Your question number 2. There is probably a couple of way to do this it depends on when the hint is to be sent. When a trigger activates?

Share this post


Link to post
Share on other sites

?? Wouldn't !alive scud_launcher override the "knows about" knowledge value? In an eariler example I'd orginally had something that said for each group member, do something. But the problem I ran into was dead members that the group didn't know was dead yet. By using alive _x for each group member it got around that limitation.

Share this post


Link to post
Share on other sites

Not sure where you are going with this. The alive check doesn't care whether the player or his group knows the scud is destroyed. I assume the server tells the other clients/players when the scud is destroyed. Else desync would occur. However the trigger won't work unless "the arma running on the clients" know that scud_launcher represents the scud launcher.

I do know that it can take some time before the ai discovers there team mates is dead:

(A get's shots)

Some timer later...

A what is your position

....

Oh no A is down!!

However, I don't see how this is relevant to this?

Edited by Muzzleflash

Share this post


Link to post
Share on other sites

I want to run a script on INIT that basically displays some hints to players, depending on their side

In init.sqf:

playableunits execVM "overview.sqf";

overview.sqf

_caller = _this select 0;

If (isPlayer _caller && side _caller == WEST) then {

sleep 1;

hintsilent parseText format["<t color='#FFFFFF'>Move to the flagpole to initiate the HALO drop.</t>];

}

However the script does not appear to have any effect. Also there are no script errors.

Share this post


Link to post
Share on other sites

First of all playableUnits is an empty array in single player. So testing using playableUnits won't work in the editor. There are a couple of script errors in there. Are you running with -showScriptErrors on? For example you forgot to close the move-to-flag-pole-text.

Second your algorithm doesn't not make quite sense. You pass the list with all the playableUnits. Then you select the first unit in the list. Only one can be the first element in playableUnits and the hint would only occur there, assuming it is a player and blufor.

Instead use the player variable, it will make things much easier:

[] execVM "overview.sqf";

overview.sqf

//No reason to run this on a dedicated server
if (isDedicated) exitWith {};

//Wait until we have been given control of a player
waitUntil {!isNull player};

//Now show approriate text
if (side player == west) then {
   sleep 1;
   hintsilent parseText "<t color='#FFFFFF'>Move to the flagpole to initiate the HALO drop.</t>";
};

Share this post


Link to post
Share on other sites

That was very enlightening, thx.

Btw, it did test it on editor and hosted MP with -showscripterrors and there was no error displayed. I guess my script basically produced pure emptiness.

Edited by alleycat

Share this post


Link to post
Share on other sites

This script does appear to display for connected players on a dedicated server. I however was logged in as admin and could see that hint. Why is this happening?

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  

×