inkle / ink

inkle's open source scripting language for writing interactive narrative.
http://www.inklestudios.com/ink
MIT License
4.09k stars 491 forks source link

[Question] How to add new options dynamically to implement deeper examination #312

Open rubereaglenest opened 7 years ago

rubereaglenest commented 7 years ago

Hi,

I would like to emulate the kind of interaction that some parser games has in the scenery where you recursively examine deeper and deeper for names that appear in the examination. For example, a-la Lime Ergot, or in Emily's Metamophoses. That is, let me give you an example (sorry my bad prose):

You are in the bedroom. You can see the bed, the nightstand and the wardrobe. The lamps cast a warm light upon the tinted wallpaper. And your steps feel smoothed and cozy.

examine walls [the player chooses that option]

The walls have a beautiful green wallpaper. There are several pictures of the Covenant collection, a triptych over the bed, and two more pictures next to the door. On the opposite, the window closure don't let any alight to come through.

[we loop to the bedroom actions but now there are new options unlocked thanks to the previous examination.]

examine wallpaper. It has a tint of green with motives of birds, rampant dogs and the heraldic of the house.

[loop again, with new options]

examine birds.

They are crows.

You know the drill. I could do this in a nested traditional way, with a link to [Go back], but something more dynamic would be nice. Any idea?

rubereaglenest commented 7 years ago

oh, I have an idea. I could do this with custom variables and manually lock or unlock those options

{ wall_examined } [Examine the wallpaper]

it is not elegant or sophisticated but could do the job. Probably in this question it is better to go the simple way instead of doing something more complicated.

joningold commented 7 years ago

I usually do this with a combination of TURNS_SINCE and threads.

=== room

... will do what you need. But be cautious, the above will only let you do one of dogs or birds before those options disappear, and you won't be able to get them back (because you can't examine the wall again.) So I'd solve that using a thread:

=== room {TURNS_SINCE(-> looking_at_wall.done) == 0: <- looking_at_wall.details }

== looking_at_wall = intro Dogs, birds, all that. -> done = details

On Wed, May 10, 2017 at 11:09 AM rubereaglenest notifications@github.com wrote:

Hi,

I would like to emulate the kind of interaction that some parser games has in the scenery where you recursively examine deeper and deeper for names that appear in the examination. For example, a-la Lime Ergot, or in Emily's Metamophoses. That is, let me give you an example (sorry my bad prose):

You are in the bedroom. You can see the bed, the nightstand and the wardrobe. The lamps cast a warm light upon the tinted wallpaper. And your steps feel smoothed and cozy.

  • examine walls.
  • examine floor.
  • [As to bed]
  • [As to wardrobe]
  • [As to nightstand]
  • [As to door]

examine walls [the player chooses that option]

The walls have a beautiful green wallpaper. There are several pictures of the Covenant collection, a triptych over the bed, and two more pictures next to the door. On the opposite, the window closure don't let any alight to come through.

[we loop to the bedroom actions but now there are new options unlocked thanks to the previous examination.]

  • examine wallpaper.
  • examine pictures. *examine the window closure.
  • examine floor.
  • [As to bed]
  • [As to wardrobe]
  • [As to nightstand]
  • [As to door]

examine wallpaper. It has a tint of green with motives of birds, rampant dogs and the heraldic of the house.

[loop again, with new options]

  • examine birds.
  • examine painted dogs.
  • examine the heraldic.
  • examine pictures. *examine the window closure.
  • examine floor.
  • [As to bed]
  • [As to wardrobe]
  • [As to nightstand]
  • [As to door]

examine birds.

They are crows.

  • examine birds.
  • examine painted dogs.
  • examine the heraldic.
  • examine pictures. *examine the window closure.
  • examine floor.
  • [As to bed]
  • [As to wardrobe]
  • [As to nightstand]
  • [As to door]

You know the drill. I could do this in a nested traditional way, with a link to [Go back], but something more dynamic would be nice. Any idea?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/inkle/ink/issues/312, or mute the thread https://github.com/notifications/unsubscribe-auth/AA40o430w9QP8yeujuWa2Vocohhqedqlks5r4YzFgaJpZM4NWcug .

rubereaglenest commented 7 years ago

Oh! that's marvellous, I forgot I could label options. I think this will do the work really nice.

Thanks!

rubereaglenest commented 7 years ago

Hey! I got a medium approach that solves the issue for the first solution where the options disappear immediately after choosing one.

=== room

With this simple modification those options will be there forever to be chosen.

Neater:

=== room

Of course, this is only useful if you are happy with that concrete behaviour.