Grammarsalad Posted April 9, 2016 Share Posted April 9, 2016 Hello, Is there a way to display the value of a variable in text? Say, I have a variable "var", and I want dialog to say, " you have <var> hotdogs to go "where <var> displays the value of "var"? Link to comment
subtledoctor Posted April 9, 2016 Share Posted April 9, 2016 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
Grammarsalad Posted April 9, 2016 Author Share Posted April 9, 2016 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
Magus Posted April 10, 2016 Share Posted April 10, 2016 Dialogs are static files. The nearest thing is to create lots of states with each possible value of var as condition. Link to comment
Mike1072 Posted April 11, 2016 Share Posted April 11, 2016 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
Magus Posted April 11, 2016 Share Posted April 11, 2016 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
Jarno Mikkola Posted April 11, 2016 Share Posted April 11, 2016 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
argent77 Posted April 11, 2016 Share Posted April 11, 2016 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
Grammarsalad Posted April 11, 2016 Author Share Posted April 11, 2016 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
Avenger Posted April 17, 2016 Share Posted April 17, 2016 If you have SoD, a working example is how the singing pillar count is printed. Link to comment
Grammarsalad Posted April 18, 2016 Author Share Posted April 18, 2016 If you have SoD, a working example is how the singing pillar count is printed. I do have working, but I'll check that out Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.