eldiabs Posted July 4, 2009 Share Posted July 4, 2009 I have zero scripting knowledge. I have a terminal set up that I am generating weather with. In the same Item Result Script as the forceweather command, I have some lightREF.enable commands. What I would like to do is have those enabled references disable after about 30 in game minutes. I have no idea what to do. The weather is forced, and the references enable, but they stay enabled. Is there a way to set a duration for the enabled refernces in the same Item Result Script? Any help is appreciated. Thank you. Link to comment Share on other sites More sharing options...
BadPenney Posted July 4, 2009 Share Posted July 4, 2009 Set up a timer that begins when the lightREFs are enabled. When it counts down to 0, have the disable commands issued. There are quite a few scripts in Fallout that use timers. You should get a good idea how to make one work by examining them. You'll just need to tweak the timing for the duration that you want. Link to comment Share on other sites More sharing options...
eldiabs Posted July 5, 2009 Author Share Posted July 5, 2009 Thanks for the reply, but it wasn't the answer I was looking for. Note: Zero scripting knowledge. Thank you anyways. I'll ask elsewhere. Link to comment Share on other sites More sharing options...
Skree000 Posted July 5, 2009 Share Posted July 5, 2009 if you have zero scripting knowledge (as i do) what he says, examining existing scripts, is a good way to start learning about scripts.but look elsewhere if you want. typically when people dont get the answer they are looking for they ask again, with more specific details. ie. tell me step by step, every single thing i need to make a script to X, etc. you said zero scripting knowledge but made references to lightREF.enable commands, result scripts, etc etc... so im guessing people assumed you knew the basics. knowing that, telling someone to have a look at existing scripts seems a fair response. i know less than zero then, since i dont know what lightREF.enable commands or result scripts are... lol Link to comment Share on other sites More sharing options...
eldiabs Posted July 5, 2009 Author Share Posted July 5, 2009 Perhaps I should have just said I'm too lazy to learn and then write and re-write my own script, I'd rather play with my legos (insert GECK)? Ahh well, I ended up saying screw it. Not worth the time or effort for me. Here is the final result though... Fort Freeway and the Weather Control Lab Link to comment Share on other sites More sharing options...
Cipscis Posted July 6, 2009 Share Posted July 6, 2009 If you're interested in learning more about the basics of scripting, I've written a beginner's scripting tutorial that you might find useful. You can find a link to it in my signature. Personally, I would use a quest script to achieve this functionality. Quest scripts are convenient in times like this as they run "globally" (as in they don't need to run on a specific reference) and can be started and stopped easily via the StartQuest and StopQuest functions. I would recommend that you create a quest script that uses a timer like the following:float fTimer Begin GameMode if fTimer > 0 set fTimer to fTimer - GetSecondsPassed elseif fTimer; The timer is up lightREF.Disable set fTimer to 10; 10 seconds StopQuest <MyTimerQuest>; <MyTimerQuest> is a placeholder for the EditorID of your quest else; fTimer == 0 set fTimer to 10; 10 seconds endif EndNow, in order to start this timer you can simply use the StartQuest function in your result script. When setting up your quest, you'll want to make sure that it is not start game enabled, and that it has a script processing delay of 0.01, which will ensure that the script runs every frame. One more thing that I'd just like to make sure that you're aware of is that you can reduce the number of Enable and Disable functions that you call by using Enable Parenting, which allows references to be enabled and disabled as a group by assigning one of them as the Enable Parent of the others in the group (the "children). Cipscis Link to comment Share on other sites More sharing options...
eldiabs Posted July 6, 2009 Author Share Posted July 6, 2009 Here I was thinking I was done with this friggin mod for now, and you go and make it so easy for me. I don't have much of an excuse now to fix this the right way do I? Not only that, but you've gone and made a tutorial for beginners as well....damnit...haha. You might just have given me a reason to learn something new. Thank you. I'll go ahead and give this a go. As for the enable parenting, I have just that. I set up an xMarker both indoors and outdoors as a parent to all the necessary lights and fx. Much easier for managing huge numbers of references and way better than adding 30 lines of .disable/.enable to a terminal. ;] Thanks again for the code and the tutorial. Link to comment Share on other sites More sharing options...
eldiabs Posted July 6, 2009 Author Share Posted July 6, 2009 Just a quick reply here. Cipscis - That worked exactly as I needed it to. Thank you for your help. You saved me countless hours of work. I'll make sure to check out your tutorials before asking too many more questions. };] Link to comment Share on other sites More sharing options...
Recommended Posts