-=PIKMOF=-XceL
Legacy Member
Blanco, ik wil met een random tussenpauze tussen 3 en 10 seconden in een script een random unit een random phrase laten zeggen. Ik heb dit al gevonden, maar hoe lees ik een willekeurig element uit een array, en hoe bepaal ik wie nog in leven is? (dode units laten spreken is wat stom)
---
----
;?alive player : goto znova
#znova
~5
hint "script initiated!"
_rnd = random 12.5
? _rnd > 10 : goto "t5"
? _rnd > 7.5 : goto "t4"
? _rnd > 5 : goto "t3"
? _rnd > 2.5 : goto "t2"
? _rnd > 0 : goto "t1"
;pick a unit that is still alive and let him say a random phrase
;"_x in thislist" count [truck1,truck2... ] == "alive _x" count [ ;truck1,truck2... ]
_example = [unit1, unit2, unit3, unit4, unit5, unit6, unit7, unit8, unit9, unit10]
_rnd2 = random 10
_speaker = _example select _rnd2
#t1
_speaker say "BA_Ger_A_05_FallBack"
goto "znova"
#t2
_speaker say "ES_Ger_B_008_alt2_EnemySighted"
goto "znova"
#t3
_speaker say "BA_Ger_A_1alt_DieAmerikanerES_Ger_B_006_alt_ItsThem"
goto "znova"
#t4
_speaker say "MeleeCharg_Ger_Stirb_B_001"
goto "znova"
#t5
_speaker say "UNS_Ger_B_002alt2_TakeCover"
goto "znova"
---
----
;?alive player : goto znova
#znova
~5
hint "script initiated!"
_rnd = random 12.5
? _rnd > 10 : goto "t5"
? _rnd > 7.5 : goto "t4"
? _rnd > 5 : goto "t3"
? _rnd > 2.5 : goto "t2"
? _rnd > 0 : goto "t1"
;pick a unit that is still alive and let him say a random phrase
;"_x in thislist" count [truck1,truck2... ] == "alive _x" count [ ;truck1,truck2... ]
_example = [unit1, unit2, unit3, unit4, unit5, unit6, unit7, unit8, unit9, unit10]
_rnd2 = random 10
_speaker = _example select _rnd2
#t1
_speaker say "BA_Ger_A_05_FallBack"
goto "znova"
#t2
_speaker say "ES_Ger_B_008_alt2_EnemySighted"
goto "znova"
#t3
_speaker say "BA_Ger_A_1alt_DieAmerikanerES_Ger_B_006_alt_ItsThem"
goto "znova"
#t4
_speaker say "MeleeCharg_Ger_Stirb_B_001"
goto "znova"
#t5
_speaker say "UNS_Ger_B_002alt2_TakeCover"
goto "znova"