madpianist Posted July 11, 2012 Share Posted July 11, 2012 Hi, I am making a Dwemer Arena mod and I need a little help on making things work. I made a spear gate that opens when you press a button. The problem I have is that, i want it so that when you go to press the button to open the gate, the button won't work unless you have a key. I can't figure out how to make the button only work with a key. I want to make it so you can press it and everything but it won't work until you get a key. Can someone explain to me how to do this? I also would like to do a gate that is a solid wall. That way I can spawn enemies behind the wall and then when I open the wall gate they will come out. I want to do this because I do not like the fact that when you spawn an enemy it just appears out of thing air. This way it looks like they are already behind the wall and they gather to come out. It makes it more realistic in my opinion. I have tried a lot of things but I cannot get a solid wall to work as a gate (sink into the ground). Can someone please help me with this or tell me how I would be able to do this? Last I need the help of a someone with experience in scripting. I have tried to create a menu spawning system for my mod but I do not understand scripting and I have absolutely no idea what to do. I have also tried using script resources of spawning creatures or making menus but I, for lack of a better word... suck. Can someone please help me? Thanks for your time. :) Link to comment Share on other sites More sharing options...
gasti89 Posted July 12, 2012 Share Posted July 12, 2012 i can only answer to the 1st. I think you set the gate as the linked ref to the activator. Remove that link. Then go to scripts and add a new script. Key property myKey auto ObjectReference property myGate auto Event OnActivate(ObjectReference akActionRef) if Game.GetPlayer().GetItemCount(myKey) >= 1 myGate.SetOpen() else Debug.Notification("You need the key to open the gate") endif EndEvent Then compile, exit, double click on the script. Click on the properties, edit value and select your stuff. Link to comment Share on other sites More sharing options...
Korodic Posted July 12, 2012 Share Posted July 12, 2012 you too?http://forums.nexusmods.com/index.php?/topic/649696-wip-dwemer-colosseum/ Link to comment Share on other sites More sharing options...
MDXLionHeart Posted July 12, 2012 Share Posted July 12, 2012 (edited) ..... Edited July 12, 2012 by MDXLionHeart Link to comment Share on other sites More sharing options...
steve40 Posted July 12, 2012 Share Posted July 12, 2012 (edited) Creating a menu requires very sound scripting skills. I can point you to some examples on the wiki, but unfortunately the examples are quite confusing for beginners to learn, and you still have to add your own custom functions to the basic code. The link is here. I don't know how to explain to a non-scripter how to create menus, sorry. To make a solid wall sink into the ground, I would think it would need to have a built-in havok animation, or, you could script it to translate into the ground. The other option is to simply disable the wall so it is no longer there. Edit: I've just written a quick-and-dirty script to make a wall sink into the floor. Attach it to your wall, then make the wall the activate target of your switch. (I haven't tested this script yet, btw, so I don't know how well it will work or not). ScriptName WallGate extends ObjectReference Float Property speed = 50.0 auto hidden ; speed of the wall movement, defaults to 50 Event OnActivate(ObjectReference akActionRef) GotoState("done") float aX = GetAngleX() ; stores the wall's X angle float aY = GetAngleY() ; stores the wall's Y angle float aZ = GetAngleZ() ; stores the wall's Z angle ; subtract the wall's height from it's vertical position ; I've subtracted an extra 100% just for good measure float h = Z - GetHeight() * 2 TranslateTo(X, Y, h, aX, aY, aZ, speed, 0) ; sink the wall into the floor EndEvent Event OnTranslationComplete() Disable(true) ; disable the wall with fade effect EndEvent STATE DONE Event OnActivate(ObjectReference akActionRef) EndEvent ENDSTATE Edit: made a small correction. Script compiles.Edit2: I changed the height that the wall drops from 1.2 to 2 times the reported height, because the wall that I tested didn't sink far enough.Edit3: OK, I've tested the script and it works beautifully :thumbsup: :dance: The next step would be to script in a sound effect. Edited July 12, 2012 by steve40 Link to comment Share on other sites More sharing options...
madpianist Posted July 12, 2012 Author Share Posted July 12, 2012 @gasti89: THANK YOU so much! I will try immediately. :) @korodic: Your Mod looks awesome! I will definitely download when you finish. My mod is much simpler arena and it is an addition to an exterior cell. @steve40: THANK YOU! I really appreciate your work! I am trying it right now. :) Link to comment Share on other sites More sharing options...
Recommended Posts