ainslec / adventuron-issue-tracker

Adventuron Issues Tracker
4 stars 0 forks source link

[FEATURE] new directions. #321

Open nww02 opened 3 years ago

nww02 commented 3 years ago

I'm trying to make an L9-style game which features directions other than N,S,E,W,NE,SE,SW,NW,U,D,Enter,Exit. I've had this problem before with ship-based games where you might want to have "fore","aft","starboard","port" (or "f,a,s,p"). I can handle it with a special on_command, but it would be nice if I could use the connections list and save all the hassle.

Imagine a boat with three locations, a Forecastle, mid-deck and a wheel-house, arrayed fore-to-aft.

These non-standard directions could be denoted by using ""'s around them, so any string could work as a direction. "aft", "a", "go aft" for example...

######################################
#  Connections                       #
######################################

connections {
   from, direction, to = 
   [  wheel_house, "fore", mid_deck,
      mid_deck, "fore", forecastle,
      forecastle,"aft",mid_deck,
      mid_deck,"aft",wheel_house ]
}

######################################
#  Vocabulary                        #
######################################

vocabulary {   
   : verb {   
      aliases = [aft,a];
   }
   : verb {   
      aliases = [fore, f];
   }
}
ainslec commented 3 years ago

Not exactly what you are looking for, but you can do this to redefine the direction verbs ...

      system_messages {
         compass = [north, northeast, starboard, southeast, south, southwest,  port, northwest, up, down, enter, exit]
         compass_short = [n, ne, e, se, s, sw, w, nw, u, d, in, out]
      }
nww02 commented 3 years ago

That's a cool feature to know. I didn't see "compass" in the auto-complete list. If I'm always on a boat, that'd be great, but if I step off the boat, or needed a location-specific verb, I could switch themes... It's an interesting workaround, thanks.. I'll maybe give that a try. Actually having the ability to create location-specific aliases to directions, or better-yet, creating a new word to link places together would be so much easier to code with than multiple themes...

Thanks for this, hadn't spotted compass, I'll check it out.

N.


