Jump to content

Display variable values in dialog


Grammarsalad

Recommended Posts

Check NPC_EE v2, lines 505-506 of the .tp2 file. It uses an APPEND command with Weidu variables in what is APPENDed. I think that's not exactly what you're asking - the text itself doesn't contain any variables after it's been established - but it's the closest I've come to trying that kind of thing. And it might be a way you can accomplish it.

Link to comment

Check NPC_EE v2, lines 505-506 of the .tp2 file. It uses an APPEND command with Weidu variables in what is APPENDed. I think that's not exactly what you're asking - the text itself doesn't contain any variables after it's been established - but it's the closest I've come to trying that kind of thing. And it might be a way you can accomplish it.

I'll look, but unfortunately, that is not what I'm aiming at. It needs to be dynamic, like the <DAYANDMONTH> token, which could potentially display any day and month values in the game...

 

It could be EE only. That would be fine if it's only possible there

Link to comment

It is possible to assign values to tokens - I remember a tutorial on it written by igi - but they suffered from some pretty severe limitations. I don't know if the Enhanced Editions did anything to make them more usable.

Link to comment

It is possible to assign values to tokens - I remember a tutorial on it written by igi - but they suffered from some pretty severe limitations. I don't know if the Enhanced Editions did anything to make them more usable.

Right, actually that might work.

Link to comment

I'll look, but unfortunately, that is not what I'm aiming at. It needs to be dynamic, like the <DAYANDMONTH> token, which could potentially display any day and month values in the game...

Why the "...", what exactly are you looking for ?

If it's simple debug info, that's easy to do by associating something to the %x% and then displaying it via script action... as I use this in the LStest tool mod.

 

ActionOverride(Player1,DisplayString(Myself,~Running block %x% of %SOURCE_RES%.BCS~))

Of course the strings are pre-compiled in the install of the mod, but it can be very dynamic if you make it correctly. And you can use the %...% to enclose a lot of things.

 

But if it's what ever else, you got to tell us exactly.

Link to comment

It's possible to display the content of variable in strings. I'm using it in my Djinni Companion mod to display his current stats. The first script block in the file a7afqlvl.baf makes use of all required actions to initialize and display a token.

In summary:
1. Initialize or update your variable, e.g. IncrementGlobal("HotDogsEaten", "GLOBAL", 1)
2. Assign variable to your token, e.g. SetTokenGlobal("HotDogsEaten", "GLOBAL", "TOKEN_HOTDOGS")
3. Add it to your dialog or message strings, e.g. DisplayString(Myself, ~You have already eaten <TOKEN_HOTDOGS> hotdogs.~)

There are several limitations:
- Tokens are not saved across sessions, so you have to initialize them whenever you start or load a game.
- Changing the content of variables does not automatically update their associated tokens. You have to call SetTokenGlobal() again to make the changes visible.

Link to comment

It's possible to display the content of variable in strings. I'm using it in my Djinni Companion mod to display his current stats. The first script block in the file a7afqlvl.baf makes use of all required actions to initialize and display a token.

 

In summary:

1. Initialize or update your variable, e.g. IncrementGlobal("HotDogsEaten", "GLOBAL", 1)

2. Assign variable to your token, e.g. SetTokenGlobal("HotDogsEaten", "GLOBAL", "TOKEN_HOTDOGS")

3. Add it to your dialog or message strings, e.g. DisplayString(Myself, ~You have already eaten <TOKEN_HOTDOGS> hotdogs.~)

 

There are several limitations:

- Tokens are not saved across sessions, so you have to initialize them whenever you start or load a game.

- Changing the content of variables does not automatically update their associated tokens. You have to call SetTokenGlobal() again to make the changes visible.

That is... Perfect! I can work within those limitations.

 

Thanks!

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...