Twine Version: 220.127.116.11
Hello to all…
In my story, the startup passage is initializing many variables for use in the game. In one section there, it chooses a random temperature for each of the 27 main passages the player would revisit often. The code I’m using there for each passage is
(set: $passageTemperatureIndustry to (random: 1,100)) (set: $passageTemperatureStore to (random: 1,100)) (set: $passageTemperatureRestaurant to (random: 1,100))
For each, of course, I’m only changing the name of the location.
As the player enters these spaces, the temperature of the passage (or environment) will push the player’s body temperature up or down by a few degrees. The body temperature, in turn, has an affect on the player’s happiness which, in turn, has an affect on how this player’s character is able to interact with the world.
And all of this code is working properly. I’ve tested it over and over and over again and it is working. The reason I’m making this post, however, is because the randomness doesn’t seem so random. I notice when I play through this story, the 27 main passages all tend to get assigned temperature values that are similar to one another.
In one playthrough, I notice that most of the passages have been assigned very high values (89, 96, 100, 94, etc., etc.) and, from this, the character’s body temperature gets pushed really high very quickly and then stays there. This causes happiness to go down, eventually to zero, where it stays. In another playthrough, the 27 main passages will all be assigned lower values (27, 14, 32, 18, etc., etc., etc.) and the character’s temperature stays very low for the duration of the game.
I’m looking to create more randomness within those assigned values so they would reflect a wider range (15, 88, 32, 97, 72, 53, 8, etc., etc. etc.). At this time, the only thing I can think that could help is to have the system assign the values for temperature NOT in the startup passage, but as you are entering the passage itself. So Restaurant, for example, wouldn’t have a temperature assigned during startup but would get a value assigned the first time you visit Restaurant.
Can’t help but think, though, that there would be an easier way to pull this off. I’m not manipulating a seed so maybe that’s the ticket? If so, I’m not sure how to code that.
Can any of you make suggestions that would provide more random values to that code or should I just assign the values as the player enters the spaces for the first time?