I am working with Quest version 5.8.0. I am new to coding and this program altogether. The project I'm working on is pretty complex but I want to take that challenge head on. I have several status attributes and I want to create one more that is a overall of sorts. The way I want to calculate this is to average all my status attributes. This means adding them together and dividing them into the total. I'm working with the text adventure side. If that confuses anyone I will surely be prompt to divert any confusion.
I should add that I use mostly the GUI side of things, however I do understand the coding and can accept that as a solution.
Making a status attribute that changes when some other value changes is a common request. The most common ways to do it are using a changescript (which runs whenever a certain value changes), or a turnscript (which runs every turn).
In this case, I suspect that the turnscript option would be easier. You can create turnscripts at the bottom of the game's "Scripts" tab.
In this case, the only coding needed is the mathematical formula you want to use. You can just enter the calculation as an expression. I don't know what stats you're using, but as an example I'll assume your player is going to have a success status attribute that is the average of their fame, influence, and reputation. You should be able to adapt this to your stats easily enough.
the script for the turnscript in this case would be:
player.success = (player.fame + player.influence + player.reputation) / 3
or as it appears in the GUI view:
(you can't see the whole expression there because it's cut off by the edge of the box, but I'm sure you know what it means)
You can make the arithmetic as complex as you want, in an "Expression" box.
If this isn't clear enough, please let me know what you're having trouble with :) I'd be happy to help
THANK YOU so much. You explained it perfectly and I had a eureka moment. That's very helpful. Thanks for your help.
Sorry to bother you again, but once I implement the string how do I display it in the status menu?
You can add it to the statusattributes list in the same way as any other attribute. I believe you can do that from the 'player' tab, or the 'attributes' tab on the desktop editor. When adding it, the 'key' is the attribute name (the part after the dot), and the value is howbyou want it to appear to the player.