Hi to all!
I'm trin' to make an EH compatible addon wich reproduce rustling sound when the player bot is into (or very near) bushes.
I'm really noob about scripting but I've played around some scripts makin' more than a collage (all the credits goes to the original authors)...so this is it:
_Soldier = _this select 0
? ! (_Soldier == player) : exit
_soundRustle = "Logic" createVehicle (position player)
_soundRustleradius = 0
_soundRustlelist = ["amb_foliage1","amb_foliage2","amb_foliage3","amb_foliage4","amb_foliage5"]
;nearestObjects ["DD_bush01","DD_bush02","Krovi2","Krovi4","Krovi","Krovi_bigest","Krovi_long"]
_nObject = ["DD_bush01","DD_bush02","Krovi2","Krovi4","Krovi","Krovi_bigest","Krovi_long"]
#loop
~1
~ random 5
? ! (alive player) : goto "loop"
_pos = getpos player
_nObject = nearestObject player
_soundRustleselected = (_soundRustlelist select floor(random(count _soundRustlelist)))
? _soundRustleselected == "amb_foliage1" : goto "amb_foliage1"
? _soundRustleselected == "amb_foliage2" : goto "amb_foliage2"
? _soundRustleselected == "amb_foliage3" : goto "amb_foliage3"
? _soundRustleselected == "amb_foliage4" : goto "amb_foliage4"
? _soundRustleselected == "amb_foliage5" : goto "amb_foliage5"
#amb_foliage1
_nObject = nearestObject player
_soundRustle setpos (getpos _nObject)
_soundRustle say ["amb_foliage1", 0]
goto "loop"
............etc.
The problem is that this script (activated via EHinit) play the rantling sounds everywhere is the player bot independently by the bushes and the distance from them.
Any idea how can I obtain the effect I'm lookin' for?
Thanks in advance and Greetings.