Jump to content

Scripting Tips ? How to disable several references at once.


ChrissyMcp

Recommended Posts

So I've been messing around with the GECK for a couple of hours now working on my mod. What I want to do is edit a certain location if a few variables have been completed. I want to make Nellis AFB empty of Boomers and full of prospecters and scavengers. I went about doing this with a script that is enabled when I leave a certain room (the interior where you are shown the slideshow after the Hoover Dam battle) and checking if two NPCs were dead, Pearl and Loyal. Then I wanted one of these variables to be met (VStoryState == 61) (VStoryState == 62) (VStoryState ==63) (VStoryState == 64), but the problem is that I don't know how to put the "or" in the script, I wanted the script to work like this :- (VStoryState == 61) or (VStoryState == 62) or (VStoryState ==63) or (VStoryState == 64). It didn't work. So now I am asking a more experienced modder on here to tell me where I went wrong.

 

What I think I done wrong is that the "or" isn't a proper function and that there is an alternative to it.

 

Also, I would like to know how to disable several references at once, like Disable

REF1

REF2

REF3....etc

 

Thanks for taking the time to read this. http://forums.nexusmods.com/public/style_emoticons/dark/biggrin.gif

 

Edit:

 

Forgot to post an example of my script so far http://forums.nexusmods.com/public/style_emoticons/dark/tongue.gif

 

 

scn BoomersEndStatesScript

[/url]

Begin OnTriggerLeave (Trying to find the REF for interior)

if (NellisPearl.GetDead == 1), if (NellisLoyal.GetDead == 1), if (VStoryState == 61) or (VStoryState == 62) or (VStoryState ==63) or (VStoryState == 64)

Disable Boomer00F Boomer01F etc...

End

 

(Script is not yet fully complete)

 

 

 

Edited by chrissy_M_
Link to comment
Share on other sites

Search for 'enable parent'.

Give all your refs a single enable parent (must be persistent). Then enabling/disabling that parent will do the same to everything that's parented to it. There is also a tick box to do the opposite, so enabling the parent will disable its children and vice versa.

 

Use | for or function in a script, but you probably jsut want to do

 


if VStoryState > 60 && VStoryState < 65
   dostuff
endif

 

or something like that, assuming you want the same thing to happen for all those states.

Edited by Quetzlsacatanango
Link to comment
Share on other sites

Search for 'enable parent'.

Give all your refs a single enable parent (must be persistent). Then enabling/disabling that parent will do the same to everything that's parented to it. There is also a tick box to do the opposite, so enabling the parent will disable its children and vice versa.

 

Use | for or function in a script, but you probably jsut want to do

 


if VStoryState > 60 && VStoryState < 65
   dostuff
endif

 

or something like that, assuming you want the same thing to happen for all those states.

 

Forgot about the < and > functions (basic mathshttp://forums.nexusmods.com/public/style_emoticons/dark/unsure.gif ).

 

So if I want to have a variable to activate that is going to be met between two numbers I write: if Variable > 10 && Variable < 15. Do this.

 

Thanks, you just helped me learn some scripts http://forums.nexusmods.com/public/style_emoticons/dark/biggrin.gif really appreciate it !

 

 

 

Link to comment
Share on other sites

Assuming it only needs to be enabled once, I like to just compare to the enable state of the enable parent object. So then it'd be something like

if (enableParentREF.GetDisabled)
enableParentREF.Enable
endif

GetDisabled, for reference. Also note that for functions that return 1 or 0, so long as you're looking for the true value, an If statement will only return true if the value is 1. So you don't have to explicitly check for == 1.

 

You could put that inside your check for the quest stage, or have it controlled by something else. How exactly you do it depends on what you want to do with the objects.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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