Jump to content
Sign in to follow this  
almanzo

How to utilize the "say"-command in multiplayer

Recommended Posts

In this thread by Geosword, Demonized responded with this

you can use MP framework for that, more info on requirements in the link, you need functions module on map.

probably better to create a small local function and just send info to it via a single line, but anyhow, here is cumbersome version.

{
if (isPlayer _x AND (_x distance Hostage1) < 30) then {
	 [Hostage1,_x,"loc",rSAY,["Russian1", 100]] call RE;
};
} foreach playableUnits;

if player is within 30 meter of hostage1 he will hear the say.

not 100% sure myself on using the MP framework, i think i got the parameters right.

But I don't really get it, and have a different, though simular task I wan't to be done. Mine is much simpler, what is going to happen is that by my radio command (as the mission maker and "master"), an AI is going to give a speech, then a captive is going to be shot. The script works in singleplayer. In MP, the only difference is that the AI doesn't give the speech, the target is executed though.

The trigger I use for this is as follows:

if (isServer) then {  null = [man1, lead] execVM "speech.sqf";  };

With the preset condition "Radio Alpha".

The script itself looks like this:

_man1 = _this select 0;
_lead = _this select 1;

_man1 say ["pang",5];
sleep 49;
_lead setcaptive false;

How do I get him to talk, so that those who are close to him hear what he says?

If it's needed, this is the description.ext:

class CfgSounds
{
// List of sounds (.ogg files without the .ogg extension)
sounds[] = {pang,};
t1o_mcc_teleport_on_start = false;


// Definition for each sound
class pang
{
name = "pang"; // Name for mission editor
sound[] = {"\sound\pang.ogg", 1, 1.0};
titles[] = {};
};
respawn = "BASE";
respawndelay = 4;
disabledAI = 1;
};

As you probably can tell, I am quite new to scripting and mission making, so it takes a bit of time. But nontheless, I would be very grateful if you could help me with this.

What my comfusion with demonized response is, is that I don't understand whether or not it is possible to do without the MP framework, and wether or not I actually do need to use a Module, and even where to put the code he provided. I don't get it.

Share this post


Link to post
Share on other sites

use the remote execVM to easily work around locality if you cannot use the appropriate triggers:

if (isServer) then {[nil,nil,"per",[color="#0000FF"]rEXECVM[/color],[color="#FF0000"]"speech.sqf"[/color],[color="#00FF00"]man1, lead[/color]] call RE};

blue color = the command in this case execVM wich is fronted by a r for remote.

red color = the scriptname.

green color = the passed arguments in a array, in this case all after red is _this in the script executed. (man1, lead)

if you had placed [man1, lead] after red, you would get [[man1, lead]] in the script.

if (isServer) then {[nil,nil,"per",rEXECVM,"speech.sqf",[man1, lead]] call RE};

Share this post


Link to post
Share on other sites

Are you some kind of superhuman, Demonized?

If I recall correctly, I see your name everytime I need help. You really put down some effort in helping others, I think it is impressive. Thanks mate.

Back to the question though: Am I supposed to put that in the trigger, and at the same time be able to leave the condition to "radio alpha"?

Share this post


Link to post
Share on other sites
Are you some kind of superhuman, Demonized?

If I recall correctly, I see your name everytime I need help. You really put down some effort in helping others, I think it is impressive. Thanks mate.

Back to the question though: Am I supposed to put that in the trigger, and at the same time be able to leave the condition to "radio alpha"?

Lol, tnx for the kind words, thats the way i learned from others here on BIS forums when i first joined, and when im trying to help/fail to help others i learn even more in the process.

Yes, just place it in the radio trigger on act field, it will make ever player currently connected to the game run the script, so make sure to check for distance or something.

Share this post


Link to post
Share on other sites

You are more than welcome.

Since it took a while for the response, I had a friend help me. Then we discovered CBA scripts, so I used this:

_man1 = _this select 0;
_lead = _this select 1;

[[_man1], "pang"] call CBA_fnc_globalSay;
sleep 49;
_lead setcaptive false;

In the script file instead. Now, that worked but the distance you can hear the speech is simply monsterous. I know you can adjust distance, sound and speed with numbers, but I have no clue as to what a tile is, so Its hard to configure.

So, if I'm to choose your solution, how do I get the mp framework. I really have trouble understanding what it is. And yeah, I feel so green at this, it's not even funny.

Share this post


Link to post
Share on other sites

Well, I got your solution to work also now. Thank you.

I still have the persistent problem though. No matter whether I use say or say3d, the speech can be heard from over 1 kilometer away, even though It actually gets lower the further away you are. Man, this officer has lungs of steel :P

I've tried to adjust the figures to, but to no effect it seems. The guys working with ACRE should be familiar with this I guess, maybe I can PM one of them? Do you know who they are?

Share this post


Link to post
Share on other sites

Adjusting the volume to about -15 in the description file usually works for me. Depends on the original volume though, obviously.

 class soundName
{
	name = "soundName";
	sound[] = {"Sound\soundName.ogg", [b][color="#A52A2A"]db-15[/color][/b], 1};
	titles[] = {};

};

Share this post


Link to post
Share on other sites
Adjusting the volume to about -15 in the description file usually works for me. Depends on the original volume though, obviously.

 class soundName
{
	name = "soundName";
	sound[] = {"Sound\soundName.ogg", [b][color="#A52A2A"]db-15[/color][/b], 1};
	titles[] = {};

};

I basicly did allmost the same as you, I guess you where about maybe 2 minutes late with that post of yours, I did figure it out by myself, though I used a slightly different method. Here is my code:

name = "pang"; // Name for mission editor
sound[] = {"\sound\pang.ogg", 0.06, 1.0};

So, I had to set the volume down to 0.06. But that helped at least. Anyways, thanks for your help.

Btw Demonized: I ended up using the MP framework as you suggested. Now everything works like a charm. Thank you so much, both of you. Can't wait to play the mission with my group.

Edited by aLmAnZo

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  

×