Ability to manipulate maths based variables
May 26, 2023 12:00 AM
I have a number of constant variable to save the room scores in. On my menu page I want to show the user their current total score. I want to achieve this by displaying an Info Card with the sum of the variables inside.
E.g. Room 1 score = 3/5
E.g. Room 2 score = 4/5
E.g. Room 3 score = 1/5
Menu page will display 'Total score: 8/15'
Discussion (4)
, I'm not disagreeing that it works. I'm not even misunderstanding. I'm saying the interface can be improved and "Value" is not a good hint that you can put a variable there. Note that two of your more experienced customers didn't realize it from the interface, and not everyone will seek answers on this forum.
The Lectora interface (you see a list of variables) is way more intuitive, especially for an application that advertises itself as requiring no scripting.
The value to add to a variable is not limited to a constant, you can use the value contained in a variable using the %Variable% syntax.
As the OP replied in their other discussion on this
, they solved their issue using this method.
As an example, taking variables from their other thread:
"For example, I need TOTAL: %Variable1Score%+%Variable2Score%+%Variable3Score%"
The Actions would be:
Action1: Modify Variable Variable1Score Add to Variable %Variable2Score%
Action2: Modify Variable Variable1Score Add to Variable %Variable3Score%
Or creating a new variable TOTAL would allow you to add the three variables without overwriting the value of Variable1Score.
For more information, Variables, modifying variables, and showing and using the value of a variable are detailed on the Help page on Variables.
Beg to differ. See image: the "value" you can add with Modify Variable is a constant. If one is meant to type the name of a variable there, then
A)That's a mistake and it should be picked from a list, and
B)At the very least, say that and give an example in a tooltip. As it is shown right here, it sure doesn't look like it.
EDIT: "value" implies a constant. A variable or its contents is not a "value".
No need for a feature request, as this functionality has been in CenarioVR for years. You just need to learn how to use the "Modify Variable" action.