From: Chris Ainsley notifications@github.com Sent: 08 March 2021 23:22 To: ainslec/adventuron-issue-tracker adventuron-issue-tracker@noreply.github.com Cc: nww02 nww02@hotmail.com; Author author@noreply.github.com Subject: Re: [ainslec/adventuron-issue-tracker] [FEATURE] new directions. (#321)

Not exactly what you are looking for, but you can do this to redefine the direction verbs ...

  system_messages {
     compass = [north, northeast, starboard, southeast, south, southwest,  port, northwest, up, down, enter, exit]
     compass_short = [n, ne, e, se, s, sw, w, nw, u, d, in, out]
  }

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ainslec/adventuron-issue-tracker/issues/321#issuecomment-793163310, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALFCUOP6VTUIL3JAEW5Q6ZTTCVL4BANCNFSM4YZEEWKQ.

ainslec commented 3 years ago

To simplify themes, use the extends = parent_theme in your theme.

I agree it's not ideal, but it's the quickest win for now. I won't close the issue.

nww02 commented 3 years ago

Good shout. I forget you can do that. I just tried the theme switching, and sadly it didn't change the direction messages.. Here's a demo you can try. head fore and then go to PORT to get off the ship. At some point the background will change to green, showing the theme has switched, but the direction words haven't:-

######################################

Adventuron

######################################

start_at = wheel_house start_theme = ship_theme

######################################

Booleans

######################################

booleans { on_ship : boolean default = "true" ; }

######################################

Themes

######################################

themes { ship_theme : theme { colors { border = #00f paper = #00f }

system_messages {
   compass = [fore,northeast,starboard,southeast,aft,southwest,port,northwest,up,down,in,out]
   compass_short = [f,ne,s,se,a,sw,p,nw,u,d,i,o]
}

}

land_theme : theme { colors { border = #0f0 paper = #0f0 } system_messages { compass = [north,northeast,east,southeast,south,southwest,west,northwest,up,down,in,out] compass_short = [n,ne,e,se,s,sw,w,nw,u,d,i,o] } } }

zones{ ship_zone : zone { locations = [ forecastle, mid_deck, wheel_house] } }

######################################

On Tick

######################################

on_tick { :if (is_at "ship_zone" != on_ship) { :if (is_at "ship_zone") { :print "welcome aboard"; :set_theme "ship_theme"; } :else { :print "welcome ashore"; :set_theme "land_theme"; } } :set_boolean var="on_ship" {(is_at "ship_zone")}; }

######################################

Locations

######################################

locations { wheel_house : location "You are at the wheelhouse at the back of the ship" ; mid_deck : location "You are on the mid-deck of the ship"; forecastle : location "You're on the Fo'csle of the ship, aka the pointy end."; gangplank : location "You're standing on the ricketty gangplank leading down to the shore."; jetty : location "You're standing on the jetty"; shore : location "You're standing on the shore"; }

######################################

Connections

######################################

connections { from, direction, to = [ wheel_house,north,mid_deck, mid_deck,north,forecastle, mid_deck, west, gangplank, gangplank, west, jetty, jetty, west, shore ] }

I also notice that there are some things which don't show up with ctrl+space, even when you're in the right place. compass and compass_short and good examples.

I can raise the theme switching as a new bug if you like. I had similar issues with fonts and font colours and theme switching... but we talked about that way back in 2019 I think...

N.


From: Chris Ainsley notifications@github.com Sent: 08 March 2021 23:40 To: ainslec/adventuron-issue-tracker adventuron-issue-tracker@noreply.github.com Cc: nww02 nww02@hotmail.com; Author author@noreply.github.com Subject: Re: [ainslec/adventuron-issue-tracker] [FEATURE] new directions. (#321)

To simplify themes, use the extends = parent_theme in your theme.

I agree it's not ideal, but it's the quickest win for now. I won't close the issue.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ainslec/adventuron-issue-tracker/issues/321#issuecomment-793173534, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALFCUOL5HXT7KUTUSIBJSYDTCVN6TANCNFSM4YZEEWKQ.

nww02 commented 3 years ago

Also, the compass_short seems to have a problem with 'a' being used for 'aft'... probably because 'a' is reserved..

image

if I change it to 'z' it works fine.

ainslec commented 3 years ago

There is an open issue for 'A'. I'll move it up the roster.

nww02 commented 3 years ago

There are bigger fish to fry 🙂 It's not important, I can live without 'a' for aft 🙂 hehe. 🙂


From: Chris Ainsley notifications@github.com Sent: 09 March 2021 00:49 To: ainslec/adventuron-issue-tracker adventuron-issue-tracker@noreply.github.com Cc: nww02 nww02@hotmail.com; Author author@noreply.github.com Subject: Re: [ainslec/adventuron-issue-tracker] [FEATURE] new directions. (#321)

There is an open issue for 'A'. I'll move it up the roster.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/ainslec/adventuron-issue-tracker/issues/321#issuecomment-793213110, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALFCUONSR4KYU3CO3RIHF5LTCVV77ANCNFSM4YZEEWKQ.

nww02 commented 3 years ago

I've managed to kinda solve this to my satisfaction. I've overridden the look and redescribe so that I print out my own exits list.

I've created a new trait "t_movementverb" and attached it to a hidden object in the room. The description is the actual verb, and the msg holds the target of the verb.

image

So, it's a hidden object, which I pick up in the subroutine which runs when the EXITS command is executed, which outputs a faithful L9 Exits list:

image

Then the final catch-all match looks for any use of the subject and executes the goto.

image

Note that even though I used "with_traits" in the disambiguate_s1, I STILL have to filter on the traits in the line below, because the "with_traits" doesn't seem to work in disambiguate_s1.

But the result is sweet as pie :)

test