Hey,
In my game I want the player to have a maxuimum carrying weight. I want this number to be (Strength x Endurance). Strength and Endurance are two diffrent variables (no need to help me create them, I know how to do that). How can I create the “Maximum Carrying Weight” variable?
thanks
Fiogan
July 27, 2016, 3:37pm
2
There are instructions on how to combine two variables in different ways here , in a tutorial that @Lglasser created.
Did you want to multiply the variables, or add them? You can do either, and then use them like this:
*set maximum_carrying_weight (strength + endurance)
or
*set maximum_carrying_weight (strength * endurance)
There’s an example of a maths string here as well. I hope that helps!
7 Likes
Eiwynn
July 27, 2016, 3:41pm
3
*set varxy (var * var1)
looks like @Fiogan beat me to the punch. She is much swifter at code then me.
Thanks! That helped alot!
1 Like
I’d have thought if that maximum carrying weight changes, it’d be something like
*set maximum_carrying_weight ({strength} + {endurance})
I’m not sure though if that’s different from what @Fiogan has said. I’ve not actually tried that out to even see if it works.
Hrm yeah both seems to do the same in the Ide.
In the latest version of ChoiceScript, new features are available for programmers. They’re documented in the Advanced ChoiceScript section of the documentation, which means that you probably don’t need to use them. (I like to discourage people from getting too fancy in ChoiceScript games, because adding complexity rarely adds to the fun of the game.)
Curly braces now replace *setref and *gotoref. For years, you’ve been able to use curly braces {} around variable names to return values by refe…
Thank God for the search function I knew this was possible, but I couldn’t remember the command for the life of me.
Thank you, @Fiogan !
1 Like