|
kslwwein Newbie
Joined: 22 Nov 2021 Posts: 1
|
Posted: Mon Nov 22, 2021 3:08 pm
Capturing Randomness |
So there’s a point in “my” game where one location, #open-desert, is a boundless area; it loops back to itself, but varies the text description and some background objects every time you move.
Code: |
#open-desert
(room *)
(name *) Open Desert
(inherently dark *)
(look *)
(select)
Clouds of dust swirl through the air
(or)
The dust storm rages around you
(or)
Your tracks are swallowed up in moments by the billowing sand
(or)
The desert stretches around you in all directions
(at random)
, and
(select)
you shiver in the chill night air
(or)
you plod wearily through the sand
(or)
you wish you could see more than twenty feet in front of you
(or)
god damn it's dark
(or)
every inch of sand looks just like every other
(at random)
.
(par)
(visible flotsam $Flotsam)
(select)
All you can make out in the darkness
(is $Flotsam) (a $Flotsam)
(or)
You can sort of see (a $Flotsam)
(or)
Nearby: (a $Flotsam).
Nothing to write home about
(or)
Half-lost in the shadows, you see
(a $Flotsam)
and that's about it
(at random)
.
|
The problem with this is that if you look twice in the same room, the description changes.
So I was thinking; could it be possible to “capture” the RNG and restore it? Something like:
Code: |
(narrate entering *)
(collect $Flotsam)
*(desert flotsam $Flotsam)
(now) ($Flotsam is nowhere)
(into $List)
(shuffle list $List into $Shuffled)
(take 3 from $Shuffled into $Final)
(exhaust) {
*($F is one of $Final)
(now) ($F is #in *)
}
(now) (visible flotsam $Final)
(capture randomness $Random)
(now) (desert description randomness $Random)
(par)
(try [look])
|
and
Code: |
(look *)
(desert description randomness $Random)
(using randomness $Random) {
(select)
Clouds of dust swirl through the air
(or)
The dust storm rages around you
(or)
...
|
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4689 Location: Pensacola, FL, USA
|
Posted: Mon Nov 22, 2021 9:51 pm |
You can always just check the box for room description changes.
It's in configuration settings under config on the map window menu bar.
Configuration tab on the left.
Room Description tab along the top. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
faisal70 Newbie
Joined: 25 Nov 2021 Posts: 2
|
Posted: Thu Nov 25, 2021 6:10 am |
Hello, it is possible to intercept an RNG and restore it, you only need to check the box for changing the room description and then everything should be fine, I did and it works normally as it should, although I have been thinking for a long time how to do it and whether it is possible
|
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4689 Location: Pensacola, FL, USA
|
Posted: Thu Nov 25, 2021 10:58 am |
It is possible, but unless you are going to be doing anything based on those details, I'm not sure I see the point.
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
|
|