Yes - you can use the Variable: Set Action to increase one variable's value by another.
If you use that Action to set the value of either an Integer or Float variable, you can set the Method to Formula, and then refer to the variables you wish to add with tokens.
The [var:X] token allows you to refer to a Global variable with ID = X. Similarly, [localvar:X] refers to Local variables.
For example, to add the two variables with IDs of 3 and 7, you'd type:
[var:3] + [var:7]
For more on available tokens, see the Manual's "Text tokens" chapter.
To then display the variable on-screen, you can use another such token in a Label menu element's "Label text" box. See this tutorial for more on this topic.
Hello,
Is it possible to get something similar but with highlighted inventory item (instead of selected)?
I'd like to display what the stats would be if the player equiped a certain item. I currently have one variable which is the base value of the stat, and each inventory item has a set of properties which I add to make a new variable.
It'd be nice to have a column with values showing the base value + the item property of an item that the player is highlighting/hovering over.
Hello Chris, I have a question with the Formula Method, I need to increase the value of a variable by a certain number divided by the value of another variable: 2 / [var:47], through - Increase By Value Method I can only increase by a number and I cannot insert a variable token, when I use the Formula Method, it only set value of the variable and does not increase how do I make the value go up?
Comments
Yes - you can use the Variable: Set Action to increase one variable's value by another.
If you use that Action to set the value of either an Integer or Float variable, you can set the Method to Formula, and then refer to the variables you wish to add with tokens.
The [var:X] token allows you to refer to a Global variable with ID = X. Similarly, [localvar:X] refers to Local variables.
For example, to add the two variables with IDs of 3 and 7, you'd type:
For more on available tokens, see the Manual's "Text tokens" chapter.
To then display the variable on-screen, you can use another such token in a Label menu element's "Label text" box. See this tutorial for more on this topic.
Thanks Chris
Hello,
Is it possible to get something similar but with highlighted inventory item (instead of selected)?
I'd like to display what the stats would be if the player equiped a certain item. I currently have one variable which is the base value of the stat, and each inventory item has a set of properties which I add to make a new variable.
It'd be nice to have a column with values showing the base value + the item property of an item that the player is highlighting/hovering over.
I'm not sure what you're referring to with items - there's no mention of selected items above.
However, the currently-highlighted inventory item instance can be gotten with:
Oh sorry, I had multiple threads opened and replied to the wrong one.
Thanks!
Hello Chris, I have a question with the Formula Method, I need to increase the value of a variable by a certain number divided by the value of another variable: 2 / [var:47], through - Increase By Value Method I can only increase by a number and I cannot insert a variable token, when I use the Formula Method, it only set value of the variable and does not increase how do I make the value go up?
You can use the [var:X] token for the variable you're setting as well, i.e.:
Thanks Chris! how did I not think of that myself?