Thought I’d pick a less controversial topic on this one. I’m currently using *rand to create variable weather in my game. Very simple use of the command. Lots of excruciating writing; but, I’m having fun with it. What are some clever/creative uses of *rand that you all use? I’d love to learn more.
I love *rand. It’s all over The Parenting Simulator, from the option to randomize the story scenes you encounter to results for the SAT, television auditions and other things. Ideally you need to make sure people are able to influence the results significantly with their choices (one game that was less than ideal about this was Fielder’s Choice; it was already too reliant on luck and your stats had way too little impact on skewing probability one way or the other), but overall it’s a fun mechanic. Provided you remember to have a page break before the results show, of course. I imagine anyone who wrote with *rand encountered that stat page causing a reroll issue a time or two.
As for my most creative use of it, probably allowing for the random option of success for a surgery on your old and ailing pet in TPS, which is influenced by its age at purchase and whether you sprung for the emergency vet as opposed to waiting until they opened. Success isn’t very likely in any case, but I like to think that makes it more meaningful for those who do manage to buck the odds since they get to join the rare few who have a living pet in the endgame.
Heart of the House has a chapter in which (I believe) it’s used to determine the sequence of scenes that take place, meaning that one playthrough can be very different to another. I don’t know if it’s a particularly unusual use of *rand but I’ve used it to simulate a cartomancy reading in Royal Affairs which I enjoyed doing!
I coded a fully randomized, extensive character creation scene, using *rand, back when I was bored one weekend. (Including a half-done, species-specific name generator.)
I’ve also used it for the framework I did for having random encounters, and randomizing the flavour text for when you enter repeatable locations.
And for talking with companions/RO, when there’s no new special scene available.
Thats amazing! I love it! Oh my lord I would be riveted. After working as emergency technician for years I still love that you did that. Thank-you for your response. Yes make me feel!
Very cool thanks for your response! My use is very simple but some players get a storm, some don’t, of course with choices to react. I want to people talking about the game going what! That never happened on my play through! I can only hope
I used it in my WIP to randomize airship race results in a minigame. Probably a pretty typical usage, but I needed to program some looping code to do it, which I had never done with choicescript before, so that was challenging.
Weather randomization sounds really interesting, that’s a very cool use of the *rand function
Don’t forget to use the command well before you call the variable (i.e. at least one page break or choice separating the randomisation and when the variable appears in the game). Choicescript has a bug where opening and closing the stats screen rerolls all random variables on the page.
Yep I like some uses of *rand as well. It can add some game play uncertainty into what would otherwise be linear straightforward games. In Dragon Challenges I’m using weighted RNG’s depending mainly on your stats and prior choices to give some randomisaton to events including weather, battles, resources, theft and scene selection to try and give it more replayability. I’ve added in the ability to go around the RNG for scene selection, and also put in a difficulty slider so hopefully it’s customisable enough for people’s tastes.
Haha yeah. I found it interesting trying to get it to work without bugs when you start juggling multiple rand variables, especially when some continue to affect the game after they’re triggered.
I had this idea a day or so ago to use rand to create a handful of scenarios where you would run into different background characters as you’re going about your week. You would have a full conversation with them dialouge choices and all and learn something about characters you wouldn’t necessarily go out of your way to talk to ordinarily. My only concern is people missing a background character they actually do want to talk to.
Been using *rand commands for skill checks, which made a game more RNG based.
So that even if you have the highest stat possible for Strength, for example, you can still fail, however unlikely, and the same can happen the other way too, where your weakest stat can work out despite the odds.
I used *rand to generate a cheap version of AI for an opponent in a game of blackjack, to determine what the opponent will do next. Each opponent move is determined by a hidden dice roll, but the closer their hand is to 21, the less likely it becomes that they will take another card (unless the player already has 21 in their hand, in which case the opponent will always take another card).
Your code here is at risk of this bug! Put the *rand command last so that it’s actually rolling for the next hit instead of the current one (and put a single *rand at the beginning of the game before you need it). It’s the best way to avoid the issue.
There are several choices between that code and where my variable shows up, so I have ensured the bug won’t happen, but I agree there are probably better ways to do it.
As will is saying, I’d roll the rand well before you need it. Ideally set up the first roll at the very start of the game so it’s ready to go (don’t use temp). If you need to reroll the stats for the next use, do it as soon as possible where it will not interfere with the game being played. I could be wrong, but I think with that code, if someone goes to the stats page it will reroll and may flip from success to fail (or vice versa) which will probably confuse players. The roll needs to be at least on the other side of a choice or page_break to not keep rolling. (Or do you mean the player can’t see the result of the roll until a choice or two later in which case it doesn’t really matter if it keeps flipping as long as it doesn’t mess up your stat checks.)
If the player goes to the stat page when they first go to that page, they will reroll the result; however, since the result/variable isn’t displayed at the start of the page where the code is (it’s displayed later on after a few choices and page breaks), they won’t know that’s happening nor what the variable result is.
And I definitely should be using permanent variables instead of temps. (Doing temps you basically have to rewrite that every single page you do a stat check on and be careful how you arrange things to avoid that glitch/bug.)
I’m writing a cat breeding game for the IF Comp this year (PM me if you wanna help beta read it), and I use *rand to determine how many kittens each cat has (ranging from 1-5 kittens but with only two options for each cat as there are six possible mother cats and I wanted photos of very young kittens with each option). So the total number of kittens for the PC’s two mother cats ranges from 3 to 10.
This game has way more boolean variables than the norm, which is a pain in the neck. But worth it, because kittens.
You picked a topic I enjoy perhaps a bit too much. I have a project I’m working on, that’s in the background, where *rand is used extensively. I use it for scenes with the antagonist that’s hunting the Player Character, using it to randomly choose if the “bad guy” is coming after the PC or going after someone else. It’s crazy, but very enjoyable.
I also have another side project I’m working on, for learning purposes, where *rand is used to determine if certain actions succeed or not. Should the scene “fail,” it automatically draws up a response scene where more choices are presented.
So…I suppose I use *rand as my own version of a Literature AI.
Takes a lot of coding, doing it the way I do, but it’s something that gets my brain working.
Thanks arlo! I believe I will use it for monster encounters as well. Yes I’m sure you needed some *gosubs as well. My first loops got me very excited. They were just conversations, kind of boring. Sorry for my late response. Now a days I get more writing and coding done if I don’t browse the forum as much . My coding ability is new but I’m a fast learner; however, its clear that others code circles around me . Some really cool stuff. When i feel outplayed in that way I just try and think of clever ways to make my WIP novel, fresh, deep. Most of the time writing content achieves that goal. I hope. Shoot what do i know . Chioce script gurus will say ”KISS” and I repeat that to myself daily. After all, at some point I could just go play video games on steam right? Or just read a book. So I ask myself, “ how can I stand out?” And sometimes find myself crying in the corner feeling like i waisted a lot of time. Can’t wait to see one of your games published! Because thats the biggest challenge of all…finishing it