Jump to content
Sign in to follow this  
BL1P

sound works locally but not on dedicated ?

Recommended Posts

Hello.

I am trying to get a suicide bomber script to run in a mission I am editing

What happens is a bomber sees a target and yells something at them then charges them then expldoes

On my local machine it all works fine

On my dedicated the shout isnt herd but the rest of the script is good and i get no errors in the server.rpt as far as I can tell

This is the code im using

In the description

class CfgSounds {
#include "mps\dialog\mps_sounds.sqf"

class allahu
{
	name = "allahu";
	sound[] = {\sound\allahu.ogg, db + 0, 1.0};
	titles[] = {0, ""};
};

In the script for the bomber 2 lines :-

_shout = if (count _this > 5) then {_this select 5} else {false}

if (_shout) then {_unit say [_sound,5]};

Like I said it works fine localy but does not work on my dedicated

Any help would be fantastic

Thanks

BL1P

Share this post


Link to post
Share on other sites

rSAY only works in conjunction with the RE function. You would need to do something like this:

if (_shout) then {[_unit,rSAY,"allahu"] call RE}

Alternatively, you could just use CBA's global execute function if you have CBA. Finally, there's always the tired-and-true public variable option. How are you executing the script, by the way? This locality issue could be avoided altogether by executing the script globally.

Share this post


Link to post
Share on other sites

erm

I place a trigger on the map with civi inside the trigger radius

then i add this in the trigger

nul = [thislist select floor(random count thislist), WEST, 7, 50] execVM "hkRandom.sqf";

Im crap at scripting and dont yet understand the global and local stuff

but im about to test the code you gave me

BRB

---------- Post added at 05:23 PM ---------- Previous post was at 05:16 PM ----------

:( didnt work

if (_shout) then {[_unit,rSAY,"allahu"] call RE};

no errors in the rpt either

well none to do with that part :)

---------- Post added at 05:25 PM ---------- Previous post was at 05:23 PM ----------

Alternatively, you could just use CBA's global execute function if you have CBA. Finally, there's always the tired-and-true public variable option. How are you executing the script, by the way? This locality issue could be avoided altogether by executing the script globally.

the mission is using CBA but i have no idea what CBA is doing or how to use CBA nor do I understand how to exec a script globally rather than locally

Share this post


Link to post
Share on other sites

Well, if it's being fired from a general trigger like that, the script should be executing globally, which leads me to believe that you have a condition somewhere in your script (e.g., isServer) that is preventing the "say" line in particular from being run globally. No matter, CBA can circumvent the issue for you:

[[_unit],"allahu"] call CBA_fnc_globalSay

I am 99% sure that will work anyway, but if you're interested in learning about locality so you can solve these problems yourself in the future, feel free to post your whole script here so we can take a look at why the "say" was local in this case.

Share this post


Link to post
Share on other sites
Well, if it's being fired from a general trigger like that, the script should be executing globally, which leads me to believe that you have a condition somewhere in your script (e.g., isServer) that is preventing the "say" line in particular from being run globally. No matter, CBA can circumvent the issue for you:

[[_unit],"allahu"] call CBA_fnc_globalSay

I am 99% sure that will work anyway, but if you're interested in learning about locality so you can solve these problems yourself in the future, feel free to post your whole script here so we can take a look at why the "say" was local in this case.

As the script and the mission im editing are not mine. I dont feel it would be apropriate of me to post them.

but here are the links :)

I am using this script package for the bomber

http://205.196.123.7/mnzvaxren9mg/cmlcvvfcovir22l/MarketDay.Zargabad.7z

and im editing\altering patrol ops 2 by [ocb]

http://forums.bistudio.com/showthread.php?t=126904

as its all for a private server for mainly me and a couple of m8s im hoping its all ok

you where correct the scrip contains this line

if (isServer) then

Edited by BL1P

Share this post


Link to post
Share on other sites

As I expected, the "say" line is within an "isServer" conditional statement. This is why it wasn't playing on your dedicated server: "Say" is a local command, and it is only being run on the server; therefore, only the server can play the sound (and because it's a dedicated server, no one would hear it). If the "say" line were to be taken out of the "isServer" conditional, it would play for everyone. Your best bet is to use the CBA function mentioned above.

Share this post


Link to post
Share on other sites
As I expected, the "say" line is within an "isServer" conditional statement. This is why it wasn't playing on your dedicated server: "Say" is a local command, and it is only being run on the server; therefore, only the server can play the sound (and because it's a dedicated server, no one would hear it). If the "say" line were to be taken out of the "isServer" conditional, it would play for everyone. Your best bet is to use the CBA function mentioned above.

the cba line did not work

:(

thanks for he help btw

how do i go about making the script not use that isserver bit ?

Share this post


Link to post
Share on other sites

I'm really surprised that the CBA line didn't work. Are you sure you're running CBA? In any case, I wouldn't bother trying to mess with the structure of that script. Try this:

if (_shout) then {_unit setVehicleInit "this say ""allahu""";processInitCommands};

It's not the most elegant solution, but it will work.

Share this post


Link to post
Share on other sites
I'm really surprised that the CBA line didn't work. Are you sure you're running CBA? In any case, I wouldn't bother trying to mess with the structure of that script. Try this:

if (_shout) then {_unit setVehicleInit "this say ""allahu""";processInitCommands};

It's not the most elegant solution, but it will work.

It may not be elegant but it worked :):):)

thank you very much for all your help !!!!!!!!!

Share this post


Link to post
Share on other sites
It may not be elegant but it worked :):):)

thank you very much for all your help !!!!!!!!!

An elegant way would be using the multiplayer framework.

You'll need to add the functions module to your mission.

[nil, nil, rSay, _unit, "allahu"] call RE;

Works. If you're still having trouble using RE upload the mission files somewhere. You really want to use it, solves a lot of headaches

Edited by PlacidBox

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  

×