Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: sea-charts: A narost derivative for OSA

  1. #1

    Default sea-charts: A narost derivative for OSA

    2022-11-30: Should now work with Lich5/GTK3 as well as Lich4/GTK2

    Actually, two scripts....

    osa-map-plugin - a map data provider for OSA rooms.
    • If running Lich 4.x: This needs ;trust or the classes won't be available to other scripts, such as sea-charts.
    • Map data currently inline. At some point, I should move it to an external data file.
    • Exposes OsaMap (equivalent of lich's Map) and Ocean (equivalent of lich's Room)
    • "equivalent", not identical, classes. More notes at the end for the scripters who are interested. Most users won't need to read that
    • On exit, stores the last known room for next startup.


    sea-charts - the actual narost clone
    • If running Lich 4.x: This needs ;trust because it will download and display the map
    • Doesn't support displaying tags (there's very few in the data, anyhow)
    • Doesn't support click-room to sail there
    • Currently uses a basic map with room numbers.
    • Want the fancy map?
      • Download Arianiss's pretty map from the wiki.
      • Save it to your maps directory
        • Don't know where that is? Run ";eq echo MAP_DIR" to find out.
      • start sea-charts with the --fancy flag - ";sea-charts --fancy"
    • If your current room is known, you get a little ship icon.
    • If your current room is unknown, but you've been in a known room, marks the last known room with question mark icon.


    Use:
    Code:
    ;repos download osa-map-plugin
    ;repos download sea-charts
    ;osa-map-plugin
    Then, when you're sailing
    Code:
    ;sea-charts
    You'll need to look at the map in the captain's quarters at least once after you've launched.

    I keep trying to cram in one-more-thing. If you hit any issues, post here and I'll address them.



    Scripty stuff for those who care below here - most folks don't need this


    Ocean is just a sub-class of OsaMap - these notes apply to both.

    OsaMap class level members -it is kinda like Map, but not an exact clone
    • current -> returns the current map room
      • So long as osa-map-plugin is running, it will do its best to keep all of those up-to-data.
      • See set_current() if you'd rather manage it.
    • lastknown -> returns the last map room that was actually mapped
      • So long as osa-map-plugin is running, it will do its best to keep all of those up-to-data.
      • See set_lastknown() if you'd rather manage it.
    • list -> returns a list of all rooms
    • OsaMap[n] -> gets room with id n
    • set_current() -> sets a given room (by id) as current
    • set_lastknown() -> sets a given room (by id) as lastknown


    OsaMap instance members
    • column -> returns the map column for the room
    • dijkstra() - dijkstra pathing algoritm for reaching one or more rooms
      • path_to() is a thin wrapper and generally more friendly
    • inspect -> dumps the instance data
    • is_mapped? -> true if the room has map coordinates
    • location - which ocean the room is in
    • make_current() -> sets the instance as `current` for OsaMap
      • osa-map-plugin should manage this, but here if you want to use it
    • make_lastknown() -> sets the instance as `lastknown` for OsaMap
      • osa-map-plugin should manage this, but here if you want to use it
    • map_coords -> a hash that gets to column and row
    • maphash -> MD5 of the in-game map used to kinda uniquely identify the room
      • These aren't entirely unique. There's ~10 pairs of rooms that hash identical even also matching on location
    • path_to(int or int[]) ->
      • if given an int, returns the shorest path to the room with that id
      • if given an array, returns the shortest path to the nearest room in the list.
        • no guarantees on which room if multiple are equidistant
      • because of the grid like map, multiple routes can have the same cost, no guarantees on which is used
      • returns nil if there is no path available
    • row-> returns the map row for the room
    • to_i -> alias to get the room id
    • to_s -> gets a short string for identifying the room
    • tags -> a list of string tags. Mostly unused, but bugged rooms are tagged "bugged" and ports are tagged "Port of {Town}"
    • wayto -> :cardinaldirection to adjacent room map
    Last edited by Jymamon; 12-02-2022 at 07:36 PM. Reason: Clarify some wording. Put the 'doesn't support' at the top of the lists.

  2. #2

    Default

    Well I guess this is replacing ;ocean-go2

    Awesome script.

  3. #3

    Default

    Well I guess this is replacing ;ocean-go2
    This doesn't have ;go2 functionality, though the underlying map provider supports everything you need if you want to simplify ;ocean-go2. It'll manage the map and routing, you'll still need to do all the anchor, sail, and wheel management, etc
    Last edited by Jymamon; 11-27-2022 at 07:17 PM.

  4. #4

    Default

    Added saving/restoring lastknown for next startup.

  5. #5
    Join Date
    Mar 2008
    Location
    Virginia, USA
    Posts
    282

    Default

    Jymamon,
    I just thought I'd point out that ;trust isn't needed if running newer versions of Ruby (which most people likely are due to upgrading to Lich5). It's an old system of protection that really didn't do much and was removed in current versions of Ruby. The EO team is actually prepping the next version of Lich to be compatible with Ruby v3 which actually has issues with $SAFE variable which is what ;trust was setting and therefore removing it completely from most all scripts that reference it. Just thought I'd mention it for you.
    Websites
    Lich Wiki Info
    EO Scripts Github Repository - Collaborative script development by the community.
    EO Lich5 Github Repository - Collaborative Lich Development for GS4 & DR for modern Ruby.
    Elanthia Online Forums Archive

    Player of Tysong

  6. #6
    Join Date
    Mar 2008
    Location
    Virginia, USA
    Posts
    282

    Default

    Btw, this is really great code. Looking forward to using it myself the next time I take my carrack out on the ocean! Nicely done.
    Websites
    Lich Wiki Info
    EO Scripts Github Repository - Collaborative script development by the community.
    EO Lich5 Github Repository - Collaborative Lich Development for GS4 & DR for modern Ruby.
    Elanthia Online Forums Archive

    Player of Tysong

  7. #7

    Default

    I just thought I'd point out that ;trust isn't needed if running newer versions of Ruby
    Good to know. I'm running newer stuff on my work machine, but never upgraded at home. I'll use this as motivation to finally do that and update the instructions. Thanks!

    Btw, this is really great code.
    Thanks.

  8. #8

    Default

    Fixed for GTK3 - should now work with both Lich 4 and Lich 5
    Updated a few rooms around Ta'vaalor that were wrong and/or have changed.

  9. #9

    Default

    not sure whats the issue but every time i open up sea-charts and i try to click a room, my wizard client crashes

  10. #10
    Join Date
    Mar 2008
    Location
    Virginia, USA
    Posts
    282

    Default

    Quote Originally Posted by Silvanostar View Post
    not sure whats the issue but every time i open up sea-charts and i try to click a room, my wizard client crashes
    Quote Originally Posted by Jymamon View Post
    Doesn't support click-room to sail there
    It doesn't support click support as per the original announcement. Not yet at least. So for right now it's more just a reference guide to where you are for visual purposes.
    Websites
    Lich Wiki Info
    EO Scripts Github Repository - Collaborative script development by the community.
    EO Lich5 Github Repository - Collaborative Lich Development for GS4 & DR for modern Ruby.
    Elanthia Online Forums Archive

    Player of Tysong

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •