Dwemer Lexicon Cube and Stand

Post » Thu Jun 21, 2012 8:48 am

Hi all, I'm having a bit of a problem. I'm completely new to scripting, so I'm hoping maybe someone can help me out here.

I have four things: A Dwemer lexicon cube, A lexicon stand, a Dwemer button, and a pole gate. (I made new forms of all of these except the pole gate). What I want is to have the button start off in a closed/disabled state (I just need to check the "starts disabled" box in the edit window, right?) and have it become enabled when the cube is placed on the cube stand. The button then lowers the pole gate when activated (I've got the button/pole gate part working).

1. What do I need to do to get the cube to be removed from my inventory and placed on the stand when I activate the stand in-game?

2. How do I get it so that when the cube is on the stand, the button is enabled, and becomes disabled again if the cube is removed from the stand?

Any help would be greatly appreciated. Thanks.
User avatar
Fluffer
 
Posts: 3489
Joined: Thu Jul 05, 2007 6:29 am

Post » Thu Jun 21, 2012 9:21 am

I can show you how the lexstand works as it relates to the lexcube and the player inventory. The script below will check if the player has the cube and if so it with trigger the stand to enter its animation and remove the cube from the player inventory. Since the lexicon stand has a cube in its own animation it just needs to be deleted from the player inventory.

There are actually 4 animations for the stand and this just uses 2. The second listed below I believe is correct to show the stand open but without the cube. The first will show the cube being setdown on the stand. The other two would close the stand with the cube in it and close it without the cube in it. If I remember correct.

Hope this helps

Scriptname Your_LexiconStand extends ObjectReference;========;;PROPERTIES;========ObjectReference Property YourLexiconCube  Auto{Set this property to the cube marked for this stand};=====;;STATES;=====Auto State Phase1  Event onActivate(objectReference triggerref)	debug.trace ("Player Activated Cube Stand")  if triggerref.getitemcount(Yourlexiconcube) > 0   playAnimation ("Setdown")   TriggerRef.RemoveItem(YourLexiconCube)   goToState("Phase2")  endifendEventEndStateState Phase2Event onActivate(objectReference triggerref)	debug.trace ("Player wants the Cube Back")   playAnimation ("Open")   TriggerRef.AddItem(YourLexiconCube)   goToState("Phase1")endEventEndState
User avatar
Cccurly
 
Posts: 3381
Joined: Mon Apr 09, 2007 8:18 pm

Post » Wed Jun 20, 2012 5:16 pm

Sorry it took me so long to reply to this, and thank you for the script. Life got in the way, and it's taking me a while to learn the basics of scripting.

So, here's the setup: I have three lexicon stands (each is a different form; i.e. minzlexstnd01, minzlexstnd02, minzlexstnd03), and three cubes (also different forms; minzcube01, minzcube02, minzcube03). I had the lexstands set with both an activate sound and a looping sound: I'm only mentioning this because something really odd happened. I attached your script to minzlexstnd01 and all three cubes. Then I started a new game and played through my mod.

Minzlexstand01 (the one with the script) was invisible. Minzlexstand02 continually played the looping sound but did nothing else, even when I tried to activate it. Minzlexstnd03 did not play the looping sound, but played the activate sound when I activated it and -- lo and behold -- the cube was placed on that stand! I couldn't pick it up after that, but when I tried it popped open! Yes, it was exciting.

I'll continue experimenting, unless someone has some suggestions or knows what's going on.

Anyway, thanks again, and I'll certainly credit you for the script when I eventually release my mod.

Wolf
User avatar
Enie van Bied
 
Posts: 3350
Joined: Sun Apr 22, 2007 11:47 pm


Return to V - Skyrim