d4em Posted April 8, 2011 Share Posted April 8, 2011 Hi,I made a script that's supposed to turn light beams and light bulbs on/off according to the game time: begin gamemode if gamehour >= 6 && gamehour < 8 enable elseif gamehour >= 8 && < 6 disable endifend I then applied the script to said items, and went to test it ingame, but both stay "on".Does anyone know what I did wrong? Link to comment Share on other sites More sharing options...
TehBuddha Posted April 8, 2011 Share Posted April 8, 2011 There arent any references after the "Enable" and "Disable" commands. You need to make an xMarker (Or oblivions equivelant, Im going from Fallout knowledge here) and name it something like "LightsMarker", then go through each of your lights and set the "Enable Parent" as the marker. Once you've done that, edit your script to look more like this. Scriptname LightsCycle begin gamemode if gamehour >= 6 && gamehour < 8 LightsMarker.enable elseif gamehour >= 8 && gamehour < 6 LightsMarker.disable endif end Just making sure, but you did give the script a name, right? If not, stick "Scriptname LightsCycle" Or something similar, but keep "Scriptname" at the beginning."Also, you forgot to add in the second "Gamehour" variable on line four. Link to comment Share on other sites More sharing options...
fg109 Posted April 8, 2011 Share Posted April 8, 2011 (edited) There's already a mod that does sort of what you want. I don't remember the whole name but it's abbreviated AWLS. As for your script, the problem is in your elseif condition. The game hour can't be more than 8 and less than 6 at the same time! Use "||" instead of "&&". Or actually, don't put a condition at all and just leave it as "else". EDIT: Wait, I see what you're trying to do. The game counts the day in a single 24 hour cycle, not two 12 hour cycles. So your first condition should be if GameHour >= 18 || GameHour < 8 and your elseif condition should have been elseif GameHour >= 8 && GameHour < 18 Edited April 8, 2011 by fg109 Link to comment Share on other sites More sharing options...
d4em Posted April 8, 2011 Author Share Posted April 8, 2011 Thanks for both of your help, kudo'ing you as i type @fg, I know of AWLS, but this is a personal house mod, and the lighting is for the interior :) Link to comment Share on other sites More sharing options...
TehBuddha Posted April 8, 2011 Share Posted April 8, 2011 Happy to help ^^ And I didnt notice that Fg :pinch: Link to comment Share on other sites More sharing options...
Recommended Posts