Jump to content
Sign in to follow this  
A-SUICIDAL

Forcing sideChat msgs to be seen by all

Recommended Posts

I want all players to see scripted sideChat messages. For instance, I have a trigger with the condition "ralleyDeployed". When the Leader deploys a Ralley Point it sets the condition to true and the trigger then does this:

if (isServer) then {
hint composeText [parsetext format["<t size='1.2' align='center' color='#FFA500'>Rally Point Deployed%1</t>"]];
s1 sideChat "Rally Point deployed and marked on map.";
sleep 8;
hint "";
};
exit

I can see the hint and the sideChat message, but other players tell me that they only see the hint. There are other players that can deploy things like... an ammo crate or a MASH tent etc and those triggered sideChat messages are not being seen by all either. Do I even need to have "if (isServer) then {" in this script? What am I doing wrong and how can I get this work correctly?

Share this post


Link to post
Share on other sites

cond: ralleyDeployed

On Act: null = [] execVM "msgs\msg_rally_point_deployed.sqf"; rallyDeployed = false;

Share this post


Link to post
Share on other sites

STOP mixing SQS and SQF syntaxes, stick to one in each script.

exit is old in SQS, its automatic in SQF.

for sidechat message, use MP framework, you need a functions module on map and make sure its initialized.

[[b]s1[/b],nil,rSIDECHAT,"Rally Point deployed and marked on map."] call RE;

when you use if (isServer) you only play the message on server, meaning not clients connected.

i asume you tested on a hosted server, where you also were playing? wich would explain why only you saw the sidechat.

with the above, you make sure all other clients see the sidechat.

Share this post


Link to post
Share on other sites

I never understood why I use exit at the end. I've always seen it at the end of other peoples scripts and figured I needed it. Other times I've read that the script exits on it's own and doesn't need it. It never seemed to hurt so I kind of just leave it in figuring it doesn't do anything anyway. I'll try what you mentioned. I also have a sound play for when the spotter calls a missile strike and it plays a jet sound, only the spotter can hear it. I wasn't sure how to implement that either - so all players can hear it. I'm still learning the difference between server and client and most of it is hard to understand. I was figuring that using server would force it on everybody.

---------- Post added at 02:58 AM ---------- Previous post was at 02:42 AM ----------

Studying it now. Where does this go?

Wait for global variable "BIS_MPF_InitDone" to be defined (and true):

waitUntil{!(isNil "BIS_MPF_InitDone")};

---------- Post added at 03:03 AM ---------- Previous post was at 02:58 AM ----------

I took a guess on the playSound:

[s1,nil,rSIDECHAT,"Rally Point deployed and marked on map."] call RE;

[s1,nil,rPLAYSOUND,"jet"] call RE;

It played, but sounded a little more quiet. Is the above correct?

Edited by A-SUICIDAL

Share this post


Link to post
Share on other sites

Edit: initdone is to be run before the hints so you get it all timed properly, so at the top.

for the playsound it look ok, not to much experience myself using that, but maybe you can raise the volume somehow.

the thing is that maybe, this is only my theory supported only by imagination and too much or too little sun.....

exit will cause an unregistrered error in the script, since its at the end, you may not notice it since its already done its job, but the script itself is hanged up in this error, never exiting.

multiply this a bunch of times through a long mission, and you get alot of "hanged" scripts.

and adding to overall script lag...

again, just a wild theory, but proper usage is key for anything, ive seen alot of guys lately combine both sqs and sqf in several strange ways, only pros knows how to use this sucessfully, and then its just because they are old and lazy, or just very stubborn.

sqf beats sqs every time, but sometimes you just dont need the speed of sqf and settle for sqs, like camera scripts, wich many just use sqs for even now.

Share this post


Link to post
Share on other sites

Just removed "exit" from like 70 scripts, heh.

Do I put this at the top of the script, and remove the isServer stuff? So it should look like this?

waitUntil{!(isNil "BIS_MPF_InitDone")};
hint composeText [parsetext format["<t size='1.2' align='center' color='#FFA500'>Rally Point Deployed%1</t>"]];
[s1,nil,rSIDECHAT,"Rally Point deployed and marked on map."] call RE;
[s1,nil,rPLAYSOUND,"jet"] call RE;
sleep 8;
[s1,nil,rSIDECHAT,""] call RE;

1 little typo and it always has to add: "Last edited by A-SUICIDAL". I hate that.

Edited by A-SUICIDAL

Share this post


Link to post
Share on other sites

since youre hint was already working you could just keep that if isserver part.

the purpose of MP framework is to broadcast anything from anywhere to anyone you like.

Share this post


Link to post
Share on other sites

On Act:

null = [] execVM "msgs\msg_rally_point_deployed.sqf"; rallyDeployed = false;

msg_rally_point_deployed.sqf:

waitUntil{!(isNil "BIS_MPF_InitDone")};
[s1,nil,rSIDECHAT,"Rally Point deployed and marked on map."] call RE;

if (isServer) then {
hint composeText [parsetext format["<t size='1.2' align='center' color='#FFA500'>Rally Point Deployed%1</t>"]];
sleep 8;
hint "";
};

The sleep 8 and empty hint is so the original hint doesn't hang on the screen for 30 seconds.

The only message that didn't appear was for the Spotter when he calls a Missile strike, then I tried rGLOBALCHAT and it worked. Apperently if he is in using Laser Marker Weapon, it won't allow the sideChat message to go through. So with rGLOBALCHAT it shows in white: BLUFOR (SUICIDAL) "Missile strike inbound!". I think I can live with it.

Edited by A-SUICIDAL

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  

×