Feeling around in the dark

I created a rudimentary system for feeling around in the dark a while back, but as I learn more, I keep refining my systems and wanting to make them much better quality. (especially since I intend to share some of them as part of a bigger project).

I have a command "DarkFeel" which is meant to be used when a player enters a dark room and there are objects in the dark. It was inspired by hearing a blind person talk about playing text adventure games and saying "so what?" about the fact that you can't do anything in most text adventure games when it's dark... because they obviously get around fairly well in the dark all the time.

I'm looking to try to really upgrade and do this well though. I have other sense commands, taste, smell, listen, etc. If I can get the "feel" to work well, then I can easily update the other senses to check the lighting in the room and of the object, then either do the dark description or the sighted description for those objects.

I'm thinking that it might be good to create a modified version of the "PickOneChild" that removes light objects and the player, rather than removing dark objects from the return of of the function it calls, and then returns that.

I have an idea that I can set an attribute lastinterractedindark set on the room for the object found by feeling/smelling/listening, which would allow the player to attempt a regular command on that object and see what happens.

Since this can all be integrated into my core3 project, I can easily add fields in the tabs to provide the appropriate dark descriptions if wanted.

Anyway, I don't yet fully understand enough about working with the lists, and I can't find "GetDirectChildren" to make a "GetDirectDarkChildren" version. but maybe it can all be done in the "feel" and turning "PickOneChild" into "PickOneDarkroomChild" function? It would be a lot more complicated to have to run checks to see if it's an object that's lit, and then try again... and I am not sure how to program it to "keep trying 'till you get something not light." So I'd really like to find a way to modify that GetDirectChildren with something like "RemoveLightObjects" rather than "RemoveDarkObjects."

Here's what I've got of the "DarkFeel" command so far

isDark = CheckDarkness()
if (isDark) {
  game.pov.parent.lastineractindarkness = PickOneChild (game.pov.parent)
  if (HasAttribute(game.pov.parent.lastineractindarkness, "darkfeel")) {
    do (game.pov.parent.lastineractindarkness, "darkfeel")
  }
  else {
    if (GetBoolean(game.pov.parent.lastineractindarkness, "lightsource")) {
      if (HasAttribute(game.pov.parent.lastineractindarkness, "wthrobj")) {
        if (HasAttribute(game.pov.parent.lastineractindarkness, "touchdesc")) {
          do (game.pov.parent.lastineractindarkness, "touchdesc")
        }
        else {
          msg ("So far all you feel is the weather...")
        }
      }
      else {
        if (HasAttribute(game.pov.parent.lastineractindarkness, "touchdesc")) {
          do (game.pov.parent.lastineractindarkness, "touchdesc")
        }
        else {
          msg ("You accidentally feel something you can see, while feeling around for something you can't see.")
        }
      }
    }
    else {
      msg ("You touch something in the dark, but can't tell what it is by feeling it.")
    }
  }
  if () {
  }
}
else {
  msg ("When you can see the objects around you, you can just tell me what you'd like to feel.")
}

There's something going on where the exits aren't working as well here as in the old system. Original system here: https://textadventures.co.uk/forum/samples/topic/ynkakaw6v0sxe-skte46ta/feeling-around-in-the-darkness

If the light-object-removal system can be made well though, then that line could be taken out, and the player would naturally only type "Feel object" for the ones they can actually see (if there are any) in the darkness. They'd type "feel" for feeling around in the dark.

Please and thanks for any help/advice.


Log in to post a reply.

Support

Forums