RomanR Posted May 25, 2023 Share Posted May 25, 2023 @OblivionAddicted: I would add some checking to not execute Disable or Enable commands at all times. ScriptName DrimitriSGBActivateNightlyNPCScript begin GameMode if GameHour >= 18 || GameHour < 6 if ELSHunbalSpirit.GetDisabled != 0 ELSHunbalSpirit.Enable endif else if ELSHunbalSpirit.GetDisabled == 0 ELSHunbalSpirit.Disable endif endif end He is using ELSHunbalSpirit reference name from ELSHunbal base NPC, if you're wondering why I didn't add Ref suffix to reference ID. Link to comment Share on other sites More sharing options...
Oblivionaddicted Posted May 25, 2023 Share Posted May 25, 2023 Alright Link to comment Share on other sites More sharing options...
Dimitrisgb Posted May 25, 2023 Author Share Posted May 25, 2023 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.disableendifend 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. So I need to add a quest? Or just select quest script? Link to comment Share on other sites More sharing options...
RomanR Posted May 26, 2023 Share Posted May 26, 2023 For a testing purpose, there's no need. Simply attach it to player (in CS there is a defined NPC by this name, don't forget to switch the script type to right one). This will make run the script always too, regardless the place and with every-frame precision. As you get the final version working, only then will be worth to make it quest script or copy these commands in GameMode block into another one script. Link to comment Share on other sites More sharing options...
Dimitrisgb Posted May 26, 2023 Author Share Posted May 26, 2023 @OblivionAddicted: I would add some checking to not execute Disable or Enable commands at all times. ScriptName DrimitriSGBActivateNightlyNPCScript begin GameMode if GameHour >= 18 || GameHour < 6 if ELSHunbalSpirit.GetDisabled != 0 ELSHunbalSpirit.Enable endif else if ELSHunbalSpirit.GetDisabled == 0 ELSHunbalSpirit.Disable endif endif end He is using ELSHunbalSpirit reference name from ELSHunbal base NPC, if you're wondering why I didn't add Ref suffix to reference ID. Looks like this is working. But I am trying to add the rest of the NPCs and I get mismatching blocks and all that. How exactly can I add them?This is what I wrote: scn ELSJinsAppear begin GameMode if GameHour >= 21 || GameHour < 6 if ELSHunbalSpirit.GetDisabled != 0ELSHunbalSpirit.Enableif ELSAlUzzaSpirit.GetDisabled ! = 0ELSAlUzzaSpirit.Enable endifelse if ELSHunbalSpirit.GetDisabled == 0ELSHunbalSpirit.Disableif ELSAlUzzaSpirit.GetDisabled == 0ELSAlUzzaSpirit.Enable endifendifend Link to comment Share on other sites More sharing options...
RomanR Posted May 26, 2023 Share Posted May 26, 2023 (edited) This way, you should see a pattern: scn ELSJinsAppear begin GameMode if GameHour >= 21 || GameHour < 6 if ELSHunbalSpirit.GetDisabled != 0 ELSHunbalSpirit.Enable endif if ELSAlUzzaSpirit.GetDisabled != 0 ELSAlUzzaSpirit.Enable endif else if ELSHunbalSpirit.GetDisabled == 0 ELSHunbalSpirit.Disable endif if ELSAlUzzaSpirit.GetDisabled == 0 ELSAlUzzaSpirit.Disable ​ endif endif end Similar to others. Edited May 26, 2023 by RomanR Link to comment Share on other sites More sharing options...
Oblivionaddicted Posted May 26, 2023 Share Posted May 26, 2023 You need to create a quest and associate the script to the quest.Don't associate any script to the player. Link to comment Share on other sites More sharing options...
Dimitrisgb Posted May 26, 2023 Author Share Posted May 26, 2023 This way, you should see a pattern: scn ELSJinsAppear begin GameMode if GameHour >= 21 || GameHour < 6 if ELSHunbalSpirit.GetDisabled != 0 ELSHunbalSpirit.Enable endif if ELSAlUzzaSpirit.GetDisabled != 0 ELSAlUzzaSpirit.Enable endif else if ELSHunbalSpirit.GetDisabled == 0 ELSHunbalSpirit.Disable endif if ELSAlUzzaSpirit.GetDisabled == 0 ELSAlUzzaSpirit.Disable ​ endif endif end Similar to others. I get an error message that says "Missing block and keyword" for "else" and "Mismatching block" for "end". Link to comment Share on other sites More sharing options...
RomanR Posted May 26, 2023 Share Posted May 26, 2023 Sorry, I see no error in my post. Did you make your changes right? Link to comment Share on other sites More sharing options...
Dimitrisgb Posted May 26, 2023 Author Share Posted May 26, 2023 The only thing I changed was the hour. Nothing else. Link to comment Share on other sites More sharing options...
Recommended Posts