MrNeedles Posted January 9, 2017 Share Posted January 9, 2017 Hi! Does anyone know how to make a script that makes a certain type of enemy only spawn at night in certain places? Any help would be appreciated. Link to comment Share on other sites More sharing options...
Mktavish Posted January 9, 2017 Share Posted January 9, 2017 (edited) http://geck.bethsoft.com/index.php?title=GetCurrentTime Example ... If GetCurrentTime >= 18.0 || GetCurrentTime <= 6.0 MynightCreatures.Enable elseif MynightCreatures.IsInCombat != 1 MynightCreatures.Disable endifendifEnd Edited January 10, 2017 by Mktavish Link to comment Share on other sites More sharing options...
MrNeedles Posted January 10, 2017 Author Share Posted January 10, 2017 Thank you so much, that was precisely what I needed! One question though, wouldn't the script disable the creatures at 6 am. even during battle / while otherwise visible to the player? Link to comment Share on other sites More sharing options...
Mktavish Posted January 10, 2017 Share Posted January 10, 2017 Thank you so much, that was precisely what I needed! One question though, wouldn't the script disable the creatures at 6 am. even during battle / while otherwise visible to the player?Oh ya , your right ... I edited the script above for that contingency. Link to comment Share on other sites More sharing options...
MrNeedles Posted January 10, 2017 Author Share Posted January 10, 2017 Thanks again. If the mod gets released, I'll make sure to give you credit for the script! Link to comment Share on other sites More sharing options...
Mktavish Posted January 10, 2017 Share Posted January 10, 2017 Thanks again. If the mod gets released, I'll make sure to give you credit for the script!Well no need for that ... it's nothing you couldn't of figured out by me pasting the wiki link. So it is working then though ? Just come back if not. Link to comment Share on other sites More sharing options...
MrNeedles Posted January 11, 2017 Author Share Posted January 11, 2017 Sadly it isn't. I cannot even enter and save the script, since every time I try I get the following message: SCRIPTS: Script '(null)' line 2: Script command "00WretchedNight.Enable" not found. Context: DEFAULT "Yes to all" will disable all warnings for this context. Might this have something to do with choosing the wrong script type? Or did I just enter something wrong? I'm sorry for bothering you again, but I have the feeling I couldn't wrap my head around scripting if my life depended on it if I see stuff like that message... Link to comment Share on other sites More sharing options...
Mktavish Posted January 12, 2017 Share Posted January 12, 2017 (edited) Sadly it isn't. I cannot even enter and save the script, since every time I try I get the following message: SCRIPTS: Script '(null)' line 2: Script command "00WretchedNight.Enable" not found. Context: DEFAULT "Yes to all" will disable all warnings for this context. Might this have something to do with choosing the wrong script type? Or did I just enter something wrong? I'm sorry for bothering you again, but I have the feeling I couldn't wrap my head around scripting if my life depended on it if I see stuff like that message... There may be another problem ... but the glaring obvious problem is "00WretchedNight.Enable" Using numbers as the prefix to any form-ID is the problem ... they do work for somethings , but scripts in particular cannot work with them. So as a rule of thumb ... never use them. It's not a point that is well publicized ... many people have done and still do it ... I myself was doing it for about year , till it reared its ugly head and some searching informed me of the problems. So don't feel dumb for having done it. Edited January 12, 2017 by Mktavish Link to comment Share on other sites More sharing options...
MrNeedles Posted January 12, 2017 Author Share Posted January 12, 2017 Good to know! I'll rename all my new creatures and NPCs, then - just to make sure. Link to comment Share on other sites More sharing options...
MrNeedles Posted January 14, 2017 Author Share Posted January 14, 2017 Sorry for bothering you again, just wanted to let you know that I got a slightly modified version of your original script to work which goes like this: SCN WretchedNightspawnSCRIPTBEGIN GameModeIf GetCurrentTime >= 18.0 || GetCurrentTime <= 6.0 WretchedNightspawn1.Enable elseif WretchedNightspawn1.IsInCombat != 1 WretchedNightspawn1.Disable endifendifEnd Unfortunately though, this script only works for a single, unique RefID, while my idea was to place various leveld creatures in the gameworld and make them spawn at night close to the subway entrances. Do I have to make a script for each reference now, or include each reference in the script? Is there an easier way? Link to comment Share on other sites More sharing options...
Recommended Posts