Jump to content

Messagebox Madness


BadPrenup

Recommended Posts

Ok so basically what I am trying to do is make a messagebox for my pet that has 5 options:

 

Rename :Open another Menu that allows you to rename your pet. See Below

Follow :Forces the pet to follow the player

Wait :Forces the pet to stay still until the player tells it to follow

Access Inventory :Opens the Pet's Inventory

Nothing :Closes the Menu

 

I can get the initial menu to work fine, and the onse that I Bolded work fine. But I cannot for the life of me come up with a script that will allow me to access the pet's inventory. I figured just make a dummy container and have the player access that instead because the player isn't going to know the difference. So I made a line that SHOULD have accessed the dummy container (player.activate refcontainer), but it doesn't activate it.

 

As for the Rename submenu, I followed the CS Wiki's messagebox tutorial (The part at the bottom about menus in menus) I basically want it to show up upon selecting Rename. I followed the tutorial to the letter, but cannot get a submenu to work ever.

 

If you want to see a script just ask, I don't want to show it unless you ask, otherwise it looks like I'm just saying "Fix my scripts cause I'm a CS noob"

Link to comment
Share on other sites

Ok after carefully evaluating my script I concluded that everything I had learned about messagebox from the CS wiki was total bull. I cut out all the crap that it told me to add on and voila, it opens to the second menu when I select rename. So that part works, but I can't get any of the buttons on the second menu to work. no matter what one I click it closes the menu and doesn't rename the pet. I wanted to see if it even processed that part by using message "Script is functioning" at each choice to see if that showed up. it did not, so i cut that out and am stuck again
Link to comment
Share on other sites

Well, without the script it's kind of hard to know what you're doing wrong in the first place. Throw it up and should be easier to help you, rather than list off a bunch of stuff you may have already tried.
Link to comment
Share on other sites

scn AAPetScript1

short Exit1
short KeepUp
short Choosing
short Choice
short Choice2
short Working

Begin OnActivate
set KeepUp to player.getAV Speed	; 
set KeepUp to KeepUp*.75			; These Lines are to keep the pet moving at close to the player's Speed
AAFrosty.SetAV Speed KeepUp		; 
Set Working to 1
Set Choosing to -1
endif
End


Begin GameMode
	If Choosing == -1
		MessageBox "Your Pet Atronach awaits your orders.", "Rename", "Follow", "Wait", "Access Inventory", "Nothing"
		Set Choosing to 1
		Set Choice to -1
	ElseIf (Choosing == 1)
		If (Choice == -1)	;no Choice
			Set Choice to GetButtonPressed
		ElseIf (Choice == 0)	;Rename
			Set Choosing to -11	;Opens Rename Menu
			Set Choice to -1
			Set Choice2 to -1
		ElseIf (Choice == 1)	;Follow
			StopWaiting AAPetFollowPack
			Set AAPetQuest.AAPetFollow to 1
		ElseIf (Choice == 2)	;Wait
			Wait AAPetFollowPack
			Set AAPetQuest.AAPetFollow to 0
		ElseIf (Choice == 3)	;Inventory
			Player.Activate AAPetContainer
		ElseIf (Choice == 4)	;Nothing
			Set Choosing to 0	;closes menu
			Return
		EndIf
	ElseIf (Choosing == -11)
	MessageBox "What do you want to rename him?", "Frosty", "Snowball", "Slushers", "The Blizzard King", "Avalanche", "No Name", "Go Back"
	Set Choosing to 11
	Set Choice2 to -1
	Return
	If (Choosing == 11)
		If (Choice2 == -1)
		Set Choice2 to GetButtonPressed
			if (Choice2 == 0)
				AAFrosty.SetActorFullName "Frosty"
				Message "Your Frost Atronach's name is now Frosty"
				Set Choosing to -1
				Set Choice to -1
			Elseif (Choice2 == 1)
				AAFrosty.SetActorFullName "Snowball"
				Message "Your Frost Atronach's name is now Snowball"
				Set Choosing to -1
				Set Choice to -1
			Elseif (Choice2 == 2)
				AAFrosty.SetActorFullName "Slushers"
				Message "Your Frost Atronach's name is now Slushers"
				Set Choosing to -1
				Set Choice to -1
			Elseif (Choice2 == 3)
				AAFrosty.SetActorFullName "The Blizzard King"
				Message "Your Frost Atronach's name is now The Blizzard King"
				Set Choosing to -1
				Set Choice to -1
			Elseif (Choice2 == 4)
				AAFrosty.SetActorFullName "Avalanche"
				Message "Your Frost Atronach's name is now Avalanche"
				Set Choosing to -1
				Set Choice to -1
			Elseif (Choice2 == 5)
				AAFrosty.SetActorFullName "Pet Frost Atronach"
				Message "Your Frost Atronach's name is now Pet Frost Atronach"
				Set Choosing to -1
				Set Choice to -1
			Elseif (Choice2 == 6)
				Set Choosing to -1
				Set Choice to -1
			EndIf
		EndIf
	EndIf
EndIf
End

Link to comment
Share on other sites

Instead of using your Choosing variable twice try splitting it up.

 

Short Choosing1
Short Choosing2

 

and so on for each time you need it. I'd still have a function in the script to change Choosing (like what you have now under the rename) but add the second choosing variable in that same part of your block.

Link to comment
Share on other sites

well the choosing variable just switches between the menus, which I don't have a problem with. The problem lies in the fact that my Rename submenu refuses to acknowledge a GetButtonPressed function, regardless of if I use the same Choice variable or a Choice2 variable. I can't seem to get the GettButtonPressed function to reset so it can be used in the submenu

 

according to the CS wiki page on GetButtonPressed the first time it is used in a menu it works, but is -1 from then on, but I see it done all the time and can't see any difference between their mods and mine I go through the scripting bit by bit

Link to comment
Share on other sites

  • Recently Browsing   0 members

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