icebreakr 3159 Posted January 4, 2011 I would like to make AI units to make random shouts via .ogg,.wss files packed within unit pbo. That would simulate a badly trained rebel unit. The only conditions would be: - they would not shout too often (~1 sentence per minute per unit) - sentences would be picked randomly from shout1-shout10 files - they would only shout when in AWARE or COMBAT mode Any help appreciated. Share this post Link to post Share on other sites
Big Dawg KS 6 Posted January 4, 2011 (edited) Define all your sound files, then put them into an array. Then it's a simple matter of randomly selecting one: Ex: _phrases = [huge array of sounds]; while{alive _unit}do{ if(behaviour _unit in ["COMBAT","AWARE"])then{ _unit say (_phrases select (floor random count _phrases)); }; sleep (45 + random 30); }; Of course if you're going to have a lot of units running this, maybe you could find a more efficient way of doing it with only one script thread. Edit: Personally though I think it'd be cool if you could modify the AI FSM to include the shouts there and make them situational. Like shouting something when the enemy is spotted. Though I've no idea if that's possible, I haven't yet ventured into AI FSMs... Edited January 4, 2011 by Big Dawg KS Share this post Link to post Share on other sites
icebreakr 3159 Posted May 5, 2011 Thanks Big Dawg KS. I have all sounds for African and French language for different things (when badly hit, when in combat state, etc.). I define them with CfgSounds, but how do I made a config so they get used? FSM is not an option, don't have that much time for that :) Share this post Link to post Share on other sites
-)rStrangelove 0 Posted May 5, 2011 (edited) You add an event handler into the config of the units, i guess the init-handler is what you're after: http://community.bistudio.com/wiki/ArmA_2:_Event_Handlers#Init BigDawg is right, a sound script for every active unit might create performance issues. Personally i'd stop all scripts for units which are not leaders in their groups, so you'd have 1 active sound script for each group. Dunno if an init-handler fires if a unit is spawned though. I could help with testing, im getting back to scripting atm. [edit] Also, those ppl playing with the DSAI mod installed will want to switch your script off, so the script needs to check if a DSAI global var is defined. Edited May 5, 2011 by ])rStrangelove Share this post Link to post Share on other sites
sickboy 13 Posted May 5, 2011 There's WolfRug's DSAI, GL4 DSAI, ACE AI Talk etc, perhaps a port or extension could be an idea? Also you will probably will want to be looking at Extended_Eventhandlers variants of Init etc handlers. Share this post Link to post Share on other sites
icebreakr 3159 Posted May 5, 2011 (edited) Crap, I'll postpone the release to figure out what to do with DSAI users :/ I have African (Civilians, Afrenian Army) and French (Molatians) sounds ready. Is there a way to disable the voices if character is non-AI? Edited May 5, 2011 by IceBreakr Share this post Link to post Share on other sites
-)rStrangelove 0 Posted May 5, 2011 Postpone release of the troops? :( How about release them now as they are and update them later / or as 2 seperate editions (with and without shouts)? Share this post Link to post Share on other sites
gammadust 12 Posted May 7, 2011 (edited) Crap, I'll postpone the release to figure out what to do with DSAI users :/I have African (Civilians, Afrenian Army) and French (Molatians) sounds ready. Is there a way to disable the voices if character is non-AI? Yes there is! I just made an addon (in the process of being published) that follows the original idea of Suchy_ (Mute Player's Voice), you have to change the RadioProtocol, or make a new one that the unit will use that silences it. Specifically you would need an empty RadioProtocol (no sentences defined). (PM me if you need to take a look at the code in order to hasten your release) In regards to the best way to have them randomly shouting I agree with Big Dawg KS. And yes danger.fsm allows you to do that. I have it on a working mod. You could deal with script load there also if you worried with performance. But mostly you wouldn't be doing too much calculations, only voice triggers which souldn't have that much impact. Edited May 7, 2011 by gammadust Share this post Link to post Share on other sites