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
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #11
RE: Animals won't start fights
NPC AI is a bit complicated, like the "AI" word says itself, they have some artificial intelligence checks instead just attack everyone and everything, so there's some things that can make the NPC refuse start the attack (like flags, distance, notoriety, threat level, etc)

here you can find how the attack sequence is called and everything that it checks for:
https://github.com/Sphereserver/Source/b....cpp#L2344

PS: maybe the problem of guards NPCs refusing the attack could be also related to this same code
01-28-2017 06:52 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Coruja's post
Anarch Cassius
Master
**

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



Post: #12
RE: Animals won't start fights
Ugh so I went in and turned on all my NPC Ai extras and it works fine as long as I leave Fight and Flee off.

So 2 likely possibilities...

NPC AI Extra makes certain things not work when Fight and Flee are active but is fine when they are off. Fight and Flee break certain things on their own.

OR

Fight and Flee DO allow combat but so intermittently I associated it with other changes that actually had no effect; NPC AI extra has no effect.

Bottom line, if you want to control fights yourself turn off Fight and Flee.

Current Projects: Necromancy SCP overhaul. Custom Faction AI/System. Imbuing.
01-30-2017 07:02 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #13
RE: Animals won't start fights
try using this test build to check if it's working fine


Attached File(s)
.zip  SphereSvr-AttackTest.zip (Size: 1.24 MB / Downloads: 5)
01-31-2017 01:31 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: #14
RE: Animals won't start fights
Combat sort of works but monsters/animals still will not attack enemies of the same brain. You get the same declaration of attack (once) with no follow through.

Current Projects: Necromancy SCP overhaul. Custom Faction AI/System. Imbuing.
01-31-2017 07:55 AM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #15
RE: Animals won't start fights
probably this is related to NPC motivation to attack

try disable MonsterFight on sphere.ini, or if do you want leave it enabled try using this event to prevent the NPC lower its motivation chance when attacking another NPC with the same brain/ID
Code:
ON=@NPCActFight
ARGN2=10000
(This post was last modified: 01-31-2017 08:48 AM by Coruja.)
01-31-2017 08:32 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: #16
RE: Animals won't start fights
Okay. That makes sense.

I figured it was motivation but couldn't figure out where to alter it with script, thanks for pointing me to NPCActFight. That said I am not sure how desirable the brain checking is, particularly with so many old brain types deprecated. It's basically monster and animal now, so MonstersFight is more like monster vs animals.

Current Projects: Necromancy SCP overhaul. Custom Faction AI/System. Imbuing.
(This post was last modified: 01-31-2017 09:25 AM by Anarch Cassius.)
01-31-2017 09:24 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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