Jump to content

Combining messages and variables


Recommended Posts

Please use next code inside your script

    Debug.Trace("::MSG:: " dz_outfits_msg03 )

and look at papyrus.0.log for the output. -- Post the whole output line from trace above to this forum topic here! --

Depends on chars inside the output string, it could be possible to make a workaround with SKSE StringUtil functions.

 

So you don't need to use any additional string property in your script, like next.

String Property dz_outfits_msg03String Auto

EDIT: Yes, bad idea from me above. But as diziet.. wrote below "in the log there is no sign of anything related to the debug.trace line".

Hopefully you understand why it is not possible to cast the message type as string to get the content of a message.

Edited by ReDragon2013
Link to comment
Share on other sites

@ReDragon2013, as far as I know, there's no papyrus function, skse or otherwise. to get the text from a message form, which is what dz was trying to do.

 

Message Property dz_outfits_msg03 Auto

Debug.Notification(dz_outfits_msg03 as string)

 

This simply won't work. Instead of using the message form, a string property will work just as well for this instance. The reason to use text replacement in a message form is if you need it to be a message box which options to choose from.

Link to comment
Share on other sites

I liked your first method dylbill, until I realised that the property won't be translateable in strings files like messages are. So I think I'll need to try your second method. :smile:

 

@ReDragon2013, I added your code to this function:

Function dz_add_NPC(String name)
    ;UILIB_1 UILib = ((Self as Form) as UILIB_1)       ;uilib works but has issues with text size
    ;UiLib.ShowNotification("$addnpc{" + name + "}tooutfits")
    debug.notification(name+dz_outfits_str01)        ;set dz_outfits_str01 as string in properties
    Debug.Trace("::MSG:: " +dz_outfits_msg03 )
EndFunction

and although the notification using dz_outfits_str01 shows, in the log there is no sign of anything related to the debug.trace line, the property dz_outfits_msg03 is set.

 

diziet

Link to comment
Share on other sites

@dylbill

I have done the following:

made an alias in my mcm quest called dz_outfits_msg_alias, I have checked 'stores text' and 'uses stored text'.

In the properties of the mcm script attached to the quest I have set the script property from:

ReferenceAlias Property MsgAliasA Auto

to be dz_outfits_msg_alias

I have altered my function to read:

Function dz_add_NPC(Actor aRef)
    debug.messagebox("alias is "+MsgAliasA.getActorreference())
    MsgAliasA.forceRefTo(aRef As ObjectReference)
    debug.messagebox("alias is now "+MsgAliasA.getActorreference())
    dz_outfits_msg03.Show()
EndFunction

and in the message dz_outfits_msg03 I have the text:

<Alias=MsgAliasA> added to Diziet's Auto Outfits

 

In game the two message boxes show the alias as being first 'NONE' and then my follower (dlc1seranascript) but the notification of the message is:

[...] added to Diziet's Auto Outfits

 

I have tried using:

<Alias=dz_outfits_msg_alias> added to Diziet's Auto Outfits in the message text

I have also tried changing the alias fill type from forced:NONE to unique:NONE, from my online reading I have also tried adding an empty stage to my mcm quest and checking 'allow reserved' on the alias.

 

What might I be missing?

 

diziet

Link to comment
Share on other sites

I haven't needed to make an empty quest stage when I've done this. In your message it should be <Alias=dz_outfits_msg_alias> . The Alias name in the message should match what you named your alias. Also make sure in your message you set the owning quest as the quest your Reference Alias is on. For fill type I use specific reference.

Link to comment
Share on other sites

Ah, what I'm trying to display is the name of an actor that is only known when the script is run from a hotkey press (script is the MCM script),

The script function seems to say I have filled the alias according to:

debug.messagebox("alias is now "+dz_outfits_msg_alias.getActorreference())

but obviously I can't set this reference in advance as a property.

 

Does this mean I'm scuppered?

 

diziet

Link to comment
Share on other sites

Hmm, then I'm still doing something wrong:

 

the hotkey runs this code:

dz_add_NPC(teammate_ref As ObjectReference)

teammate_ref is an Actor variable that is obtained from a function that uses the SKSE GetCurrentCrosshairRef() function. This same variable is also used to fill the names of my MCM pages and I can confirm that it works.

 

the function dz_add_NPC() is:

Function dz_add_NPC(ObjectReference aRef)
    debug.messagebox("alias is "+dz_outfits_msg_alias.getActorreference())
    dz_outfits_msg_alias.forceRefTo(aRef)
    debug.messagebox("alias is now "+dz_outfits_msg_alias.getActorreference())
    dz_outfits_msg03.Show()
EndFunction

now I did have the function take the straight teammate_ref as its parameter, with the function defined as Function dz_add_NPC(Actor aRef), and I tried both dz_outfits_msg_alias.forceRefTo(aRef) and dz_outfits_msg_alias.forceRefTo(aRef As ObjectReference), the compiler didn't complain on any of these versions.

 

The script has:

ReferenceAlias Property dz_outfits_msg_alias Auto

and that is set in the CK to an alias of the same name on the quest (MCM) that has this script attached.

In your video example your MMTGS quest script extends quest, but of course mine extends SKI_ConfigBase, could this make a difference?

 

In my message dz_outfits_msg03 is the text "<Alias=dz_outfits_msg_alias> has been added..." (no quotes).

 

When pressing my hotkey (NPC has to be under crosshair) I get the two message boxes:

Alias is NONE

and then:

Alias is DLC1SeranaLevellingScript etc.

from this I'm assuming the alias is filled, should I be testing this in a different way?
The result of the message in game is "[...] has been added..." (no quotes), which according to the wiki means the alias hasn't been filled, but that doesn't seem right?

 

diziet

Link to comment
Share on other sites

  • Recently Browsing   0 members

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