How many variables can you add?


I’m trying to create a composite variable and am running into trouble trying to add more than two variables at a time. This is what I want to do:

*set team_rapport (reg_rapport + rania_rapport + nick_rapport + nora_rapport + leroux_rapport)/5

And this is what I get:

Invalid expression at char 32, expected closing parenthesis, was: OPERATOR[+]

But *set team_rapport (reg_rapport + rania_rapport)/2 works just fine.

Can you only add two variables at a time in ChoiceScript?



*set team_rapport ((((reg_rapport + rania_rapport) + nick_rapport) + nora_rapport) + leroux_rapport)/5


Each statement needs to be wrapped in its own set of parentheses, so you’d need to do something like this:
*set var (((var1 + var2) + (var3 + var4)) + ((var5 + var6) + (var7 + var8)))


Wouldn’t it be easier and simpler to just set them individually?


Doing this:

*set team_rapport 0
*set team_rapport +reg_rapport
*set team_rapport +rannia_rapport
*set team_rapport (team_rapport / 5)

Is also an option, and I think it ends up with the same result