Aller au contenu

Photo

No fight, just run -- Wild Animal script.


  • Veuillez vous connecter pour répondre
6 réponses à ce sujet

#1
3RavensMore

3RavensMore
  • Members
  • 707 messages
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...:blush:

#2
ehye_khandee

ehye_khandee
  • Members
  • 855 messages
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

#3
Fester Pot

Fester Pot
  • Members
  • 1 395 messages
Make sure your Wild Animal faction has the GLOBAL box UNCHECKED for starters.

FP!

#4
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
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
kalbaern

kalbaern
  • Members
  • 824 messages
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
henesua

henesua
  • Members
  • 3 883 messages
 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.

Modifié par henesua, 05 juin 2012 - 11:38 .


#7
3RavensMore

3RavensMore
  • Members
  • 707 messages
As always, thanks for your fantastic help. I have it working now.