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-nmm7 (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-nmm7 (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-nmm7 (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
Trying to move NPCs at night to "go home", I blame sectorsleep.
Author Message
Rayvolution
Journeyman
*

Posts: 135
Likes Given: 0
Likes Received: 2 in 2 posts
Joined: Jul 2012
Reputation: 1

Aetharia

Post: #11
RE: Trying to move NPCs at night to "go home", I blame sectorsleep.
(08-11-2012 06:34 AM)Extreme Wrote:  <snip>

Here's my modified version of your script, it's working as well! Although, I don't understand why yours works, and my original one doesn't. They both basically do the exact same thing, yours just uses CONT. and mine uses LINK. But for some reason, that seems to be doing the trick to ignore sectorsleep.

Very strange indeed, but it's working now. I need to clean up the code, and change the coordinates for CONT.HOME to read a tag on the NPC rather than a set number. but everything seems fine now!

Any ideas why yours is working, and mine isnt?

New (working) code.
Code:
[EVENTS e_AI_Vendor]
ON=@NPCLookAtChar
IF (<RESTEST i_mem_vendor_home>)
ELSE
   SERV.NEWITEM i_mem_vendor_home
   EQUIP <NEW>
   NEW.TIMER=5
ENDIF

[ITEMDEF I_MEM_VENDOR_HOME]
ID I_MEMORY
TYPE T_EQ_SCRIPT
NAME Vendor Home Memory
ON=@CREATE
ATTR 010
ON=@TIMER
IF (<CONT.SECTOR.LIGHT> > 10) && (<CONT.DISTANCE <CONT.HOME>> > 4)
  CONT.SAY @,,1 It's night, I'm going home.
  CONT.GOTO <CONT.HOME>
ELSE
IF <CONT.SECTOR.LIGHT> > 10
  CONT.HOME 2542,2158,1
  CONT.SAY @,,1 It's Night, and I am at home.
ENDIF
IF (<CONT.SECTOR.LIGHT> < 10) && (<CONT.DISTANCE <CONT.HOME>> > 4)
  CONT.SAY @,,1 It's day, I'm going to work.
  CONT.GOTO <CONT.HOME>
ELSE
IF <CONT.SECTOR.LIGHT> < 10
  CONT.HOME 2460,2062,1
  CONT.SAY @,,1 It's Day, and I am at work.
ENDIF
TIMER 6
RETURN 1

[Image: 4_Logo.png]
An MMORPG based on the Ultima Online engine.
Completely Custom Map, GUI, AI, Combat, Skills, Crafts, Art, Music and so much more.
http://aetharia.com - Home of Ambition!
(This post was last modified: 08-11-2012 08:16 AM by Rayvolution.)
08-11-2012 07:37 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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