how can i play a random sound with the new sound system? with the old one i could do something like:
PlaySound(Random(99));
is there something similar?
What you can do is this:
AudioClip* explosions[3];
// in game_start or similar
explosions[0] = aSmallExplosion;
explosions[1] = aBigExplosion;
explosions[2] = aHugeExplosion;
// play random explosion
explosions(Random(2)).Play();
i see. so you definitely have to construct something by yourself otherwise you can only adress sounds by their names, is this correct? and thanks for the reply!
Yes, I'm not aware of an AudioClip array similar to for instance character[].
This was already discussed some time ago, and it was concluded that the new audio system is made inconvenient for this kind of tasks.
Other than constructing your own array, as Khris suggested, I may point to an option in General Settings - "Enforce new style audio scripting". If you toggle it OFF, you may then use old-style play commands.
I haven't tried this out myself, but I think you may check "Cache File Name" property of audio clip to know its numeric ID.