Page 1 of 10

(mapping script) 3kingdoms Mapper

Posted: Tue Jun 21, 2011 5:07 am
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.

Re: (mapping script) 3kingdoms Mapper

Posted: Tue Jun 21, 2011 12:57 pm
by Vadi
(moved it and added a tag to the title, so Mudlets 'find mapping scripts' feature will locate it)

Re: (mapping script) 3kingdoms Mapper

Posted: Sun Jul 31, 2011 3:16 am
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!

Re: (mapping script) 3kingdoms Mapper

Posted: Mon Aug 01, 2011 12:18 am
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.

Re: (mapping script) 3kingdoms Mapper

Posted: Mon Aug 01, 2011 1:51 am
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!

Re: (mapping script) 3kingdoms Mapper

Posted: Tue Aug 02, 2011 4:44 am
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)

Re: (mapping script) 3kingdoms Mapper

Posted: Wed Nov 02, 2011 3:24 pm
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.

Re: (mapping script) 3kingdoms Mapper

Posted: Wed Nov 02, 2011 3:55 pm
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) :).

Re: (mapping script) 3kingdoms Mapper

Posted: Wed Nov 02, 2011 7:37 pm
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.

Re: (mapping script) 3kingdoms Mapper

Posted: Wed Jan 16, 2013 1:58 am
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,