Jump to content

Insert variable value into message


Recommended Posts

I am a litle confused as to whether it is possible to insert a value of a variable into a message box question e.g.

the string variable 'outfit_type' is detemined to be, say, 'snowy' and then the message box question reads:

"Do you wish to set this as the 'snowy' outfit?"

 

Or do I need a separate messagebox question for each variable value?

 

diziet

Link to comment
Share on other sites

Since you did not state whether your message box is created in the Creation Kit or defined completely in Papyrus, I've included what I know about both.

 

For papyrus defined message boxes:

Debug.Messagebox("Do you wish to set this as the "+outfit_type+" outfit?")

For message boxes using the message record, there are these text replacement options available.

Link to comment
Share on other sites

Since you did not state whether your message box is created in the Creation Kit or defined completely in Papyrus, I've included what I know about both.

 

For papyrus defined message boxes:

Debug.Messagebox("Do you wish to set this as the "+outfit_type+" outfit?")

For message boxes using the message record, there are these text replacement options available.

The message box is created in the CK, the debug.messagebox doesn't (as far as I know) enable a no/yes response.

I read the text replacement page, at the bottom it reads:

 

Text replacement tags can be used in the following text fields:

Quest stage Log Entry

Quest objective Display Text

Topic prompts (but not Topic Info)

Messages - Title and Message Text

Book text

For Messages and Books, the base objects must be associated with a specific quest in order to use text replacement.

 

 

I have a quest - the MCM quest that has the script that will call the message, but I don't know what base objects that quote is referring to:(

 

diziet

Link to comment
Share on other sites

For messagebox text replacement, what I do is make dummy misc items that are named what you want to show in the message, and make dummy objectreferences of those misc items, then use a script to force them into a reference alias in a quest. The alias is displayed in the message.

 

For your example in the CK, in your message you would put:

 

Do you wish to set this as the <Alias=OutfitAlias> ?

 

Then in your script you would do this:

ObjectReference Property SnowyOutfit Auto ;ObjectReference of MiscObject named "Snowy Outfit"
ObjectReference Property SummerOutfit Auto ;ObjectReference of MiscObject named "Summer Outfit"
ReferenceAlias Property OutfitAlias Auto ;ReferenceAlias holds an ObjectReference, displays its name in the OutfitMessage
Message Property OutfitMessage Auto 

Event OnInit() 
    DisplayOutfitMessage(SnowyOutfit)
EndEvent

Function DisplayOutfitMessage(ObjectReference OutfitObject)
    OutfitAlias.ForceRefTo(OutfitObject) 
    OutfitMessage.Show()
EndFunction

Note that in your message in the CK you have to set the owner quest as the quest that holds the OutfitAlias. Set the reference alias as Specific reference, check the Optional, Stores text and Uses Stored Text boxes. I made a tutorial on how to do this for config message menus which you can find here: https://www.nexusmods.com/skyrimspecialedition/mods/46410

Link to comment
Share on other sites

  • Recently Browsing   0 members

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