Jump to content
Sign in to follow this  
marcon

Who killed who?

Recommended Posts

Those are sounds from mumble...mumble...mumble! You already have them so...

Keep cool dread!

Twirly.

Edited by twirly

Share this post


Link to post
Share on other sites
You still have some errors....

You forgot the underscore in _responses.... and you didn't assign anything to _response1, _response2, _response3!

_response1 = "sound10";

_response2 = "sound11";

_response3 = "sound12";

But then...hang on a second!. You don't need _response1, _response2 and _response3 at all if you just use the actual sound itself.

_target = _this select 0;
_killer = _this select 1;

[color="SeaGreen"]_responses[/color] = [[[color="Red"]"sound10"[/color],"He's down"],[[color="Red"]"sound11"[/color],"Eliminated"],[[color="Red"]"sound12"[/color],"Target down"]];

_indx = 0;

if (group _killer == foxmist1) then {
_indx = floor random 3;
playsound (_responses select _indx) select 0;
_killer sidechat (_responses select _indx) select 1;
};

EDIT: OK... I made a demo for you. Works sweet! There's another error that I missed above and that is... The Eventhandler passes an array [victim,killer] to your script.... so to get the killer and the victim you have to extract them from the passed array like this:-

[color="Red"]_array = _this select 0[/color];

_target =[color="Red"] _array[/color] select 0;
_killer = [color="Red"]_array[/color] select 1;

I knew that all along but without testing I just did not see it.

I'm wondering on how I could implement a part of that script into mine.

I have something very similar set up to that, but I just want it to sideChat the responses to it and I don't know how.

Also, there won't be any groups involved.

My version:

KillSound.sqs

waitUntil {!(isNil "bis_fnc_init")};  
_sound = ["GotHim","Contact","TangoDown","BingoBingo","ThreatNeutralized"] call bis_fnc_selectRandom;  
playSound _sound;

Trigger:

Axis A/B: 999999
Act: OPFOR (ONCE)
Present
Cond: True
On Act:
{_x addEventHandler ["killed", "(_this select 1) exec ""KillSound.sqs"""]} forEach thisList

I came up with this, it works by playing the sounds but it just doesn't do the sideChat bit.

My Attempt:

Trigger:

Axis A/B: 999999
Act: OPFOR (ONCE)
Present
Cond: True
On Act:
{_x addEventHandler ["KILLED", "(_this select 1) exec ""KillSoundTest.sqf"""]} forEach thisList

KillSoundTest.sqf

waitUntil {!(isNil "bis_fnc_init")}; 

_killer = player select 1; 
_responses = [["GotHim","Got Him!"],["Contact","Contact!"],["TangoDown","Tango Down!"],["BingoBingo","Bingo Bingo!"],["ThreatNeutralized","Threat Neutralized!"]];
_indx = floor random 3;
playsound ((_responses select _indx) select 0);
_killer sidechat ((_responses select _indx) select 1);
exit

Share this post


Link to post
Share on other sites
I'm wondering on how I could implement a part of that script into mine. I have something very similar set up to that, but I just want it to sideChat the responses to it and I don't know how.

Download the demo mission above...it's all there. It's the exact same code I'm going to give you anyway! Just replace my sound and text with your sound and text.

Also...pay attention to how the script is being called (look in the East group leaders init). You seem to be calling an .sqs script. My scripts and all newer scripts are .sqf and called with execVM.

Stick with .sqf as it is newer, more efficient and better.

Share this post


Link to post
Share on other sites
Download the demo mission above...it's all there. It's the exact same code I'm going to give you anyway! Just replace my sound and text with your sound and text.

Also...pay attention to how the script is being called (look in the East group leaders init). You seem to be calling an .sqs script. My scripts and all newer scripts are .sqf and called with execVM.

Stick with .sqf as it is newer, more efficient and better.

Aye, in my post it shows I'm using .sqf now instead of my previous .sqs.

But I'm trying to call this script with one single trigger to add all the OPFOR an event handler to have them call the script one they're killed. I don't want to put an execVM in all my OPFOR units in the mission. And all my units in my existing mission aren't in any group whatsoever. So I don't want to create a unique group for each unit in the mission because that'll be inefficient.

IE: foxmist1, foxmist1_1, foxmist1_2, foxmist1_3, foxmist1_4, foxmist1_ect..

Also, I've changed

{_x addEventHandler ["killed", "(_this select 1) [b]exec[/b] ""KillSoundTest.sqf"""]} forEach thisList

to

{_x addEventHandler ["killed", "(_this select 1) [b]execVM[/b] ""KillSoundTest.sqf"""]} forEach thisList

In the trigger On Act and ArmA doesn't really like that and doesn't even call in the script when it did before. :confused: Lol

Basically, all I'm trying to do is have this script have the ability to also do a sideChat feature as to the one you posted:

http://www.semedar.com/arma-scripts/killsound

Share this post


Link to post
Share on other sites

Try this instead mate.....

{_x addEventHandler ["killed", "([color="Red"]_this[/color]) execVM ""KillSoundTest.sqf"""]} forEach thisList;

EDIT: Actually I"m not sure that will work...but it's 3:30 am.... I'll catch ya tomorrow!

Share this post


Link to post
Share on other sites
Try this instead mate.....

{_x addEventHandler ["killed", "([color="Red"]_this[/color]) execVM ""KillSoundTest.sqf"""]} forEach thisList;

EDIT: Actually I"m not sure that will work...but it's 3:30 am.... I'll catch ya tomorrow!

That worked to execute an .sqf but still can't figure out how to do the sideChat feature. =\ I got it to play a random sound but not the sideChat bit. :386:

KillSound_Test.utes

Edited by Semedar

Share this post


Link to post
Share on other sites

How would I add a sideChat feature to it so every time I kill someone, it plays a random sound AND the person who killed the enemy would say something like: "Tango Down" along with a sound file I have that says exactly that. I thought it would be simple to just put something like this:

waitUntil {!(isNil "bis_fnc_init")};
_responses = [["GotHim","Got Him!"],["Contact","Contact!"],["TangoDown","Tango Down!"],["BingoBingo","Bingo Bingo!"],["ThreatNeutralized","Threat Neutralized!"]];
_indx = floor random 3;
playsound ((_responses select _indx) select 0);
player sidechat ((_responses select _indx) select 1);

But everyone says the response (assuming they're an actual player). And if an AI kills an enemy, it will make me say the response. I just want the killer to say the response.

tl:dr: How would I be able to make the killer say the response but everyone else be able to hear the sound file?

Share this post


Link to post
Share on other sites
.....How would I be able to make the killer say the response but everyone else be able to hear the sound file?

That would be in the realm of Multiplayer... don't know too much about that. Try looking into this stuff... publicVariable and it's friends.

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  

×