PBalfredo Posted September 17, 2012 Author Share Posted September 17, 2012 (edited) OOOOOOOH! I have to define it from the Edit Properties menu! I kept thinking they meant defining the variable in the script itself, so I kept trying to do so. This solves so many of my problems. Not just this one, but other one's I've been having as well. Thank you so much! Problem solved! Edited September 17, 2012 by PBalfredo Link to comment Share on other sites More sharing options...
assterixxx Posted September 17, 2012 Share Posted September 17, 2012 This feels nice! *shines halo* Link to comment Share on other sites More sharing options...
steve40 Posted September 17, 2012 Share Posted September 17, 2012 (edited) Yep, global variables are defined in the CK, so they have to be passed into the script via a Property in the script AND then link it using the Properties button.I didn't know that the GameHour variable could be changed though, I assumed it was read-only. That's handy to know.Presumably (if the wiki's correct) there's also a global called "TimeOfDay" or "TimeOfDayGlobal" that could be used, but I haven't checked in the CK, so I can't confim it.Glad you got it solved :thumbsup: Edit: I finally got around to checking the CK. The correct global variable for Skyrim is "GameHour". There's no "TimeOfDay" variable in Skyrim so the wiki needs to be updated. The latter is the name used in the Gamebryo engine only. Edited September 26, 2012 by steve40 Link to comment Share on other sites More sharing options...
assterixxx Posted September 17, 2012 Share Posted September 17, 2012 @Steve40 The "GameHour.Mod(Time01)" does add X time to the time of day, but I haven't yet figured out how to get all those temp buffs / vamp hunger to progress to tho. As it stands it ONLY affects the in game time. Link to comment Share on other sites More sharing options...
doctorhr2 Posted September 17, 2012 Share Posted September 17, 2012 Can I just ask, what happens to the player if they are still in the castle at dawn? Link to comment Share on other sites More sharing options...
PBalfredo Posted September 17, 2012 Author Share Posted September 17, 2012 A message comes up saying the castle fades away, then I teleport the player to a copy of the castle exterior, except the castle is gone and there is only a crater where the foundation was. Link to comment Share on other sites More sharing options...
doctorhr2 Posted September 17, 2012 Share Posted September 17, 2012 Can I just ask, what happens to the player if they are still in the castle at dawn? Interesting idea. Would any creatures you have killed respawn when the castle reappears? Link to comment Share on other sites More sharing options...
Sjogga Posted September 18, 2012 Share Posted September 18, 2012 Try this: Scriptname castleScript extends objectreference Globalvariable Property isInstalled auto ; create a custom short global in your mod, set value to 1 globalvariable Property currentHour auto Int Property appearHour = 19 auto Int Property vanishHour = 7 auto Event onInit() RegisterForSingleUpdate(5) EndEvent Event onUpdate() If(isInstalled.getValueInt() != 1) Return endif If( currentHour.getValueInt() > appearHour || currentHour.getValueInt() < vanishHour) Self.enable() Else ;do not implement some sort of teleport function Self.disable() Endif RegisterForSingleUpdate(5) EndEvent Attach to ever object you want to disappear.Create a similar script to handle the teleport function, then attach it to a sepparate object. Link to comment Share on other sites More sharing options...
steve40 Posted September 26, 2012 Share Posted September 26, 2012 Try this:Attach to ever object you want to disappear.Create a similar script to handle the teleport function, then attach it to a sepparate object. @Sjogga: the trick you're trying to do with the global variable to block the OnUpdate from running when the esp is deactivated won't actually work like that. I know that it is suggested in the Beth forums to do it that way, however, I've tested it and what actually happens is that getvalueint() will return a "none variable" kind of error. Then it will give a "this function will not be executed" type of error and the IF statement will be skipped so it will not stop the script. What you need to do is test for "isInstalled.GetValueInt() == 1" and then put all the good code INSIDE the IF statement :) Secondly, running an OnUpdate every 5 seconds isn't very nice. Why not calculate how long you need to wait from current time to enable/disable time, then simply use RegisterForSingleUpdateGameTime so that you only need to run ONE update call instead of a repetitive loop :) Lastly, I think it would be prudent to check if the castle is already enabled or disabled so that the script won't repetitively keep enabling a castle that is already enabled and vice versa :) Link to comment Share on other sites More sharing options...
Recommended Posts