Having NorPuzzlePillar Activate lights when at solved state

Post » Fri Jun 22, 2012 1:13 am

ok, so here is the set up. I have added a pillar puzzle to my dungeon, and it works perfectly (thanks to a tutorial i found online). But me being me, I am not satisfied with just adding the head with the symbol to show which sign each pillar should be. So I decided it would be cool to have a wall sconce behind each pillar and when the pillar is in the correct position I enable a light and some embers and disable an ash pile. Then, when the pillar is in the wrong position I disable the light and embers and enable just an ash pile.

Here is the problem. I have no clue what I am doing really. My plan is this, attach a script to each pillar that checks if the pillar is in the solved state set in the pillar script. If it is then enable things, if it isn't then disable them.

So I have this:
Scriptname OAQ01PuzzlePillarLightSwitch extends ObjectReference  ObjectReference Property SlovedLight AutoObjectReference Property HeavyEmbers AutoObjectReference Property NoEmbers Autoif (solveState ==  true)    SlovedLight.Enable()    HeavyEmbers.Enable()    NoEmbers.Disable()else    SlovedLight.Disable()    HeavyEmbers.Disable()    NoEmbers.Enable()endif

Now, I have no clue about how to go about if the pillar actually is in the solved state. solveState is the variable from the main pillar script form Bethesda. I am also getting an EOF error for the if statment when I try and save. Which of course I expected seeing as how i have nothing pointing to that variable yet. So, how can I see if the pillar is in the solved state? If only I were a scripting person and not a visual design person...

Thanks for any and all help.
User avatar
jasminε
 
Posts: 3511
Joined: Mon Jan 29, 2007 4:12 am

Post » Thu Jun 21, 2012 8:44 pm

This won't work because all code has to go inside an event (or a function that is called by an event). If you look at the source of the defaultPuzzlePillarScript (which I guess you are using ) you will see a function (RotatePillarToState) that is called from two events, OnCellLoad and OnActivate. These events are where everything happens.

You will see in the OnCellLoad event, and the RotatePillar function, lines setting pillarSolved = true and pillarSolved = false. If you make a new script and copy into it the default script's code, your enabling and disabling code could go after these lines. (It would be nicer to put them into a function, and call the function after these lines.)
User avatar
Stacey Mason
 
Posts: 3350
Joined: Wed Nov 08, 2006 6:18 am


Return to V - Skyrim