johnnyboy 3793 Posted November 1, 2017 UPDATE: Agent Killed event handlers DO return source (unit who killed them). Agent HandleDamange handlers DO NOT return source (unit who caused damage). I can use the Killed EventHandler, so my problem is solved. Original problem statement: Goddamn chickens are pissing me off. I have a scenario where player and AI unit are hunting chickens in a field, and I want to keep score of how many flying chickens were killed by each. Here's the problem: Chickens created as Agents, play walking and pecking animations so look natural. That is good! But their HandleDamage and Killed eventhandlers do not return a value in Source, so I can't credit the unit who killed it. Bad! Chickens created as Vehicles do NOT play walking and pecking animations. Bad! But their HandleDamage and Killed eventhandlers DO return a value in Source. Good! My workaround was to attach a vehicle chicken to the walking Agent chicken, and use the vehicle chicken's eventhandler for crediting shooter. That works about 70% of the time. But the other 30%, the Agent chicken is killed and attached vehicle chicken is not killed, so shooter does not get credit for the kill. Is there a way to play the chicken Agent behavior FSM on the Vehicle chicken, so it has the same brain as an Agent chicken? How would I do that? I may end up recording timestamps for shots fired per units, and compare with Agent Killed timestamps and credit unit with closest timestamp. But if I can get a vehicle chicken to behave like an agent chicken that would be cleaner. Share this post Link to post Share on other sites
EO 11275 Posted November 1, 2017 Sorry I can't help here JB, but that is one surreal post. ^^ Awesome dude! 1 Share this post Link to post Share on other sites
ProfTournesol 956 Posted November 1, 2017 1 hour ago, johnnyboy said: But if I can get a vehicle chicken to behave like an agent chicken that would be cleaner. Mmmm..... Spoiler 1 2 Share this post Link to post Share on other sites
Tajin 349 Posted November 2, 2017 Do their handledamage EHs at least return the projectile ? If so, you could get the owner of that. Share this post Link to post Share on other sites
FireWalker 329 Posted November 2, 2017 I wonder how the zombies in Ravage work? I believe they are created as agents. It shows you how many you've killed in the score table when you've died. (Maybe its just because they aren't chickens?) Share this post Link to post Share on other sites
johnnyboy 3793 Posted November 2, 2017 @Tajin and @FireWalker thanks for your thoughts on this. But I was WRONG! (first time that has ever happened to me). Killed EventHandler DOES include source (shooter) for Agents so my problem is solved. Damaged EventHandler does NOT return source/shooter, but I only use that for the "poof of feathers" effect when hit. Yay, I can move on. 1 1 Share this post Link to post Share on other sites