HotCosmo
Just a guy
- Joined
- Oct 3, 2023
- Posts
- 9
Hello! Working on my WIP, I created two functions that could be useful for story game writers that want their stories to be international. weight() and height() are simple functions that you can use to have the imperial system or the international system of measures in your game.
To let the player select, I usually use the next method, although it can be easily hidden in some initial choices.
Using them is really simple (maybe simpler for the people used to the imperial system because you as the writer have to use it in the code).
I hope these functions can be helpful for someone. Have a nice day!
Code:
=== function height(feet, inch)
~ temp result = 0
{ measure == 1:
~ result = feet * 30.48
~ result = result + (inch * 2.54)
~ result = INT(result)
~ return result + " cm"
-else:
{feet == 0:
~return inch + "''"
}
~return feet + "'" + " " + inch + "''"
}
=== function weight(lbs)
~ temp result = 0
{measure == 1:
~ res = lbs / 2.205
~ res = INT(res)
~ return res + " kg"
-else:
~ return lbs + " lbs"
}
To let the player select, I usually use the next method, although it can be easily hidden in some initial choices.
Code:
VAR measure = 0
WHAT MEASUREMENTS SYSTEM DO YOU WANT TO PLAY WITH?
+ Imperial System (Feet and inches)
~ measure = 0
+ International System (cm)
~ measure = 1
-
Using them is really simple (maybe simpler for the people used to the imperial system because you as the writer have to use it in the code).
Code:
He was around {height(5,4)}, shorter than the rest of his teammates.
With a weight of {weight(130)}, all the rivals underestimated him.
But he had a skill that no one knew: his fingers were unusually large.
His middle finger was around {height(0,5)}.
I hope these functions can be helpful for someone. Have a nice day!