Forum Jump :

Author Message


Posts: 8
Rank:


Level: Member

Country: de
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2019-04-16 12:20        
     
Hey,

I modified a playlist script to simulate AI speech when the player is detected in some way.

It works fine, but I got one problem which sometimes breaks immersion.

The script gets executed multiple times for a single group, which is ok in big groups, I guess.
But if there is only one or two guys in a group (I got lots of small pats), it sounds strange.

Especially if there is only one guy left in a squad and he speaks in multiple voices.
I googled alot for this, but I can't really find a solution.

So I'm looking for something like: 'If script is already running for group X, then don't run it again!' And all the origin scripts needs to recognize it.


It gets executed by various other scripts:

- If the AI finds a body:
_shout1 = [leader (group finder), _killer] execVM "scripts\ShoutSound.sqf";

- If the AI detects nearby bullets (bdetect):
_shout2 = [leader (group _unit_1), player] execVM "scripts\ShoutSound.sqf";

- if the AI fires a flare:
_shout3 = [leader (group _unit), player] execVM "scripts\ShoutSound.sqf";

(if anyone wants to see the whole scripts I can put them here too, if that matters in any way.)

I did this a while ago, I think I named them 1, 2 and 3 to tackle this problem, but couldn't find a way to put it to use.

Here is the shouting script:

(to clarify the sound files, s1-s5 is one voice, s9-s13 is a different one, the other ones are extra voices and radio sounds.)



Help is much appreciated!

Cheers.

Edit: setVariable/getVariable did the trick.

This post was edited by clockx (2019-04-22 16:14, 281 days ago)