Jump to content

Need Help with Scripting!


raven1645

Recommended Posts

Hiya,

I introduced myself to the Creation Kit about half a week ago and I really enjoy it. I'm currently making a massive dungeon, consisting out of 2 cells. However I ran into a few problems:

1. I want to be able to use a rowboat rather than a door to go from cell 1 to cell 2. So rather than to click on a door, create a trigger box on the boat that is the parent of the door, and when you click the trigger box, you will load to the other cell. Since the door is an activator, I thought that by adding the "simple lever base" to the trigger box, it should open the door when I click it, and trigger the teleport to the other cell. It didn't work. I could hear the door opening in the distance when I clicked the trigger box, but the teleport wasn't triggered and my character stayed put.

So then I tried adding a script to the trigger box from the Creation Kit site which is called "creating a simple toggle":

Creating a Simple Toggle

ScriptName SimpleToggle Extends ObjectReference

Bool bToggle

Event OnActivate(ObjectReference akActionRef)
bToggle = !bToggle ; Set Bool to whatever it's not
If bToggle ; True
; Do stuff
Else ; False
; Undo stuff
Endif
EndEvent

To make this script work: Attach this script to an activator such as a button, lever, or container.

Still didn't work. However, I wasn't sure how to add it as a script, since I've never done it before. First I copy/pasted the entire thing into the script box, but later I noticed it said ScriptName at the top, so I added that, and the Extend thingy, to the appropriate boxes in script creatior, and removed them from the script box. But I'm still unsure.

So question 1.1: Which parts of this script should be in the script box, which parts should be removed or added to other boxes in the script creator, and what not, to make this script work?

Question 1.2: This still probably wouldn't work even if I pasted it the right way, since the lever thing didn't work either. So does anyone have an idea how I could create an activator on the boat that would teleport me to the other cell?

2. Next, I wanted to make a hallway, that you could look in to, but not walk in to. I wanted it to display the debug message "You cannot go that way" that would also display in game. So I Googled it since I wouldn't know how to write that script myself and I found one thing on the nexus forums. Someone wanted the exact same thing, and another guy replied:

"You can use a collision box to block the player and a trigger box for a "You cannot go this way" message. With the trigger box positioned slightly in front of the collision box add a script to the trigger box like this:



Scriptname OutofBoundsScript extends ObjectReference

 

Event OnTriggerEnter(ObjectReference akActionRef)

If(akActionRef == Game.GetPlayer()) 

Debug.Notification("You cannot go this way")

Endif

EndEvent

"

The guy who originally asked the question, said it worked like a charm. However, for me, it did not quite. The collision box worked (obviously), but no message displayed. Likely I did the same thing wrong as with the simple toggle script, that I placed the wrong parts of the script in the wrong parts of the script creator.

Question 2: What should I do to create this message and where should all the parts of the script go within the script creator?

Thanks for reading, if you could answer either of these questions I would be really grateful.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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