Help on a Spell Script

Post » Mon Nov 19, 2012 5:25 am

Hello
I have made a Testing spell called Disenchanting Spell and it works fine. The script will check automatically if the player has any of the items in the property script available in his inventory, if yes, it will execute the script (Disenchant) if not it will display the message.
Now thats not where I want to stop, What I would like to do is, if possible you guys can help me on this script on how to add the proper codes in order to open a Gui or some sort of a message box.
So, after the player cast the spell, the script will detect if the player has any on these the 2 prorerties in his inventory, Open the Message Box or the gui, display the 2 properties in the box, player will select any of the properties by left clicking on its name, and press ok, then the script will execute the disenchant after pressing OK.
here is my script spell
User avatar
Eduardo Rosas
 
Posts: 3381
Joined: Thu Oct 18, 2007 3:15 pm

Post » Mon Nov 19, 2012 7:11 am

You can use the http://www.creationkit.com/Show_-_Message function to show a Message, but Messages can't be passed strings and buttons can be conditionalised but not assigned dynamic values. Alternately, the http://www.creationkit.com/MessageBox_-_Debug function can be used to create a message by passing a string generated at runtime, but you have no control over the buttons here.

I don't think SKSE currently has any similar functions available that can give us the best of both worlds.

Cipscis
User avatar
xx_Jess_xx
 
Posts: 3371
Joined: Thu Nov 30, 2006 12:01 pm

Post » Mon Nov 19, 2012 7:25 am

Hello Cipcsic
ok, how about in the message box
User avatar
Tiffany Castillo
 
Posts: 3429
Joined: Mon Oct 22, 2007 7:09 am

Post » Sun Nov 18, 2012 9:27 pm

I did It Cipscis using a message box
lol i am not even a programmer and i did it lol.
Gus.
User avatar
Melanie Steinberg
 
Posts: 3365
Joined: Fri Apr 20, 2007 11:25 pm

Post » Mon Nov 19, 2012 1:14 am

It isn't clear to me if you need a message box to pop up with 2 buttons that will always say the same thing, or if you are looking for the ability to disenchant specific items (instead of all items).

If the items are pulled into quest aliases and the OwnerQuest of the message box is assigned to the quest, you can reference the alias names in the message box using syntax:



However, I have never tried putting them into a button. It probably wont work, though you could try. However, if the button needs to always say the same things (or a small number of unchanging things), you could put in conditions to display the correct 2 buttons.

Now, if you are looking for an interface to selectively disenchant potentnially many items, the message box is not the way to go for many reasons. It sounds like you have already created a FormList with the items you support. So the natural thing to do would be to start a Gift Menu with a newly spawned invisible actor or container using ShowGiftMenu:

http://www.creationkit.com/ShowGiftMenu_-_Actor


Pass in your formlist of items and it will limit the selection to the items in the list. Finally, add an OnItemAdded event handler to your container

http://www.creationkit.com/OnItemAdded_-_ObjectReference

and have it disenchant anything that arrives and immediatly add it back to the sourceContainer (which will be the PC). Then you dont have to worry about an abundance of enchanted items.

Though I dont know if selective disenchantment is what you were going for.
User avatar
Sara Johanna Scenariste
 
Posts: 3381
Joined: Tue Mar 13, 2007 8:24 pm


Return to V - Skyrim