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 sleep
Author Message
Nachtmusique
Journeyman
*

Posts: 89
Likes Given: 0
Likes Received: 6 in 6 posts
Joined: Mar 2012
Reputation: 0



Post: #1
NPC sleep
I'd like to make an npc go to sleep and then wake up.
the sleep function has some odd behavior on npcs. It acts like it will work, creating the "corpse" and hiding the npc, but then the hidden npc dies creating a second corpse. Does anyone have a script for this?
08-22-2014 03:23 PM
Find all posts by this user Like Post Quote this message in a reply
Nachtmusique
Journeyman
*

Posts: 89
Likes Given: 0
Likes Received: 6 in 6 posts
Joined: Mar 2012
Reputation: 0



Post: #2
RE: NPC sleep
Just to be clear, I am talking about the default built-in sleep function. It works fine for players, but not for npcs. Does anyone have a good idea of how to make it work for npcs?
08-25-2014 02:28 AM
Find all posts by this user Like Post Quote this message in a reply
dagger4k
Journeyman
*

Posts: 194
Likes Given: 1
Likes Received: 12 in 12 posts
Joined: Mar 2012
Reputation: 0



Post: #3
RE: NPC sleep
what are you actually trying to do here? Somone uses a musical instrument and the npc falls asleep??? if you give an explanation you will get an answer Smile
08-25-2014 11:41 PM
Find all posts by this user Like Post Quote this message in a reply
Nachtmusique
Journeyman
*

Posts: 89
Likes Given: 0
Likes Received: 6 in 6 posts
Joined: Mar 2012
Reputation: 0



Post: #4
RE: NPC sleep
I have several applications in mind. Music is a good example, also having a sleeping npc that players ate trying to sneak past, knock out abilities in combat, etc. I just want a way to make a function for npcs that operates the same way SLEEP does for player characters. With sleep players can immediately move again if they choose to, so I assume I would need to STONE the npc to keep it asleep until I want it to wake up. Depending on the application I could then remove stone to allow the npc to wake up. The problem is that .sleep is bugged for npcs. It creates the corpse, hides the npc, then the hidden npc just dies and creates a second corpse.
(This post was last modified: 08-26-2014 10:32 PM by Nachtmusique.)
08-26-2014 10:29 PM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #5
RE: NPC sleep
Try speedmode 3 or 4 on npcs, it maybe block them to walk.
Or tag.nomovetill..
Or freezing them with statf_freeze instead stone.

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
08-27-2014 01:44 AM
Find all posts by this user Like Post Quote this message in a reply
Ben
Sphere Developer
*****

Posts: 612
Likes Given: 2
Likes Received: 123 in 70 posts
Joined: Mar 2010
Reputation: 18

SphereCommunity

Post: #6
RE: NPC sleep
Found the bug and fixed it. Also made sure that NPCs can't move if sleeping to prevent them from waking up right away.
Using "REVEAL statf_sleeping" will wake the NPC.

This fix will only show up in tomorrow night's nightly build.

AxisII's current version: 2.0.4j
AxisII SourceCode on Github
AxisII up to date changelog
08-27-2014 08:54 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Ben's post
Nachtmusique
Journeyman
*

Posts: 89
Likes Given: 0
Likes Received: 6 in 6 posts
Joined: Mar 2012
Reputation: 0



Post: #7
RE: NPC sleep
Excellent!
08-27-2014 09:32 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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