Being relatively new in scripting, I was wondering if anybody could help me figure out how to make functions use random values. I currently have a basic system that relies on event-handler. This is what I currently have in a separate script (talkerWest02).
(
//Ambient speech system
//cheers
this addEventHandler ["FiredNear",{say3D "vo_soldier_west_02_cheer01"}];
//panic
this addEventHandler ["Explosion",{say3D "vo_soldier_west_02_panic_explode_01"}];
//Death yells and moans
this addEventHandler ["Killed",{say3D "placeholder"}];
)
(the description.ext is already hard to read for one full speech tree, and im planning on adding another 7 or 8 (4 for each faction))
This is unfinished script that i have for one soldier. I'm thinking each soldier should have its own speech script that can be executed on initialization. However, I don't know how to randomize the chances of each different line occurring, make sure that when one gets picked no others are allowed to execute for a certain time (around 10 secs, to make sure there's not too much talking), how to mute/replace the current speech (soldiers now say when they are moving, must have been added in a recent patch), and how bad of a impact on performance this might have.