Populate messagebox text andor button with a cell's name

Post » Tue Nov 20, 2012 8:44 am

I am playing around with a mark/recall type of a spell. I've got the basic functionality worked out, now I want to make it more user-friendly.

When the player casts the mark spell, an invisible marker is moved to the player. No problems there.

When the player casts the recall spell, I want him to be presented with a message box that says "Do you wish to teleport to..." and below there would be a button with the name of the cell where the mark currently is. As in, if I mark in Breezehome, it would look like "Do you wish to teleport to..." and the button will say "Breezehome".

Unfortunately, I can't seem to wrap my brain around how to do it. Pointers would be appreciated.
User avatar
Nauty
 
Posts: 3410
Joined: Wed Jan 24, 2007 6:58 pm

Post » Tue Nov 20, 2012 4:46 pm

Currently, there's no way to pass strings to a MessageBox shown via http://www.creationkit.com/Show_-_Message, which you'd need to offer options. You could show the cell name using SKSE's http://www.creationkit.com/GetName_-_Form in a MessagBox using http://www.creationkit.com/MessageBox, then offer the options.
Spoiler
ScriptName Test Extends ActiveMagicEffectGlobalVariable Property kGLOB AutoObjectReference Property kREFR AutoMessage Property kMESG AutoEvent OnEffectStart(Actor akTarget, Actor akCaster)	kGLOB.SetValue((!kGLOB.GetValue() As Bool) As Int) ; Toggle	If kGLOB.GetValue() ; Recall		Debug.MessageBox("Marked location: " + kREFR.GetParentCell())		Int iButton = kMESG.Show() ; Teleport to marker?		If iButton == 0 ; Yes			akCaster.MoveTo(kREFR)		ElseIf iButton == 1 ; No		ElseIf iButton == 2 ; Remove Marker			kGLOB.SetValue(0.0)		EndIf	Else ; Mark		kREFR.MoveTo(akCaster)	EndIfEndEvent
You could also rename the spell to reflect where it'll teleport you to.
User avatar
Felix Walde
 
Posts: 3333
Joined: Sat Jun 02, 2007 4:50 pm

Post » Tue Nov 20, 2012 8:16 am

Very interesting. Thank you JustinOther.

Next question... is it possible to present a friendlier name of the cell? Right now it looks like [Cell123456]]
User avatar
Star Dunkels Macmillan
 
Posts: 3421
Joined: Thu Aug 31, 2006 4:00 pm

Post » Tue Nov 20, 2012 9:51 am

Perhaps it is, but I havent tried it since I have never needed it. However in my mod Nature of the beast II I was able to put into the message box many things like names and races of actors, six and so on. All dynamically. Look at my smell scripts. Perhaps it will be a good start. Goodluck!
User avatar
Danger Mouse
 
Posts: 3393
Joined: Sat Oct 07, 2006 9:55 am

Post » Tue Nov 20, 2012 12:22 pm

Very interesting. Thank you JustinOther.

Next question... is it possible to present a friendlier name of the cell? Right now it looks like [Cell123456]&--#60;Riverwood&--#62;]
Debug.Notification(kCELL)
would read like that, but
Debug.Notification(kCELL.GetName())
should print out the readable name you're after. GetName, of course, requires SKSE.
User avatar
biiibi
 
Posts: 3384
Joined: Sun Apr 08, 2007 4:39 am

Post » Tue Nov 20, 2012 6:17 am

Cool. GetName works great for indoor cells but fails to return anything for outdoor cells which is a shame.
User avatar
Noely Ulloa
 
Posts: 3596
Joined: Tue Jul 04, 2006 1:33 am

Post » Tue Nov 20, 2012 9:18 pm

Most exterioir cells aren't named.
User avatar
Gill Mackin
 
Posts: 3384
Joined: Sat Dec 16, 2006 9:58 pm


Return to V - Skyrim