(mapping script) 3kingdoms Mapper

All and any discussion and development of the Mudlet Mapper.
User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

(mapping script) 3kingdoms Mapper

Post by chris »

If anyone from 3k can't wait to map, here is a working version of a mapper. It isn't fully complete yet, but it's very usable.

The most recent version can be found here:
https://github.com/Chris7/3k-Scripts

And help can be found here:
https://github.com/Chris7/3k-Scripts/wiki

Look around, there are a ton more aliases/etc I don't feel like documenting. Thanks to the WOT mapper and Vadi's mapper for some code snippets.
Attachments
3k Mapper.xml
(50.97 KiB) Downloaded 1810 times
Last edited by chris on Wed Aug 03, 2011 2:03 am, edited 5 times in total.

User avatar
Vadi
Posts: 5048
Joined: Sat Mar 14, 2009 3:13 pm

Re: (mapping script) 3kingdoms Mapper

Post by Vadi »

(moved it and added a tag to the title, so Mudlets 'find mapping scripts' feature will locate it)

Daagar
Posts: 89
Joined: Fri Feb 19, 2010 2:42 am

Re: (mapping script) 3kingdoms Mapper

Post by Daagar »

Based on the lack of comments here, I'm guessing others may have already figured this stuff out, but I'm a tad slow and it took me a bit of effort to get this working. Note that I'm on a Windows platform.
  • In scripts->Helper Functions, I had to add the following function:
    Code: [show] | [select all] lua
    function Set(t)
      local s = {}
      for _,v in pairs(t) do s[v] = true end
      return s
    end
  • In Scripts->Sql Initiator, I had to change lines 48 and 50 as follows (hence my note about being on Windows):
    Code: [show] | [select all] lua
    local loc = string.find(dir, "[\\]profiles[\\]")
    local file = getMudletHomeDir().."\\"..profilename.."_map.sqlite3"
  • In scripts->Room Checking Functions, I had to add the following to the very top of the checkExit function. Without this, it would fail to ever create the very first room when using the 'firstroom' alias:
    Code: [show] | [select all] lua
    if roomId == nil then 
    	return nil
    end
  • I added an alias to call makeSqlDB(). You can add one for dropSqlDB() as well, just be careful!
  • Within the MUD itself, you can add the special unique identifier with the following command (I hadn't even realized such a thing was doable in 3k, so it took me a bit to find):
    Code: [show] | [select all] lua
    aset room_short_suff Ñ
    If you choose a different character, make sure you also change Scripts->Helper Functions->convertRoomName()
Getting Started:
  • Login to 3k
  • Do the aset command to set the unique room suffix if you haven't already
  • Run your 'makesqldb' alias to prep the database (you only do this once!)
  • Choose a sane starting location. IE., maybe not in the login room.
  • Open the Map in mudlet via the toolbar
  • Type 'mtoggle' to enable mapping
  • Type 'firstroom'
  • Move in an available direction.
Ta da!

There are a couple limitations after some _very_ brief testing (and thus, might be my own problem):
  • The script detects collisions, but can't do anything about them. You need to delete/move rooms around manually.
  • It doesn't appear support for Areas is in (yet?)
I haven't used it extensively yet, but was so excited to see that chris went to so much effort to get something working that I had to make it work for myself (he even brought over the special exit syntax from CMUD... wooooo!). Thanks chris!

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: (mapping script) 3kingdoms Mapper

Post by chris »

There is support for room collisions. If there is a collision it halves your room scale and puts the room there. I'll aggregate my latest additions (a lot) and post them in a day or 2.

Daagar
Posts: 89
Joined: Fri Feb 19, 2010 2:42 am

Re: (mapping script) 3kingdoms Mapper

Post by Daagar »

Thanks, figured that out after I started a clean map - I had corrupted the first one getting it working :)

Very interested to see your updates!

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: (mapping script) 3kingdoms Mapper

Post by chris »

I put in an update. Some more config parameters: in Mapper Variables, tkm.specialChar you can set to your special character (obviously change the trigger to use this one too). You can also set your map scale in there as well. Following works, and the speedwalker waits for room confirmations as well (later this can be used to add delays)

DevArrah
Posts: 51
Joined: Sat Oct 29, 2011 4:57 pm

Re: (mapping script) 3kingdoms Mapper

Post by DevArrah »

here's a bit of hard won experience. If you use the special exit command (>trueexit>dirOnMap), dirOnMap must be the long form of the direction
So >portal>s causes the mapper to go into hysterics but >portal>south gets the room made.

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: (mapping script) 3kingdoms Mapper

Post by chris »

I opted not to allow shortcuts because there are corner cases where that behavior might be bad (such as an evil area maker having all special exits with names like 'e' :)). Also, I'll upload an updated mapper. I started from scratch with a new profile to make my mapper more user friendly (like automatically setting ansi up).

Also, my scripts will be packaged into the binary for the next release with an icon (for 3s) :).

DevArrah
Posts: 51
Joined: Sat Oct 29, 2011 4:57 pm

Re: (mapping script) 3kingdoms Mapper

Post by DevArrah »

I'm not sure how final your scripts are but I'd love to collaborate with you on them. I've been rolling deep in the code so if there are some issues to resolve, I wouldn't mind pitching in.

Slayd
Posts: 102
Joined: Mon Jul 25, 2011 4:57 am

Re: (mapping script) 3kingdoms Mapper

Post by Slayd »

Chris, is there a readme file that discusses how to set up your mapper?

I've got the 3k Mapper in the default 3 Kingdoms profile for Mudlet 2.1. Is there another package I need to make it work for me?

Thanks,

Post Reply