Jump to content

Papyrus: Menu Teleport Script


Zuhon

Recommended Posts

Before I explain, let me preface the fact that I know sub zero about scripting. Everything within the 'spoiler' was ripped right from the creation kit website.

 

Okay, I'm creating a teleport orb in which if you press E on it, it brings up an options menu asking you to select either cities or towns. If you select cities, it shows all the cities. Towns, the towns. Then if you click on one of those, it will teleport you to the appropriate location. I found something on the creation kit website about sub-menus', which this is, but I don't understand one line of it. Plus, it isn't finished.

 

I would greatly appreciate it if somebody would write/finish this script for me and tell me what to do step by step. For the destinations I'd probably want to use XMarkers', right?

 

Here's the script from the website:

 

ScriptName OptionsMenuScript Extends ObjectReference

 

Message Property MainMenuMESG Auto

Message Property BreakfastMESG Auto

Message Property LunchMESG Auto

Message Property DinnerMESG Auto

 

Event OnRead()

Game.DisablePlayerControls(False, False, False, False, False, True) ; Ensure MessageBox is not on top of other menus & prevent book from opening normally.

Game.EnablePlayerControls(False, False, False, False, False, True) ; Undo DisablePlayerControls

Menu()

EndEvent

 

Function Menu(Bool abMenu = True, Int aiButton = 0)

While abMenu

If aiButton != -1 ; Wait for input (this can prevent problems if recycling the aiButton argument in submenus)

aiButton = MainMenuMESG.Show() ; Main Menu

abMenu = False ; End the function

If aiButton == 0 ; Breakfast

aiButton = BreakfastMESG.Show()

If aiButton == 0 ; Sweet Roll & Coffee

ElseIf aiButton == 1 ; Pancakes, Bacon & Eggs

ElseIf aiButton == 2 ; Chicken Fried Pony Steak

EndIf

ElseIf aiButton == 1 ; Lunch

aiButton = LunchMESG.Show()

If aiButton == 0 ; Glazed Turkey Sandwich

ElseIf aiButton == 1 ; Grilled Ham Sandwich

ElseIf aiButton == 2 ; Shredded Pony Sandwich

EndIf

ElseIf aiButton == 2 ; Dinner

aiButton = DinnerMESG.Show()

If aiButton == 0 ; Filet Mignon

ElseIf aiButton == 1 ; Pony Fajitas

ElseIf aiButton == 2 ; Lobster

EndIf

EndIf

EndIf

EndWhile

EndFunction

 

Link to comment
Share on other sites

  • 2 weeks later...
  • Recently Browsing   0 members

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