Jump to content

How to make NPC's appear out of nowhere at a certain time of the day


Recommended Posts

 

There are opposite checkings after else commands in both scripts you present - should be GetDisabled == 0

scn GHOUndeadTownEnemies
 
begin GameMode
 
if GameHour >= 23 || GameHour < 6 ;midnight to morning
 
   if TownGhost1.GetDisabled != 0 ;ghost IS disabled
     TownGhost1.Enable
   endif
   if TownGhost2.GetDisabled != 0
     TownGhost2.Enable
   endif
   if TownGhost3.GetDisabled != 0
     TownGhost3.Enable
   endif
   if TownGhost4.GetDisabled != 0
     TownGhost4.Enable
   endif 

else 

   if TownGhost1.GetDisabled == 0 ;ghost IS NOT disabled
     TownGhost1.Disable
   endif
   if TownGhost2.GetDisabled == 0
     TownGhost2.Disable
   endif
   if TownGhost3.GetDisabled == 0
     TownGhost3.Disable
   endif 
   if TownGhost4.GetDisabled == 0
     TownGhost4.Disable
   endif 

endif
 
end

Similar in second script.

How about an inversion of logic such that 1 function can handle object enabling while getting rid of the main 'else'. Of course, you've provided a correct answer but how about that, how about the thinking?

 

EDIT: Okay, I've suggested the opposite of what I would do here. The time period in terms of enable is boolean and should be evaluated as such; when enable period is met it should be done once and flagged as done; when disable period is met it should be done once and flagged as done. Using OBSE this would be 2 functions where it would be cleaner to nest the time conditional function as a parameter.

 

 

None of these two scripts work.

Link to comment
Share on other sites

  • Replies 82
  • Created
  • Last Reply

Top Posters In This Topic

"Of course, you've provided a correct answer but how about that, how about the thinking?"

 

It doesn't work, yet another member confirms this script as correct? Sorry, but with your last post my patience ran out. Farewell, Dimitrisgb.

Link to comment
Share on other sites

"Of course, you've provided a correct answer but how about that, how about the thinking?"

 

It doesn't work, yet another member confirms this script as correct? Sorry, but with your last post my patience ran out. Farewell, Dimitrisgb.

 

Huh? I tested the script and it doesn't work...

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...