Just a quick question that I could most likely figure out myself but I'm way too lazy and I'm assuming somebody already knows the answer anyway - in scripting are you good to use 1D%VARIABLE, or %VARIABLED6? So let's just say the variable %COOL can be 1, 2 or 3, and you want to set something to have a random roll but with a better chance of success if %COOL is a larger number. So you'd go:
%VARIABLE := 1D%COOL
So if %COOL is 1, %VARIABLE can only be set to 1. If %COOL is 2, %VARIABLE has a random chance (1D2) of being set to 1 or 2. If %COOL is three, %VARIABLE has a random chance (1D3) of being set to 1, 2 or 3.
Anyway is this possible? It'd just save a lot of time if it is, that's all.
I figured something out too (which is very surprising considering I don't know anything about scripting) but it's not what you wanted, just something slightly different:
1. Make two variables, VARIABLE and COOL.
2. Make new link on page you want.
2. Go to the link you want to change the variables and press the := button. Put in %VARIABLE := %COOL + 1D2 (or whatever you want to put for the random number like, 3D2, 1D4, etc.)
3. Make sure it works.
This way makes it so whatever %COOL is, it would add in with %VARIABLE. Do you guys get where I'm coming from?
Good on you for trying out scripting Fergie. The script you wrote actually works fine, but it doesn't capture what I'm trying to do - let's just say %COOL was 4 at the time and you had %VARIABLE := %COOL + 1D2, the only options you'd have for %VARIABLE are 5 (4 + 1) and 6 (4 + 2), meaning there wouldn't be an option for you to have 1, 2, 3 etc.
So yeah, your script isn't wrong, but it isn't a script that will perform what I'm looking for.
I considered that and I could definitely do it, it's just that it'll take possibly unnecessary time to write out a segment of script for every possible value of %COOL, especially when the value of %COOL can be more than 100. Of course, if the 1D%COOL thing doesn't exist I can always write it out the long way, it's just a matter of "if there's a quicker way it'd be cool to know about it". Thanks for the response anyway!
I'll put it into more context here - like let's just say... uh, magic skill goes up as the story goes on, so instead of %COOL we've got %MAGICSKILL. At the end of the game, there's something you'll have to do - on the link that determines whether you do this action or not, if you have above 10 of %VARIABLE you succeed and if you have below/equal to 10 of %VARIABLE you fail. If %VARIABLE := 1D%MAGICSKILL, the higher magic skill you have the better chance you have of succeeding, but a higher magic skill will not necessarily guarantee that you succeed. Like a %MAGICSKILL of only 15 means you've only got a 1 in 3 chance of succeeding, but if you've got a magic skill of 40, you've got a 3 in 4 chance of succeeding.
With that being said, %COOL, or %MAGICSKILL, cannot be set to a random number because it reflects your choices throughout the game.
That's the perfect workaround! Thanks JJJ!
Now that I actually know how scripting works, thats genius.