SphereCommunity
Animals won't start fights - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: Animals won't start fights (/Thread-Animals-won-t-start-fights)

Pages: 1 2


Animals won't start fights - Anarch Cassius - 01-25-2017 12:40 PM

So I have some AI scripts that make creatures fight. They used to work great and now they don't.

It seems the old ATTACK command doesn't work fully anymore, so I changed over to ATTACKER.ADD.

That helped, one event that wasn't working at all now makes animals fight monsters. Another event was previously showing the starting to attack emote (using ATTACK, not ATTACKER.ADD) and now also works against monsters, only.

Brain_animal no longer seems willing to start a fight with brain_animal. They will defend each other from monster attacks (the first event), but not attack other animals when hungry (the second), only monsters.

How do I force an animal to actually follow through and attack another animal instead of just declaring intent to?


RE: Animals won't start fights - massis87 - 01-26-2017 12:20 PM

try to put karma -2000 on brain_animal, remember to readd npc when you change brain

in the wiki you can see all brains and all particuarls reactions.
use what you need and put the karma you want.


RE: Animals won't start fights - Anarch Cassius - 01-26-2017 12:30 PM

Yeah that's the thing, I don't want to do that. It'll affect other things. I want neutral animals attacking out of hunger, which I specifically scripted to happen and used to work.

I know what brain_animal does and I am fine with that. In versions of Sphere up to around a year ago however ANY brain would attack when a script explicitly told it too. Now they intitiate hostilities (*x is attacking y*) but don't move to attack the target.

And I just confirmed it's not even an animal thing...

Monsters won't fight monsters either.

I switched a rabbit's brain to monster and it went for the rat before I could even change it. Then I changed the rat's brain and they both stopped fighting.

The problem looks to be here: https://github.com/Sphereserver/Source/blob/e4288c460c6c51bbbdf2101e42c0e64013fd96e4/src/graysvr/CCharNPCStatus.cpp#L449

Brains of the same type aren't hostile. Changing the threat doesn't seem to help and I don't know how to affect hostility directly.


RE: Animals won't start fights - darksun84 - 01-26-2017 07:39 PM

In the sphere.ini there is this setting:

// Monsters may fight each other
MonsterFight=0

Maybe you have already tried it, but try to set it to 1 and then resyncs/restart


RE: Animals won't start fights - Anarch Cassius - 01-27-2017 05:11 AM

It's been set to 1 for ages. I tried turning if off to see if it got bugged. I also tried threat on and off. These scripts all used to work FINE, I didn't change anything in my .ini it was something about the hardcode changes to attacker, I just don't know which.

Can you confirm for me that you have scripts using ATTACK on your server and they cause NPCs to fight NPCs of the same brain? In the last version of Sphere? If so can I see both the script and your ini settings.


RE: Animals won't start fights - Leonidas - 01-27-2017 12:09 PM

Worked for me.

Code:
[SPEECH spk_stag_test]

ON=test

TARGETF attacktest
say Who do I attack?
obj=<uid>

[FUNCTION attacktest]
obj.attack <argo>

Code:
// Monsters run when scared of death
MonsterFear=0

// Monsters may fight each other
MonsterFight=0

BUT my build is Dec 17th after just reading you comment latest version of sphere Tongue


RE: Animals won't start fights - Anarch Cassius - 01-27-2017 05:45 PM

Thanks, that helped if only to know if can work.

Latest Sphere in this case is anything from the last year so you're fine. Smile

It's NOT MonsterFear or MonsterFight.

It IS one of the Extra_NPC_AI flags. I was able to get correct behavoir by killing all but the old Speedmove. Since most of them don't work well this is fine for now. I will debug to figure out which is the problem.

Edit: Okay, apparently the unwillingness to fight the same brain, like monster vs monster, does happen only if MonsterFear/MonsterFight are ON. I suppose they may just all be afraid but I recall them moving away if that happened before.


RE: Animals won't start fights - Leonidas - 01-28-2017 07:36 AM

Pretty sure I had fear and death turned on a while back and they would still attack each other with or without the same brain.


RE: Animals won't start fights - Anarch Cassius - 01-28-2017 08:40 AM

It may depend on the brain.

All I know is that my faction monsters weren't fighting even after I disabled the Extra_AI and most of the other scripts were working. Once I disabled Fear and Fight they started fighting like before. As I said, it could be that they just all fear each other due to some quirk of my server's stats.

You seemed to have a similair problem with guards at one point (https://forum.spherecommunity.net/Thread-NPCs-not-fighting-back) where you able to find the cause?


RE: Animals won't start fights - Leonidas - 01-28-2017 09:43 AM

I actually forgot that my guards werent working, I can't recall figuring out what the cause was. I just got on my server and tested and they are working fine, their using the default system too.