- Joined
- Jul 14, 2011
- Messages
- 3,213
Hi!
I'm making a game that uses Dialogs with sounds, but I want some of them to be random, like this:
String[1] = Hi!
Sound[1] = Hi!
String[2] = Hello!
Sound[2] = Hello!
I want to set all the Strings and Sound in one trigger, and make them be 'called' as random, but same random for both, string and sound....
So far I do this:
Setting 'I = Random Integer between 1 and MaxStringAndSounds'
I'm making a game that uses Dialogs with sounds, but I want some of them to be random, like this:
String[1] = Hi!
Sound[1] = Hi!
String[2] = Hello!
Sound[2] = Hello!
JASS:
// I use
call AddLineToDialog(udg_String[2])
call AddSoundToDialog(udg_Sound[2])
// The sound is played at the same time that the line is displayed
I want to set all the Strings and Sound in one trigger, and make them be 'called' as random, but same random for both, string and sound....
So far I do this:
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Random integer number between 1 and 2) Equal to 1
-
Then - Actions
- Custom script: call AddLineToDialog( "Hello")
- Custom script: call AddSoundToDialog(gg_snd_Hello)
-
Else - Actions
- Custom script: call AddLineToDialog( "Hello there")
- Custom script: call AddSoundToDialog(gg_snd_HelloThere)
-
If - Conditions
Setting 'I = Random Integer between 1 and MaxStringAndSounds'
- Custom script: call AddLineToDialog(udg_String[I])
- Custom script: call AddSoundToDialog(udg_Sound[I]")