Jump to content

Putting the player's name into a UI message (not a book/note)


Recommended Posts

I've found the tutorials which help you put the player's name into a book, note, or the name of a pickup, but what it hasn't taught me is how to put the player's name in message that's using an activator and a script to show text on-screen either in the event log or in a message box. For example, rather than make it say, "It says this is my room," it will say "<Alias=Player>'s Room." and have the player's name fill in correctly.

 

I have the bare minimum of scripting knowledge, but am learning. Any help is appreciated.

Link to comment
Share on other sites

If it's possible (and I think it is) you would use the same basic strategy you use with books. Create a Message object and assign it an owner quest that has a Player alias. Then in your script you create a message property and use the Show() function on that message when you want it to appear on screen. You can tag the message as a message box or just use it as a basic notification message.

Link to comment
Share on other sites

I did follow the normal procedure to see if it worked or not, and it doesn't. I think the issue might be with the checkbox "uses stored text" since the activator doesn't store text, it's just calling a script, but that's just a guess.

 

This is the tutorial I followed which doesn't work for my case:

 

I've tried both the message box and the basic notification. Both work when I have normal text in them. Both fail to show up as soon as I add the player alias, even with the quest referencing them like the tutorial explains.

 

This is my script.

 

3F1c5y8.png

Link to comment
Share on other sites

Unfortunately whatever magic makes those replacements work isn't part of the scripting system. That's certainly the right script, so whatever might make the idea work would be some combination of aliases and other settings configured on the message, quest, and aliases in the CK. I've never tried to get something like that working myself.

Link to comment
Share on other sites

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.

 

 

https://www.creationkit.com/index.php?title=Text_Replacement

 

This would suggest that it should work for messages too. Not sure what being associated to a quest means in the context of messages though. For books you need to make an alias pointing to the book reference for it to work.

 

if it turns out messages cannot use text replacement, couldn't you perhaps show that information as an objective's text?

Edited by FrankFamily
Link to comment
Share on other sites

I've got it!

 

What I was missing, and I can't find any mention of elsewhere, is setting the quest owner on the message itself.

 

MHCc51w.png

 

When done this way, the specific reference selection (which is pointing to the activator that calls the message) locks in and grays out in the Reference Alias window.

 

L3BRike.png

 

So quest points to activator which points to message which points back to quest.

 

It works for both message windows and log notifications! I am so relieved! :D Now I need to figure out how to change the activator or message depending on questline events and/or faction ranks. :smile:

 

Is there any way to flag this topic as "solved" in the title?

Link to comment
Share on other sites

I'm glad you found the answer and also posted what you discovered. You could ask a moderator to change the title, but it's OK as it is. Now that it's answered it's unlikely others will post more comments and it will be easy enough to see that the question was answered.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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