I,m making a one room real time rpg action game called SuRvIvAl and I plan to include allied a.i characters that assist you but i want them to say random catch phrases etc during the game, I'm currently in the process of recording 300 or so sound bites but need a script to put in the repeatedly execute system that generates a number between say 1 and 400 then plays the corresponding sound file e.g sound1 or sound2.
Random(int) (http://www.adventuregamestudio.co.uk/manual/Random.htm) and PlaySound(int) (http://www.adventuregamestudio.co.uk/manual/PlaySound.htm), e.g.
PlaySound(Random(399)+1);
Or am I missing something?
You'll probably also want to include a Timer or something, so they start at intervals rather than trying to start too many sounds at once. Or have you got that bit covered some other way? Why are you using sound files, rather than Character.Say (other than the sound files probably being quicker to script)?
(BTW, unless there's something major I'm missing, I think this is more a Beginners Tech question.)
thanks and yes i do have the timing issue somewhat covered.
Also I didnt think it was a beginners question since i was expecting a lot more elaborate code (since I've never used the random number generator)