Jump to content

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


Recommended Posts

This doesn't work either:

 

scn ELSJinsAppearTest
short DoOnce1
Begin OnActivate
if (GetCurrentTime >= 21) && (GetCurrentTime <= 5)
ELSHunbalSpirit.ref {ELSRhondalBurningStarTemple}.enable
ELSAlUzzaSpirit.ref {ELSRhondalBurningStarTemple}.enable
ELSManatSpirit.ref {ELSRhondalBurningStarTemple}.enable
else
ELSHunbalSpirit.ref {ELSRhondalBurningStarTemple}.disable
ELSAlUzzaSpirit.ref {ELSRhondalBurningStarTemple}.disable
ELSManatSpirit.ref {ELSRhondalBurningStarTemple}.disable
endif
Set DoOnce1 to 1
End
Link to comment
Share on other sites

  • Replies 82
  • Created
  • Last Reply

Top Posters In This Topic

Wrong again. You didn't understand what I was writing. So what are IDs of NPC references when you did put them in their cells? And again OnActivate block doesn't have any meaning, as mentioned by OblivionAddicted, use standard GameMode instead.

Edited by RomanR
Link to comment
Share on other sites

Wrong again. You didn't understand what I was writing. So what are IDs of NPC references when you did put them in their cells? And again OnActivate block doesn't have any meaning, as mentioned by OblivionAddicted, use standard GameMode instead.

 

For example, Al-Uzza's base ID is ELSAlUzza. Her ref ID is ELSAlUzzaSpirit.

 

So I tried this code:

 

scn ELSJinsAppearTest

short DoOnce1
Begin GameMode
if (GetCurrentTime >= 21) && (GetCurrentTime <= 5)
enable ELSHunbalSpirit {ELSRhondalBurningStarTemple}.
enable ELSAlUzzaSpirit {ELSRhondalBurningStarTemple}
enable ELSManatSpirit {ELSRhondalBurningStarTemple}.
else
disable ELSHunbalSpirit {ELSRhondalBurningStarTemple}
disable ELSAlUzzaSpirit {ELSRhondalBurningStarTemple}.
disable ELSManatSpirit {ELSRhondalBurningStarTemple}.
endif
Set DoOnce1 to 1
End
Which has no errors, no missing variables, no unknown script commands, but still doesn't work.
Link to comment
Share on other sites

Here:

scn ELSJinsAppearTest

short DoOnce1
 
Begin GameMode

if (GetCurrentTime >= 21) && (GetCurrentTime <= 5)
   if DoOnce1 == 0
      ELSHunbalSpirit.enable
      ELSAlUzzaSpirit.enable
      ELSManatSpirit.enable
      set DoOnce1 to 1
   endif
else
  if DoOnce1 != 0
     ELSHunbalSpirit.disable
     ELSAlUzzaSpirit.disable
     ELSManatSpirit.disable
     set DoOnce1 to 0
  endif
endif

End

I think that reading GameHour global var should do too.

Link to comment
Share on other sites

It looks like something with hour condition, try this:

scn ELSJinsAppearTest

short DoOnce1
 
Begin GameMode

if (GetCurrentTime >= 21) ;from evening to midnight
   if DoOnce1 == 0
      ELSHunbalSpirit.enable
      ELSAlUzzaSpirit.enable
      ELSManatSpirit.enable
      set DoOnce1 to 1
   endif
else
   if (GetCurrentTime >= 0) && (GetCurrentTime < 5) && (DoOnce1 == 0) ;from midnight to dusk
      ELSHunbalSpirit.enable
      ELSAlUzzaSpirit.enable
      ELSManatSpirit.enable
      set DoOnce1 to 1
   endif
endif

if (DoOnce1 != 0) && (GetCurrentTime >= 5) && (GetCurrentTime < 21) ;day
   ELSHunbalSpirit.disable
   ELSAlUzzaSpirit.disable
   ELSManatSpirit.disable
   set DoOnce1 to 0
endif

End
Edited by RomanR
Link to comment
Share on other sites

If they're already enabled, they must be visible as you enter their cell, right? However, you must begin to test my script entering at 21 hour and you must be in cell where object to which this is attached resides. However it's better to attach this script to some place-independent object, like quest for example. Or if this is for test only, attach it to a player itself.

Edited by RomanR
Link to comment
Share on other sites

Assuming you already gave your NPC's a unique cell reference and you want to use a quest script your script should look like this without the DoOnce variable:

 

ScriptName DrimitriSGBActivateNightlyNPCScript

begin GameMode

if GameHour >= 18 || GameHour < 6
ELSHunbalSpiritRef.enable
else
ELSHunbalSpiritRef.disable
endif
end

 

assuming your NPC with the editor ID ELSHunbalSpirit has the unique cell reference ELSHunbalSpiritRef that is, of course.

 

I used a similar script with an initially disabled NPC and gave the "quest" a 50 points priority by the way.

Edited by Oblivionaddicted
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...