Can you pass variables through UI.Notify?

So, I’ve figured you can utilize UI.Notifiy(tag_name_here) to print a message onto the game’s UI. The “tag_name_here” is sought after in .txt files and it corresponds to a string:

imagem

Looking at these .txt files, you can see multiple missing parameters (e.g.: {%d0}) which, if my intuition is correct, corresponde to fields one can dynamically edit before performing the UI notification (e.g.: "You reached level 79).

Can anyone confim this for me? Does anyone know any way to insert these parameters in a UI notification before actually printing it (inside Lua, for instance)?

I’ve tried using UI.Notify(tag_name_here, X), where X is a random number but this does not work…

Thanks in advance!

Nah, afaik there is no way to see what they do. In fact, from what I have seen and remember, these variables are used in multiple areas for different things. I think it’s just a hardcoded bit that is dependent on the event to determine what the variable means. In the image you posted, it looks like {%d0} is used multiple times for XP based events, but it’s for different things, enemy XP, boss XP, XP rewards, grave xp, rep rewards. And it goes further than that, it can also be used to format pet limit displays and skill bonus amounts.

Testing it is the only way to be sure though.

Alternatively, you can dynamically create lua messages with variables from your lua script, using variables from events in game that you assigned, like when a specific monster dies or item drops. If XP is what you’re trying to focus on… not sure you can pass that data.

1 Like

Firstly, thank you for taking the time to reply!

Yeah, what you’re saying makes sense… Do you have any ideia where these types of variable messages are called from?

I’ve looked through what I believe are most of the lua files of the base game and although they utilize UI.Notify in some instances, I have never seen another function to print out a message with a variable.

Perhaps these notifications are assigned via one of the editors? Perhaps inside the DBR Editor, associated with characterHooks similar to the ones below?

I’m mostly trying to create UI messages based on damage dealt per hit. I’ve indeed managed to create lua messages based on “onHit” hooks (see image below) but I still haven’t been able to pass certain variable information through these messages (hence my initial question). I believe this is possible since Grim Internals manages to do something similar in a sense.

Any help is appreciated!

They aren’t called the same way you can call them via lua, they don’t exist anywhere that we can see them, so again, it’s a bit of hardcoded stuff that just triggers when the event occurs. Hero dies > display tag. Grave clicked > XP reclaimed, etc. I just ran a grep search on a few of those tags, they aren’t used in any database file. (dbr)

Hm, I don’t think you can pass damage values through lua. If you haven’t already you can look here for the lua API to see what you can use.

1 Like

They are called from the engine. UI notify messages take 1-2 seconds to display and fade away. Dont use them for frequent notifications.

1 Like

Hmm, got it! Hopefully I’ll be able to find a workaround…

Thank you for the link, this definitely helps a lot! Although some functions are present in the official modding tutorial, I always found myself scouring lua scripts to see if there were any other methods I could use.

Thank you for the reply! Yes, I have also started to notice that downside… Do you, perchance, know of another method to create UI notifications which can be used more frequently?

There is a lot of UI-related dbr files but that also does not seem the way to go.

One file I still have not found is the dbr for the “floating numbers” effect when dealing damage. Perhaps this file manages to connect damage dealt to UI in an easier manner. Does anyone know if there is a corresponding dbr file?

there is nothing else besides ui notify. You can write it to the console log but that is not a great solution.
If your aim is to replace GI then other peole have already made progress on that front - DPYes.

As for as where the floating damage numbers are coming from - somewhere in ui/floating text, but you can’t tab into that. only modding you can do on UI is moving things around or chaning their size. You cant add something that is not there already.

Oh no, my aim isn’t to do a full on mod haha
I leave that up to the professionals! I’m currently working on my master thesis which requires modding an ARPG, hence my queries. But I deeply appreciate any help, I’ll surely look into DPYes and maybe even try to contact the creator

Damn… I was hoping I could still exploit those files :neutral_face:

Thank you anyways for the swift replies!!