Jump to content

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


Recommended Posts

 

 

What is the player supposed to activate to make the NPC's appear?

 

The player is not supposed to activate anything to make the NPCs appear.

So why do you use OnActivate then?

 

 

 

I tried the Begin OnGame, but I got a message the script can't recognise the word OnGame.

Link to comment
Share on other sites

  • Replies 82
  • Created
  • Last Reply

Top Posters In This Topic

It seems that your script contains logical error in setting doOnce flag. Enable and Disable commands are completely mismatched.

scn ELSJinsAppear
short DoOnce1

begin GameMode
 
if GameHour >= 5
   if ELSBattlemageEvilJinRef.GetDisabled == 0 ;group of jins is not disabled
      ;disable jin group
      ELSBattlemageEvilJinRef.Disable
      ELSBackAlleyGJinRef.Disable
      ELSHunbalSpiritRef.Disable
      ELSAlUzzaSpiritRef.Disable
      ELSManatSpiritRef.Disable
      ELSAlLatSpiritRef.Disable
      set DoOnce1 to 0 ;reset flag to make appear them at night again
   endif   
endif
   
If GameHour >= 21
   ;is player in same cell as group
   if player.GetInSameCell ELSBattlemageEvilJinRef != 0 && DoOnce1 == 0
      ;yes, so enable whole group
      ELSBattlemageEvilJinRef.Enable
      ELSBackAlleyGJinRef.Enable
      ELSHunbalSpiritRef.Enable
      ELSAlUzzaSpiritRef.Enable
      ELSManatSpiritRef.Enable
      ELSAlLatSpiritRef.Enable
      Set DoOnce1 to 1
   endif
EndIf
 
End 

I'm assuming that jins are grouped in same place, so that's why I checked only one jin(spirit). I made them appear when player arrives at their cell at night too, this should prevent them to accidentaly run away without noticing.

 

Can't make it work. Syntax errors and for some weird reason, the script can't recognise the existence of the NPC's.

Link to comment
Share on other sites

I saw your picture, but how is this group referenced? Because for me this command "ELSBattlemageEvilJin.ref disable" is simply wrong. If you simply dragged them to cell from Object Window, they appear under base ID (in text, their hex FormId will be different of course) in cell's objects list. So they should be referenced like "ELSBattlemageEviljin.disable", if they are unique.

Edited by RomanR
Link to comment
Share on other sites

Nope. Still not working. I replaced their ref with their Base ID and still the auto-correct can recognize the script command.

And one more thing. That EvilBattleMageJin is not supposed to be in the same cell with the rest. Shoild I remove that sentence?

Link to comment
Share on other sites

This is what I wrote:

 

scn ELSJinsAppearTest
short DoOnce1
begin GameMode
if GameHour >= 5
if ELSEvilJin1 GetDisabled == 0 ;group of jins is not disabled
;disable jin group
ELSEvilJin1 Disable
ELSGoodJin1 Disable
ELSHubal Disable
ELSAlUzza Disable
ELSManat Disable
ELSAlLat Disable
set DoOnce1 to 0 ;reset flag to make appear them at night again
endif
endif
If GameHour >= 21
;is player in same cell as group
if Player.GetInSameCell ELSEvilJin1 != 0 && DoOnce1 == 0
;yes, so enable whole group
ELSEvilJin1 Enable
ELSGoodJin1 Enable
ELSHubal Enable
ELSAlUzza Enable
ELSManat Enable
ELSAlLat Enable
Set DoOnce1 to 1
endif
EndIf
End
Link to comment
Share on other sites

Your script will never work this way.

 

I assume you gave your NPC's a unique cell reference, you need to use these same references in your script with something like this

ELSEvilJin1.enable

 

assuming one of your NPC's has the cell reference ELSEvilJin1 that is.

Link to comment
Share on other sites

Yes, if this NPC isn't with others, remove player.GetInSameCell condition, but don't remove DoOnce1 == 0.

Also Disable command needs a point notation "{world or cell reference ID}.disable".

Besides your NPC IDs are now almost completely different, what is this? You must find your NPCs in cell's Object Window (in vanilla CS is titled Cell View and object list is in its right half) and type their reference IDs before point of Disable or Enable command.

Edited by RomanR
Link to comment
Share on other sites

Still doesn't work. "Script command not found"

This is what I wrote

scn ELSJinsAppearTest
short DoOnce1
Begin OnActivate
if (GetCurrentTime >= 21) && (GetCurrentTime <= 5)
ELSHubal {ELSRhondalBurningStarTemple} enable
ELSAlUzza {ELSRhondalBurningStarTemple} enable
ELSManat {ELSRhondalBurningStarTemple} enable
ELSGoodJin1 {Wilderness} enable
ELSEvilJin1 {ELSBattlemageHideoutExt} enable
else
ELSHubal {ELSRhondalBurningStarTemple} disable
ELSAlUzza {ELSRhondalBurningStarTemple} disable
ELSManat {ELSRhondalBurningStarTemple} disable
ELSGoodJin1 {Wilderness} disable
ELSEvilJin1 {ELSBattlemageHideoutExt} disable
endif
Set DoOnce1 to 1
End
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...