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
NPC turn rate
Author Message
PePs1Man
Apprentice
*

Posts: 32
Likes Given: 8
Likes Received: 2 in 2 posts
Joined: Jun 2017
Reputation: 0



Post: #6
RE: NPC turn rate
Hello,

I did some testing and yes, this might be considered as a sphereserver bug.

Using Sphere 0.56c, from april 10th.

I've checked the youtube video, then I did the same on my own server and it is real, NPC turn rate is lacking big time.

In order to counter this, I had to use a fast timer, so, the fastest timer available is TimerD.

I've created a memory object using TimerD and then the creature is facing the ATTACKER's uid correctly.

For your testing purpose, here's my testing code.

Code:
[Function f_FaceInCombat2]
Serv.NewItem i_FaceInCombat2
New.Attr=082 // decay/invis
New.Timer=1
New.Link=<Src.Uid>
New.P=<Src.P>
New.Update

[ItemDef i_FaceInCombat2]
Id=i_gold
Type=T_Script
Name=Face In Combat 2 Script

On=@Create
More=1000 // expire in X tenth of sec

On=@Timer
Serv.Log <More>
    If <More> > 0
        More -= 1
    Else
        Serv.Log <Name> has expired
        Remove
    EndIf
    
    If <Link.Attacker>
        Link.Face <Link.Attacker.0>
        Link.Say Facing <Link.Attacker.0.Name>
    EndIf
    
    TimerD=1
    Return 1

Event that you put on a player :
Code:
On=@CombatStart
    Say Starting a new combat with <Src.Name>
    If !<ISTIMERF.f_FaceInCombat2>
        Src.TimerF 5,f_FaceInCombat2
    Endif

Please note that the code is totally untweaked and badly programmed to be used, but this will give you the idea.
I'll redo it and include in my shard but take these important notes...

TimerD should stress the server a lot so you have to limit it's usage.

I'd script it differently

Have fun testing!
07-14-2017 06:13 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
NPC turn rate - Indiaret - 07-01-2017, 12:02 AM
RE: NPC turn rate - Indiaret - 07-10-2017, 08:18 AM
RE: NPC turn rate - darksun84 - 07-10-2017, 08:52 PM
RE: NPC turn rate - Indiaret - 07-10-2017, 09:29 PM
RE: NPC turn rate - Indiaret - 07-12-2017, 09:13 AM
RE: NPC turn rate - PePs1Man - 07-14-2017 06:13 AM
RE: NPC turn rate - Indiaret - 07-15-2017, 12:41 AM
RE: NPC turn rate - darksun84 - 07-20-2017, 10:36 PM
RE: NPC turn rate - Indiaret - 07-21-2017, 03:02 AM
RE: NPC turn rate - Coruja - 07-27-2017, 12:25 PM
RE: NPC turn rate - PePs1Man - 07-27-2017, 01:39 PM

Forum Jump:


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