Jump to content

Help with layered menu


Recommended Posts

Hi everyone,

 

I've been trying to create a layered menu, so you activate something, you are presented with a selection of choices, then when you choose one, it gives you more choices. I could do this in Oblivion with Gamemode, but that is gone and everything works differntly... Could anyone help? there was a tutorial somewhere on the internet but I cant find it ANYWHERE now.

 

This is my script so far, the activator works, and when you choose something the second menu appears, but then no matter what you choose there nothing happens which makes me think that the onupdate part of the script is not working.

 

Scriptname AAMBCtestSCRIPT extends ObjectReference  
{Creates Bearpaw Camp, piece by piece.}

Message Property Campingmessage  Auto  
{Dialoge to build tents}

Message Property Strucuremessage  Auto  
{Dialouge to build wooden structures}

Message Property Defencemessage  Auto  
{Dialoge to add defences}

Message Property Utilitymessage  Auto  
{Dialouge to build utilities}

Message Property ChoiceMessage  Auto  
{Dialouge to choose upgrade type}

AAMBcUPGRADEtentSCRIPT property campquestref auto

int button
int level
objectreference lakeside1a
objectreference lakeside1b
objectreference lakeside1c
objectreference lakeside1d
objectreference lakeside1e
objectreference lakeside1f

EVENT OnActivate (ObjectReference akActionRef)
registerForUpdate(5)
if akActionRef == game.getplayer()
level = 0
button = ChoiceMessage.show ()
if button == 0
	level = 1
	button = campingmessage.show (afArg1 = campquestref.Lakesidecamp)	
elseif button == 1
	level = 2
	button = Strucuremessage.show ()
elseif button == 2
	level = 3
	button = Utilitymessage.show ()
elseif button == 3
	level = 4
	BUTTON = Defencemessage.show ()
endif
endif
endEVENT

Event onupdate ()
if level == 1
if button == 0
	if campquestref.Lakesidecamp == 0
		campquestref.Lakesidecamp = 1
		lakeside1a. enable()
		lakeside1b. enable()
		lakeside1c. enable()
		lakeside1d. enable()
		lakeside1e. enable()
		lakeside1f. enable()
		level = 0
	endif
endif
endif
endevent

 

Any help with this or a link to some tutorial would be of great use, I know it can be done as mods like Frostfall use it extensively...

Link to comment
Share on other sites

Yeah you have to scrap the old menumode way. The script pauses just after each Show(), and then continues to process from there when a button is chosen. So it's much easier now.

 

I showed a multilevel menu in this post. All the menu's are in 'while' loops which exits back up to the next level when the user presses button 0.

That way each menu keeps repeating "while iBtn != 0"

 

http://forums.nexusmods.com/index.php?/topic/606255-drop-item-script-not-working/page__view__findpost__p__4837489

Link to comment
Share on other sites

Thankyou, you beautiful man!!! Been stuck on that for hours -_-

 

So weird adjusting from Oblivion, "ref" variables not being there was another nasty suprise... took forever to find out they are now "Objectreferences".

 

I shall try this when I get in later, thanks again- we really need a dedicated script snippet forum, or tutorial forum :P

Link to comment
Share on other sites

  • Recently Browsing   0 members

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