Jump to content

Combining messages and variables


Recommended Posts

I decided to make a simple quest to test all this, here is the quest script:

Scriptname dz_test_quest Extends Quest
ReferenceAlias Property dz_outfits_msg_alias Auto
ObjectReference Property teammate_ref_ref Auto
Message  Property dz_outfits_msg03     Auto
Event Oninit()
utility.wait(2)
debug.messagebox("i just started")
debug.messagebox("alias is "+dz_outfits_msg_alias.getref())
debug.messagebox("ref is "+teammate_ref_ref)
dz_outfits_msg_alias.forcerefto(teammate_ref_ref)
debug.messagebox("alias is now"+dz_outfits_msg_alias.getref().getdisplayname())
utility.wait(1)
dz_outfits_msg03.Show()
EndEvent

I created a quest called dz_test_quest in the CK and attached the script to it.
i created a dummy interior cell and placed a bucket in it.

I created a message dz_outfits_msg03 which says <Alias=dz_outfits_msg_alias> works!

I created a reference alias in the quest called dz_outfits_msg_alias

The ObjectReference Property teammate_ref_ref Auto was set to the bucket in the CK properties.

The dz_outfits_msg_alias in the script was set to the quest reference alias of the same name in the CK.

The Message Property dz_outfits_msg03 Auto was set in the CK to the message of the same name.

the message oqner quest was set to dz_test_quest which is the name of the quest in the CK.

 

Any other mods were disabled.

Upon starting a clean save all messageboxes popped up with the entriesd I expected, including the displayname of the bucket that is the reference alias ([Misc]Bucket).

But the message still displays [...] works!

 

Have i missed any of your instructions out here?

 

diziet

Link to comment
Share on other sites

I think I have figured it out, the debug messages in the script:

debug.messagebox("i just started")
debug.messagebox("alias is "+dz_outfits_msg_alias.getref())
debug.messagebox("ref is "+teammate_ref_ref)
dz_outfits_msg_alias.forcerefto(teammate_ref_ref)
debug.messagebox("alias is now"+dz_outfits_msg_alias.getref().getdisplayname())

are i think a clue, I found if I loaded another (also clean save) that the alias starts off filled before the forcetoref and then the message includes the ref name.

In the clean save I was testing on the alias starts off as NONE, then gets filled with the forcetoref and then the message doesn't include the ref name.

Now I don't understand why this make a difference since in both cases the debug message (("alias is now"+dz_outfits_msg_alias.getref().getdisplayname()) shows the refname before the message is shown.

 

Since both saves are clean saves I do not know what might be the difference, are there rules about filling ref aliases in quests that are save related? As I said initially using ref aliases is new to me.

Whatever, it is working now, and it wouldn't be if ti wasn't for you, thankyou.

 

diziet

edit: it is even more interesting, turns out, which ever clean save I load on game start, the alias isn't filled and then the message is incomplete. If I load the other clean save from within the game ti works! If I reload the save I originally loaded, that doesn't work!

Link to comment
Share on other sites

Hey, yeah that is weird. Skyrim can be a bit wonky and I have noticed problems like that with alias's. For a mod I'm working on now, I keep the alias, specific reference set to none. It has the Optional and Stores Text flags set. The Quest is start game enabled. Filling the alias with a script works for using the alias in a book, although I haven't tried it on a message.

Link to comment
Share on other sites

A different approach:

Create a different message for each language - use Google Translate as place holder text until you can get a proper translation from a user of that language

Use SKSE's GetINIString to obtain the language as set in the Skyrim.ini file.

Set a global variable to a specific value depending upon the detected language and use that as a condition to determine which specific message is shown.

 

EDIT: I know it seems out of place but given diziet's other questions regarding translations, I figured that that was the main purpose to doing the substitution. Changing something to a different language that couldn't rely directly on localization.

Edited by IsharaMeradin
Link to comment
Share on other sites

  • 2 weeks later...
  • Recently Browsing   0 members

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