Script Questions

a few errors in there i think

i put the code online so we had line numbers
https://gist.github.com/anonymous/e03b125ae26d67f12c7f

line 7 at the end ... foreach _x
you have removed the array of nearestobjects that contains the list of players. thats what is supposed to loop foreach.

line 8 ... first parmeter of targetsquery is supposed to be an object but you are passing it an array of objects.
if you want to use targetquery, use it lastly to check if they see the player before attacking. since dogs can track by scent i would say they always see player and this is unneeded.

line 9 .. che king is alive _prey ... thats an array, you meant _x

battery dead ... later
 
That was getting a bit out of hand... I found this code snippit on this forum under "Seaweed's No Third Person Whoring".

It works great so far for my "PlayingDead" portion of the WildDogs search for prey...

Code:
//PLAYER "PLAYINGDEAD" CHECK
_targetPreyState =  animationState _TargetPrey;
_state = (getText (configFile >> "CfgMovesMaleSdr" >> "States" >> _targetPreyState >> "actions"));
_PlayingDead = ["RifleProneActions","PistolProneActions","CivilProneActions"];
if !(_state in _PlayingDead) then {

//CHASE PREY

The WildDogs script marches forward... woot
 
They Target the player
They chase after the player
The player "Plays Dead"
They stop chasing the player and look for a new target.

Here's the RPT_LOG of the player Playing Dead after being spotted by the WildDogs....
12:46:52 "WildDogs: WildDogs Are Locating Prey!"
12:46:52 "WildDogs: WildDogs Sense Prey Nearby!"
12:46:53 "WildDogs: WildDogs Are Chasing Prey!"
12:46:53 "WildDogs: TargetPrey AnimationState is: amovppnemstpsraswrfldnon"
12:46:53 "WildDogs: WildDogs Prey Appears to Be Playing Dead Before Attack!"
12:46:53 "WildDogs: WildDogs Are Locating Prey!"
12:46:53 "WildDogs: WildDogs Sense Prey Nearby!"
12:46:53 "WildDogs: WildDogs Have Caught Their Prey!"
12:46:53 "WildDogs: WildDogs Are Attacking!"
12:47:15 "WildDogs: WildDogs Killed A z_hunter Near [11483.3,7549.97,0]"
12:47:16 "WildDogs: WildDogs Have Finished Killing Their Prey"

I'll probably slip in a bite or two just for playing dead for the giggles.
Ya know, to keep the fear level of the player high!!

Is that cool or what!!
 
Back
Top