Thread: NPCs sleeping
View Single Post
  #11  
Old 02-19-2007, 12:59 AM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by cbkbud View Post
I know that. When noone is in the level, the NPCs sleep. They don't do anything. The timeout stops, etc.
Maybe you could set a variable like this:

PHP Code:
function onCreated()
{
     if (
this.initiate)
     {

          
//...

     
}
     
     
setTimer(0.05);
}

function 
onTimeout()
{
     if (
playerscount == 0)
     {
          
this.initiate false;
     } else {
          
this.initiate true;
     }

     if (
this.initiate)
     {
          
// Do whatever code you want.
     
}

     
setTimer(0.05);

( I feel as though i've made a mistake in the above code, but it looks fine ... )
__________________
What signature? I see no signature?
Reply With Quote