Jump to content

Need help with script/terminal


eldiabs

Recommended Posts

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

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

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

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

End

Now, 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

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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...