This is probably a matter of setting a few flags on spawn, but...
No fight, just run -- Wild Animal script.
Débuté par
3RavensMore
, juin 05 2012 06:45
#1
Posté 05 juin 2012 - 06:45
I'm setting up a wild animal / hunting system, however I've run into a issue that's stumped me. My wild animals flee when they are supposed to, except when they are attacked. On being attacked, every other creature in my Wild Animal faction turns hostile in the area. What I want to do, is not have them turn hostile (including the animal I attack) and simply continue to flee when they're suposed to. I want them to be killable, but react like a real-world animal would; that being, I see a foe or am attacked and all I want to do is get the hell out of Dodge. They shouldn't warn others animals to attack; they won't fight back, they should just run away. Hunting should be difficult - one or two shots at that fleet of foot deer and it's is out of sight.
This is probably a matter of setting a few flags on spawn, but...
This is probably a matter of setting a few flags on spawn, but...
#2
Posté 05 juin 2012 - 07:24
Look for the creature's on_attacked and on_damaged scripts, you may need to make a special copy of those for 'herbivores' which, unless cornered, should behave as you describe. It is almost certain that the default scripts in those slots are setup to return an attack if attacked/damaged... change that feature on your 'herbie' versions.
Be well. Game on.
GM_ODA
http://playnwn.com
Be well. Game on.
GM_ODA
http://playnwn.com
#3
Posté 05 juin 2012 - 07:28
Make sure your Wild Animal faction has the GLOBAL box UNCHECKED for starters.
FP!
FP!
#4
Posté 05 juin 2012 - 08:25
Also make sure they are not listening. Would help if they did not shout at all, But that is harder to track down. SetListening( oObject, FALSE); Towards the bottom of the OnSpawn script should stop a lot of there reactions from others.
#5
Posté 05 juin 2012 - 08:38
I'm fairly certain that if you just delete the OnConversation Event in your hunted creatures it'll keep them from attacking as they'll nolonger respond to shouts. Was what I did at least.
#6
Posté 05 juin 2012 - 11:33
And just to make things more complicated with another option 
Have you tried working with Special Behavior? There is behavior for Carnivores, Herbivores, and Omnivores. I heavily modified this and it is working nicely for me.
Here's some work by LoCash
If you are curious about my work on this I can dig it up and post it for you.
And another option:
since the call to fight is often DetermineCombatRound, you can change what happens in that function with setting a local var on the creature, X2_SPECIAL_COMBAT_AI_SCRIPT, which is the name of a script that you call in place of the rest of DetermineCombatRound. So with that special ai script you could tell the creature to keep fleeing rather than attack.
Have you tried working with Special Behavior? There is behavior for Carnivores, Herbivores, and Omnivores. I heavily modified this and it is working nicely for me.
Here's some work by LoCash
If you are curious about my work on this I can dig it up and post it for you.
And another option:
since the call to fight is often DetermineCombatRound, you can change what happens in that function with setting a local var on the creature, X2_SPECIAL_COMBAT_AI_SCRIPT, which is the name of a script that you call in place of the rest of DetermineCombatRound. So with that special ai script you could tell the creature to keep fleeing rather than attack.
Modifié par henesua, 05 juin 2012 - 11:38 .
#7
Posté 06 juin 2012 - 12:51
As always, thanks for your fantastic help. I have it working now.





Retour en haut







