Menu Scripts... again.

Post » Tue Jun 19, 2012 6:37 pm

Okay, so I've got down my original menu. BUT, I now need help with making a menu script open up another menu.

Let me explain:
I have the first menu (SMMdwemerMain).
It has, right now, one button: "Craft".
That is supposed to open up another menu (SMMdwemerCraft), but I can't get that to work.
That menu has one button: "Dwemer Automaton Servant"
And this button opens up, you guessed it, another menu (SMMdwemerServantCraft)
The rest of the script I can work out just fine, but it's these parts I can't do...
Any help is greatly welcome!

P.S.
This is still for my new house I'm making under Solitude. Soo... y'know... thanks for reading.



EDIT: Oh, wait, I think I've got it. But I have a different question: How do I end a script from within itself? Like have an "Exit" button?

~L
User avatar
Alisia Lisha
 
Posts: 3480
Joined: Tue Dec 05, 2006 8:52 pm

Post » Tue Jun 19, 2012 12:40 pm

Just a quick guess (i'm not a scripter).. make it change state? sounds too obvious to be correct lol
User avatar
Andrew Tarango
 
Posts: 3454
Joined: Wed Oct 17, 2007 10:07 am

Post » Tue Jun 19, 2012 8:14 am

Actually, I guess telling a messagebox to do nothing makes it close itself. But thanks!

I seem to have run across another probelm, though:
How might I make an object be enabled?
...
After testing... I realize I have a fatal mistake. I mean, servants aren't supposed to try to kill you, right? Crap.
User avatar
Charlie Ramsden
 
Posts: 3434
Joined: Fri Jun 15, 2007 7:53 pm

Post » Tue Jun 19, 2012 5:54 am

We don't know what Object or how it is disabled.
Maybe make the script use enable/disable the object or actor.

We don't know exactly what you are trying to do and how but, you created a servant that you control via menu, and he attacked you? that must be Faction related or is he frenzied or something?
User avatar
Kaley X
 
Posts: 3372
Joined: Wed Jul 05, 2006 5:46 pm

Post » Tue Jun 19, 2012 4:19 am

if something?.GetDisabled
something?.Enable

maybe something similar to that (as i mentioned, i'm not a scripter.. i'm trying to help caus no one else is :P)
User avatar
Kaylee Campbell
 
Posts: 3463
Joined: Mon Mar 05, 2007 11:17 am

Post » Tue Jun 19, 2012 7:26 am

Firstly, thank you for helping.

Secondly, Sorry that I haven't been replying, I was retesting...

Anyways, I'm making a Dwarven Sphere servant. I had to replace the original model that I was using with the Malfunctioned model (the included one that I can edit).
Also, I have the enable/disable thing down now, I just can't get the script to let me remove the items. Here's my code:

Spoiler

Scriptname SMdwemerCraftScript extends ObjectReference {Script that allows you to make certain Dwarven items using other Dwarven items, and some other stuff.}Message Property MainMenu auto{First menu when the button is activated}Message Property CraftMenu auto{Crafting menu that shows what you can craft}Message Property DwemerServantMenu auto{Menu that shows information about crafting the Dwemer Servant.}  Event OnActivate(ObjectReference akActionRef)    Int MainM = MainMenu.Show() If (MainM != -1)  If (MainM == 0)   Int CraftM = CraftMenu.Show()   If (CraftM != -1)	Int DwemServM = DwemerServantMenu.Show()	If (DwemServM != -1)	 If (DwemServM == 0)	 	 ElseIf (DwemServM == 1)	  Player.RemoveItem ArmorDwarvenGauntlets 1	  Player.RemoveItem DwarvenSword 1	  Player.RemoveItem DwarvenCog 3	  Player.RemoveItem DwarvenPlateMetalLarge 2	  Player.RemoveItem IngotDwarven 2	  If (GetItemCount(SoulGemCommon) != 0)	   Player.RemoveItem SoulGemCommon 1	  Else	   Player.RemoveItem SoulGemCommonFilled 1	  EndIf	  SMMhouseServant.enable	 EndIf	EndIf   EndIf  EndIf EndIf endEvent
User avatar
Eoh
 
Posts: 3378
Joined: Sun Mar 18, 2007 6:03 pm

Post » Tue Jun 19, 2012 6:17 am

ur missing Player.AddItem(s)? so it will remove the servants items and add items to you?
User avatar
Nikki Lawrence
 
Posts: 3317
Joined: Sat Jul 01, 2006 2:27 am

Post » Tue Jun 19, 2012 8:45 am

Ok, I know my mistakes now.
Phew.
I've fixed the code. When it's done, I'll post.
Thanks for trying, though!

~L
User avatar
JLG
 
Posts: 3364
Joined: Fri Oct 19, 2007 7:42 pm

Post » Tue Jun 19, 2012 6:29 am

ur missing Player.AddItem(s)? so it will remove the servants items and add items to you?

Actually, you can't activate the message without the items. It's sortof like you craft him.
And you need him to be made if you want the place to ever be decorated. It starts off really empty.
User avatar
Hairul Hafis
 
Posts: 3516
Joined: Mon Oct 29, 2007 12:22 am

Post » Tue Jun 19, 2012 5:24 am

ah right, well at least you're getting somewhere.
User avatar
Strawberry
 
Posts: 3446
Joined: Thu Jul 05, 2007 11:08 am

Post » Tue Jun 19, 2012 7:06 pm

Ah, crap. Still can't remove the items.
Why doesn't
Game.GetPlayer().RemoveItem(ArmorDwarvenGauntlets, 1)
work?
The compiler comes up with
variable ArmorDwarvenGauntlets is undefined
Why? That's the editor ID... and the Hexadecimal ID won't work, either.
User avatar
Antony Holdsworth
 
Posts: 3387
Joined: Tue May 29, 2007 4:50 am

Post » Tue Jun 19, 2012 12:00 pm

is it missing a Message Property?
User avatar
barbara belmonte
 
Posts: 3528
Joined: Fri Apr 06, 2007 6:12 pm

Post » Tue Jun 19, 2012 8:26 am

No, it's not that...
Argh. I dunno. The official wiki doesn't help, because the only example it shows is
Game.GetPlayer().RemoveItem(GoldBase, 50)
and I can't seem to find out what the heck "GoldBase" is...

EDIT:
By that, I mean that I can't find it on the editor. I know that it's supposed to be the Gold item, but the RefID for GOld is Gold001.
User avatar
Danielle Brown
 
Posts: 3380
Joined: Wed Sep 27, 2006 6:03 am

Post » Tue Jun 19, 2012 10:08 am

is it missing if akActionRef == game.getPlayer() ?? i'm just guessing now, probably not helping
User avatar
Nina Mccormick
 
Posts: 3507
Joined: Mon Sep 18, 2006 5:38 pm

Post » Tue Jun 19, 2012 6:54 pm

You need to create a property for the item you want removed. Remember, because Papyrus scripts are separate to the esp, they need a property to point to anything outside themselves.

So you'd need properties for each of the items, just like you have for the messageBoxes in your menu.
Or you could simplify it by creating a Formlist containing all the items, create a property pointing to the FormList, and then use the formlist in the .Remove - it will remove all the items in the formlist from your inventory.


Edit: as for 'GoldBase' - I assume that's meant to be a property defined in some other part of the imaginary example script, and that it points to the Gold001 base object.
Yup - they could have made things a bit clearer - it took me a few nights of tearing my hair out and re-re-reading the wiki and scripts in the CK to get any sort of a handle on it.
User avatar
Sophie Morrell
 
Posts: 3364
Joined: Sat Aug 12, 2006 11:13 am

Post » Tue Jun 19, 2012 11:18 am

Ok, so I've finished the hardest part. I had to change ALL of the variables to Properties.
Now, I just need to know ONE THING:
Can you make a character Essential, Invulnerable, Starts Off Dead, and then resurrect them?
Because it's not working for me.

EDIT:
Wow. I feel stupid...
I finished the thing before you posted... but...
ARGH.
User avatar
Taylrea Teodor
 
Posts: 3378
Joined: Sat Nov 18, 2006 12:20 am

Post » Tue Jun 19, 2012 12:48 pm

Okay. I finished it. NO errors, no nothing.
Only problem? It doesn't work. Items are removed, but objects don't appear.
Code:
Spoiler
[size="1"]Scriptname SMdwemerCraftScript extends ObjectReference [/size][size="1"]{Script that allows you to make certain Dwarven items using other Dwarven items, and some other stuff.}[/size][size="1"]Message Property MainMenu auto[/size][size="1"]{First menu when the button is activated}[/size][size="1"]Message Property CraftMenu auto[/size][size="1"]{Crafting menu that shows what you can craft}[/size][size="1"]Message Property DwemerServantMenu auto[/size][size="1"]{Menu that shows information about crafting the Dwemer Servant.}[/size][size="1"]Armor Property ArmorDwarvenGauntlets auto[/size][size="1"]{ArmorDwarvenGauntlets }[/size][size="1"]Weapon Property DwarvenSword auto[/size][size="1"]{DwarvenSword }[/size][size="1"]MiscObject Property DwarvenCog auto[/size][size="1"]{DwarvenCog }[/size][size="1"]MiscObject Property DwarvenPlateMetalLarge auto[/size][size="1"]{DwarvenPlateMetalLarge }[/size][size="1"]MiscObject Property IngotDwarven auto[/size][size="1"]{IngotDwarven }[/size][size="1"]SoulGem Property SoulGemCommon auto[/size][size="1"]{SoulGemCommon }[/size][size="1"]SoulGem Property SoulGemCommonFilled auto[/size][size="1"]{SoulGemCommonFilled }[/size][size="1"]GlobalVariable Property Crafted auto[/size][size="1"]{Crafted }[/size][size="1"]Actor Property DwarvenServant Auto[/size][size="1"]{Servant }[/size][size="1"]ObjectReference Property ROCK auto[/size][size="1"]{It's a rock. }[/size][size="1"]Event OnActivate(ObjectReference akActionRef)[/size][size="1"]Int MainM = MainMenu.Show()[/size][size="1"]If (MainM != -1)[/size][size="1"]If (MainM == 0)[/size][size="1"]Int CraftM = CraftMenu.Show()[/size][size="1"]If (CraftM != -1)[/size][size="1"]Int DwemServM = DwemerServantMenu.Show()[/size][size="1"]If (DwemServM != -1)[/size][size="1"]If (DwemServM == 0)[/size][size="1"]ElseIf (DwemServM == 1)[/size][size="1"]ROCK.Enable()[/size][size="1"]DwarvenServant.Resurrect()[/size][size="1"]akActionRef.RemoveItem(ArmorDwarvenGauntlets, 1)[/size][size="1"]akActionRef.RemoveItem(DwarvenSword, 1)[/size][size="1"]akActionRef.RemoveItem(DwarvenCog, 3)[/size][size="1"]akActionRef.RemoveItem(DwarvenPlateMetalLarge, 2)[/size][size="1"]akActionRef.RemoveItem(IngotDwarven, 2)[/size][size="1"]If (akActionRef.GetItemCount(SoulGemCommon) != 0)[/size][size="1"]akActionRef.RemoveItem(SoulGemCommon, 1)[/size][size="1"]Else[/size][size="1"]akActionRef.RemoveItem(SoulGemCommonFilled, 1)[/size][size="1"]EndIf[/size][size="1"]EndIf[/size][size="1"]EndIf[/size][size="1"]EndIf[/size][size="1"]EndIf[/size][size="1"]EndIf[/size][size="1"]endEvent [/size][size="1"]
[/size]

Officially insane.
~L
User avatar
MatthewJontully
 
Posts: 3517
Joined: Thu Mar 08, 2007 9:33 am

Post » Tue Jun 19, 2012 11:58 am

Alright, fixed it! Works perfectly!
I just had to Move the Servant to the player! I guess that when it spawns, it just falls off the game... So I was making it Enable, it just wasn't near me when it appeared.
User avatar
Timara White
 
Posts: 3464
Joined: Mon Aug 27, 2007 7:39 am


Return to V - Skyrim