Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Multiple Activators and a Main Script


DsoS
 Share

Recommended Posts

If I have X activators (For ease, we'll say 4 for this script) (buttons, valves, etc.) that I want to use to activate a script that is on another object (probably just a static cave rock), how do I setup the activators and the main script to work together?

 

Would I need a script for each activator, global variable or what?

The script what Event function would I use to do this? Would it still be a OnActivate event?

 

I have not created a script where I have used multiple activators to do what I want to do.

 

If any other information is required, just let me know.

 

EDIT:

Forgot to mention, that ALL X activators will be required to be activated before the script is finished.

 

Thanks,

DSoS

Edited by DsoS
Link to comment
Share on other sites

I just use a main script attachted to an x-marker. That water level I made that you saw, requires two valves to be opened first. Example script:

 

 


Scriptname WMWaterlv extends ObjectReference
{Script to determine if both valves are closed or open and do stuff}


ObjectReference Property Valve1 Auto
ObjectReference Property Valve2 Auto
ObjectReference Property ThingToEffect Auto



int Value1
int Value2
int ThingHappened
;Names values for state of valves later

Event OnCellLoad()
Value1 = 0
Value2 = 0
ThingHappened = 1
EndEvent

Event OnActivate(ObjectReference akActionRef)
If akActionRef == Valve1
If Value1 == 1
Value1 = 0
ThingHappened.Whatever()

Elseif Value1 == 0
Value1 = 1
ThingHappened.Whatever()
EndIf

Endif

If akActionRef == Valve2
If Value2 == 1
Value2 = 0
ThingHappened.Whatever()

Elseif Value2 == 0
Value2 = 1
ThingHappened.Whatever()
EndIf

Endif

If Value1 == 1
If Value2 == 1
Place stuff to happen when all levers are pushed

Endif

Elseif Value1 == 0
If Value2 == 0
Put stuff to happen when all levers are not pushed
Endif
Endif
EndEvent

 

can easily be expanded to include alternate states, more levers, sound effects and multiple outcomes. And yes there is most likely a shorter way but I dont know it

Link to comment
Share on other sites

You know...

 

I feel really, really stupid looking at your script :(

 

I think I need to get some good sleep.

 

I have done this before, a bit different. Just have to find that script now amongst several dozen other scripts of mine.

 

Thank You Walrus. :pints: It is a starting point!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...