Setting qualities in Raconteur to a specific value

A question! I have been increasing or decreasing wordscale qualities in Raconteur using

system.setQuality('foo', character.qualities.foo+2)

…which seems to be working fine.

But what code do I need to use to set the quality to a specific number? I tried

system.setQuality('foo', character.qualities.foo 5)

…but when the quality is an integer nothing appears to happen, and when it’s wordscale it gets set to “undefined”. In the case of wordscale, the value I’m aiming for is definitely defined and displays fine when it’s the result of an increase or decrease in the quality.

Note: This is actually an Undum question, not a Raconteur question; any time you call any part of System you’re interacting with the Undum API.

The function expects:

system.setQuality([qualityName], [value])

So to simply set a value:

system.setQuality('foo', 5)

In this line:

system.setQuality('foo', system.qualities.foo + 2)

“system.qualities.foo + 2” is an expression. When it’s run, it evaluates to some number (equal to the result of adding 2 to system.qualities.foo) and that is what gets passed to setQuality. If you want an expression that will just always produce 5, you just use the literal number 5. But it could just as well be something like “system.qualities.bar - 1”, to set foo to equal one less than bar; or any other arbitrary calculation you need to make.

Hooray, works perfectly! Thanks!