hello
i have created a set of scripts which enable a unit to hurl abuse towards the enemy, when firing, throwing grenades and when aware.
The following is the script detailing when the unit is aware, and what speeech lists he should use in differing situations:
_b = _this select 0
_d = group _b
BenSpeakAware = true
#1
~ 1
?behaviour ben == "combat" && (BenSpeakAware): goto "speak"
~2
Goto "1"
#speak
?ben ammo "Wbt_Tommy" < 5: goto "AmmoLow"
?!someAmmo ben : goto "AmmoLow"
_voices = ["Ben_JamesNoseyStarbord","ben_rear","Ben_Da","Ben_ShaunShootingWrongWay","ben_Scream", "ben_Scream2","Ben_MyGodTwats","Ben_UglyBastards","Ben_Ambush","Ben_OhShit", "Ben_TcBadPlanning","Ben_Shit","Ben_FuckRightOff","Ben_Shit2"]
_r = random 14
_re = _r mod 1
_r = _r -_re
_v = _voices select _r
ben say _v
BenSpeakAware = false
~ random 10
BenSpeakAware = true
goto "1"
#AmmoLow
hint "ammo Low"
_voicesAmmo = ["Ben_NewMagTC","Ben_PassMeTheClip","Ben_Blanks"]
_rAmmo = random 3
_reAmmo = _rAmmo mod 1
_rAmmo = _rAmmo -_reAmmo
_vAmmo = _voicesAmmo select _rAmmo
ben say _vAmmo
BenSpeakAware = false
~ random 20
BenSpeakAware = true
goto "1"
this works well, untill we reach the bit regarding whether the unit is reloading: "?ben ammo "Wbt_Tommy" < 1: goto "AmmoLow""
he does speak when he has less than one shot in his magazine for the weapon "wbt_tommy", when he would be reloading, but i was wondering if there is any way of putting in a generic weapon doo dah in the place of "wbt_tommy" so he would say it with each weapon he fires without having to make a huge script detailing each weapon in my campaign individually.
Also the line "?!someAmmo ben : goto "AmmoLow"" doesnt work at all. I was thinking this would detect the unit has no ammo left at all, but it doesnt want to work... How would i get this to workl, or better, detect when the unit has only 1 magazine left for his weapon?
And fina;;y, is it possible to detect the unit has no weapon at all? Otherwise he's going to be banging on about being low on ammo when he doesnt even have a weapon!
As always, any help appreciated
Regards