Results 1 to 9 of 9

Thread: How to utilize the "say"-command in multiplayer

  1. #1

    How to utilize the "say"-command in multiplayer

    In this thread by Geosword, Demonized responded with this
    Quote Originally Posted by Demonized View Post
    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.
    Code:
    {
    	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:
    Code:
    if (isServer) then {  null = [man1, lead] execVM "speech.sqf";  };
    With the preset condition "Radio Alpha".

    The script itself looks like this:

    Code:
    _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:
    Code:
    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.
    Spoiler:

  2. #2
    Warrant Officer Demonized's Avatar
    Join Date
    Nov 16 2010
    Location
    Back from afk 2013
    Posts
    2,614
    use the remote execVM to easily work around locality if you cannot use the appropriate triggers:
    Code:
    if (isServer) then {[nil,nil,"per",rEXECVM,"speech.sqf",man1, lead] 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.
    Code:
    if (isServer) then {[nil,nil,"per",rEXECVM,"speech.sqf",[man1, lead]] call RE};
    My scripts:
    Spoiler:

    what to do when posting any kind of code dammit!!

    Any new mission editor or scripter in Arma2 should have read Mr Murrays Editing Guide Deluxe at least once, it still applies for A2 even though it was made for Armed Assault.

  3. #3
    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"?

  4. #4
    Warrant Officer Demonized's Avatar
    Join Date
    Nov 16 2010
    Location
    Back from afk 2013
    Posts
    2,614
    Quote Originally Posted by aLmAnZo View Post
    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.

  5. #5
    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:
    Code:
    _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.

  6. #6
    Warrant Officer Demonized's Avatar
    Join Date
    Nov 16 2010
    Location
    Back from afk 2013
    Posts
    2,614
    maybe try this instead since you already use CBA:
    https://dev-heaven.net/docs/cba/file...Say3d-sqf.html

    for MP framework you just need the functions module placed in your mission.

  7. #7
    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?

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

    Code:
     class soundName
    	{
    		name = "soundName";
    		sound[] = {"Sound\soundName.ogg", db-15, 1};
    		titles[] = {};
    		
    	};
    hackers come in my server, make people dance

    Click to see my Rig!
    Spoiler:

  9. #9
    Quote Originally Posted by 2nd Ranger View Post
    Adjusting the volume to about -15 in the description file usually works for me. Depends on the original volume though, obviously.

    Code:
     class soundName
    	{
    		name = "soundName";
    		sound[] = {"Sound\soundName.ogg", db-15, 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:
    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.
    Last edited by aLmAnZo; Feb 13 2012 at 18:01.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •