Script Questions

I have this WildDogs script I'm working on that for now, sends a pack of Wild Dogs out to kill animals. Eventually it will include Zombies and Players along with the animals..

How come when I do this line in a script...
SCRIPT: diag_log format ["WildDogs: WildDogs Spawned at %1",(getPos _WildDogs)];

I get this in the RPT LOG which is great..
RPT LOG: 18:20:55 "WildDogs: WildDogs Spawned at [11482,7664.53,0]"

But when I do the same thing technically again in another script called by the previous script...
SCRIPT: diag_log format ["WildDogs: WildDogs Killed %1 near 2%",_TargetPrey,(getPos _WildDogs)];

I get this in the RPT LOG which sucks.
RPT LOG: 18:30:09 "WildDogs: WildDogs Killed Agent 0xdab6ac0 near 2"

And is there any way to convert the "Agent 0xdab6ac0" to the actual animal that was killed, like a COW01, instead of the Agent stuff?
 
what does your define of _TargetPrey look like? you also might define the pos first to such as
_TargetPrey = ???;
_DogPos = getPos _WildDogs;
diag_log format ["WildDogs: WildDogs Killed %1 near 2%",_TargetPrey,_DogPos];
 
I've added your:
_DogPos = getPos _WildDogs;
diag_log format ["WildDogs: WildDogs Killed %1 near 2%",_TargetPrey,_DogPos];

That looks like a winner, I'll try it when I get home!
Thank for the help!

my define of _TargetPrey would be this I believe..
_WildDogs = _this select 0;
_TargetPrey = _this select 1;
 
try this to get the animal type .. just guessing here. especially since we dont get to see the full script to know what values you are passing to your script
_targetPrey = typeof (agent (_this select 1));
 
Sweet! That looks like it will work. I'll give it shot when I get home! You guys are so smart!!

I'm sure I'll end up releasing it here as it's quite impressive to see a pack of wild dogs running across the field and killing it's prey. Just working out the kinks that I got stuck on so far with your guys help. Much appreciated, truly!
 
You could use a variation of the right click action and the vehicle locate on gps script to locate your dogs and their kills.
 
Dude! I'm interested! I'll look into that!

I was pondering the same thing from this direction.... how to get the WildDogs location from the script and then with a SQL write to the CHARACTER_DATA table in the Hivemind database, have the location of the dogs written to a dummy player in my database so I can track their location on my "PrivateHiveTools" map along with the rest of the players on the server. That way the dogs would be a DOT on the map just like a player, with tracking of where they have been. how cool would that be!
 
Instead of wild dogs ... this is a zombie game right? ... I know I would tame the zombies, use the brains of all the players I kill as training aids ... So, lets use our tamed zombie horde to hunt down other players and animals ....
 
okay so like you have quite the imagination I see... lol help me finish this script up and we'll started on that one next! : P
 
try this to get the animal type .. just guessing here. especially since we dont get to see the full script to know what values you are passing to your script
_targetPrey = typeof (agent (_this select 1));

"WildDogs: WildDogs Killed Cow01 near 2"
"WildDogs: WildDogs Killed a Hen near 2"
"WildDogs: WildDogs Killed a Goat near 2"


NICE! Thank Dude!!
 
Last edited:
I wonder if you could spawn raw meat into the inventory of the dog after the kill. So when it returns it has raw rabbit or cow in its inventory. Or zombie parts. Or human meat. When it kills its prey.
 
you can setvariable to have whatever meat you want. or you can
dead_rabbit attachto dog_mouth
and they return the kill to you, just like a bird dog.
 
BTW .. I didnt do any scripting. I just created a dog and a dead bunny and then used attachto in its init field. To show if this was added into the original script how it would look. When the dog gets within X of owner it would have to drop the prey. The attachto would need some tweaking to get it exactly into the mouth. I was wondering if you could make the dog walk backwards so it was dragging the sheep or cow by a leg ... was just wondering though, didnt look into it.
 
Back
Top