The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Animals won't start fights
Author Message
Anarch Cassius
Master
**

Posts: 273
Likes Given: 19
Likes Received: 10 in 9 posts
Joined: Mar 2012
Reputation: 2



Post: #1
Animals won't start fights
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?

Current Projects: Necromancy SCP overhaul. Custom Faction AI/System. Imbuing.
01-25-2017 12:40 PM
Find all posts by this user Like Post Quote this message in a reply
massis87
Journeyman
*

Posts: 82
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Jan 2017
Reputation: 0

D&W 8thAge

Post: #2
RE: Animals won't start fights
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.

There are worse ways to understand the sense of the word: no. Ranting
(This post was last modified: 01-26-2017 12:21 PM by massis87.)
01-26-2017 12:20 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Anarch Cassius
Master
**

Posts: 273
Likes Given: 19
Likes Received: 10 in 9 posts
Joined: Mar 2012
Reputation: 2



Post: #3
RE: Animals won't start fights
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/b...s.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.

Current Projects: Necromancy SCP overhaul. Custom Faction AI/System. Imbuing.
(This post was last modified: 01-26-2017 12:42 PM by Anarch Cassius.)
01-26-2017 12:30 PM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #4
RE: Animals won't start fights
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
(This post was last modified: 01-26-2017 07:40 PM by darksun84.)
01-26-2017 07:39 PM
Find all posts by this user Like Post Quote this message in a reply
Anarch Cassius
Master
**

Posts: 273
Likes Given: 19
Likes Received: 10 in 9 posts
Joined: Mar 2012
Reputation: 2



Post: #5
RE: Animals won't start fights
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.

Current Projects: Necromancy SCP overhaul. Custom Faction AI/System. Imbuing.
01-27-2017 05:11 AM
Find all posts by this user Like Post Quote this message in a reply
Leonidas
Master
**

Posts: 277
Likes Given: 3
Likes Received: 13 in 12 posts
Joined: May 2013
Reputation: 1



Post: #6
RE: Animals won't start fights
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
(This post was last modified: 01-27-2017 12:12 PM by Leonidas.)
01-27-2017 12:09 PM
Find all posts by this user Like Post Quote this message in a reply
Anarch Cassius
Master
**

Posts: 273
Likes Given: 19
Likes Received: 10 in 9 posts
Joined: Mar 2012
Reputation: 2



Post: #7
RE: Animals won't start fights
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.

Current Projects: Necromancy SCP overhaul. Custom Faction AI/System. Imbuing.
(This post was last modified: 01-28-2017 06:09 AM by Anarch Cassius.)
01-27-2017 05:45 PM
Find all posts by this user Like Post Quote this message in a reply
Leonidas
Master
**

Posts: 277
Likes Given: 3
Likes Received: 13 in 12 posts
Joined: May 2013
Reputation: 1



Post: #8
RE: Animals won't start fights
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.
01-28-2017 07:36 AM
Find all posts by this user Like Post Quote this message in a reply
Anarch Cassius
Master
**

Posts: 273
Likes Given: 19
Likes Received: 10 in 9 posts
Joined: Mar 2012
Reputation: 2



Post: #9
RE: Animals won't start fights
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...ting-back) where you able to find the cause?

Current Projects: Necromancy SCP overhaul. Custom Faction AI/System. Imbuing.
01-28-2017 08:40 AM
Find all posts by this user Like Post Quote this message in a reply
Leonidas
Master
**

Posts: 277
Likes Given: 3
Likes Received: 13 in 12 posts
Joined: May 2013
Reputation: 1



Post: #10
RE: Animals won't start fights
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.
01-28-2017 09:43 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 9 Guest(s)