Dimitrisgb Posted May 19, 2023 Share Posted May 19, 2023 I 've been trying to make NPC's appear every night, at 9 p.m. using a script, but I get syntax errors. I try something like "if game-time" or "if in-game time" and all that, but with no success. Link to comment Share on other sites More sharing options...
Oblivionaddicted Posted May 19, 2023 Share Posted May 19, 2023 Take a look at the script of the street lights, it will surely help you. Link to comment Share on other sites More sharing options...
Dimitrisgb Posted May 19, 2023 Author Share Posted May 19, 2023 Thanx, but I looked at the Forlorn Watchman's script and I think I got the answer. The NPC's appear at 9 p.m. every night and disappear at 5 a.m. every day (I made some adjustments). Link to comment Share on other sites More sharing options...
Dimitrisgb Posted May 22, 2023 Author Share Posted May 22, 2023 Take a look at the script of the street lights, it will surely help you. Ok, so my script is a bit buggy, which means that if I am not at the certain cell, by the time they NPC's should appear, they will not appear. This is what I have written: scn ELSJinsAppearshort DoOnce1begin gamemode if GameHour >= 5 Disable ELSBattlemageEvilJin.refDisable ELSBackAlleyGJin.refDisable ELSHunbalSpirit.refDisable ELSAlUzzaSpirit.refDisable ELSManatSpirit.refDisable ELSAlLatSpirit.ref endif end Begin GameMode If GameHour >= 21 Enable ELSBattlemageEvilJin.refEnable ELSBackAlleyGJin.refEnable ELSHunbalSpirit.refEnable ELSAlUzzaSpirit.refEnable ELSManatSpirit.refEnable ELSAlLatSpirit.ref Set DoOnce1 to 1 EndIf End So I adjusted an already existing script of the lights and have written this: scn ELSJinsAppearTest Begin OnActivate if GameHour >= 5 && GameHour <= 21 ELSHunbalSpirit.ref disableELSAlUzzaSpirit.ref disableELSManatSpirit.ref disableELSBackAlleyGJin.ref disableELSBattlemageEvilJin.ref disable else ELSHunbalSpirit.ref enableELSAlUzzaSpirit.ref enableELSManatSpirit.ref enableELSBackAlleyGJin.ref enableELSBattlemageEvilJin.ref enable endif End And this doesn't work at all. Link to comment Share on other sites More sharing options...
Oblivionaddicted Posted May 23, 2023 Share Posted May 23, 2023 What is the player supposed to activate to make the NPC's appear? Link to comment Share on other sites More sharing options...
IcelandicPsychotic Posted May 23, 2023 Share Posted May 23, 2023 Try using this: if ( GetCurrentTime >= 21.5 ) && ( GetCurrentTime <= 22 ) This line makes something happen between 21:30 and 22:00. Change the times to your liking. Link to comment Share on other sites More sharing options...
Dimitrisgb Posted May 23, 2023 Author Share Posted May 23, 2023 Try using this: if ( GetCurrentTime >= 21.5 ) && ( GetCurrentTime <= 22 ) This line makes something happen between 21:30 and 22:00. Change the times to your liking. Still doesn't work. Link to comment Share on other sites More sharing options...
Dimitrisgb Posted May 23, 2023 Author Share Posted May 23, 2023 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. But I am thinking of a gate that appears the same time the NPC's appear and disappear the same time that they do, but I am afraid that I won't be able to get put of that world if the gate disappears. Link to comment Share on other sites More sharing options...
Oblivionaddicted Posted May 24, 2023 Share Posted May 24, 2023 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? Link to comment Share on other sites More sharing options...
RomanR Posted May 24, 2023 Share Posted May 24, 2023 (edited) 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. Edited May 24, 2023 by RomanR Link to comment Share on other sites More sharing options...
Recommended Posts