Page 1 of 1

(mapping script) Generic GMCP Mapper Script

Posted: Fri Jul 09, 2021 3:42 am
by Blizzard
I was looking for a simple GMCP mapper script without a lot of extra game-specific features and I couldn't find one so I wrote one:
mapping.lua
(9.27 KiB) Downloaded 733 times
It is designed to work with a MMP XML map but seems to find new rooms fine on its own. Speedwalk works too. This is a very 1.0 version and I'm rather new to Mudlet Lua scripting, so I'm sure it isn't perfect.

Re: (mapping script) Generic GMCP Mapper Script

Posted: Fri Jul 09, 2021 10:33 pm
by Vadi
This was very much needed, thanks!

Re: (mapping script) Generic GMCP Mapper Script

Posted: Wed Sep 08, 2021 7:17 am
by Pixie
I am looking for exactly this, but I'm not sure how to use it. Do I need the generic mapper installed to use the map commands?

Re: (mapping script) Generic GMCP Mapper Script

Posted: Wed Sep 08, 2021 9:54 pm
by Pixie
Alright so! With minor adjustments this can be made to read and make rooms, even seeing which one you're in. The adjustments are:

- There's a small typo where 'vnum' is 'num.' Quick and easy to fix.
- Adjusted for 'exit' from 'exits' in one spot to suit my specific game's gmcp value

While it reads, makes, and sees which room you're in, the coordinates of all rooms seem to be 0,0,0, which seems to be what prevents the mapper from drawing.

Re: (mapping script) Generic GMCP Mapper Script

Posted: Mon Sep 13, 2021 10:09 pm
by Pixie
Solution: If this is run into by somebody else, what you'll want to do is check how your game sends exits versus how the script's move_vector grabs exits. On my end, move_vector used the long form of north, south, east, etc., while the game was sending n, s, e, etc. Crochety Coder via the Mudlet Discord spotted this, and by updating move_vector the mapper started setting coordinates and drawing rooms perfectly.

Re: (mapping script) Generic GMCP Mapper Script

Posted: Tue Feb 15, 2022 12:34 am
by Stack
Pixie wrote:
Mon Sep 13, 2021 10:09 pm
Solution: If this is run into by somebody else, what you'll want to do is check how your game sends exits versus how the script's move_vector grabs exits. On my end, move_vector used the long form of north, south, east, etc., while the game was sending n, s, e, etc. Crochety Coder via the Mudlet Discord spotted this, and by updating move_vector the mapper started setting coordinates and drawing rooms perfectly.
In my game's case, I had to rename anything "gmcp"-related to matching case (i.e., gmcp . Room . Info . name--> gmcp . room . info . name). gmcp . room . info . exits was correct for my case. I did need to change gmcp . room . info . environment to gmcp . room . info . terrain, as well as to keep gmcp . room . info . num as is for my case.

Anyway, I am now experiencing the 0,0,0 coordinate same issue around the mapping working perfectly but not actually drawing anything as I move about the world. I have tried both short and long form for the move_vetcor directions, but neither had any appreciable effect.

Could there be something else that I need to change for this to work?

Re: (mapping script) Generic GMCP Mapper Script

Posted: Tue Feb 15, 2022 4:42 am
by Stack
Indeed, what resolved this issue for me was changing gmcp . room . info . area to match my game's output of gmcp . room . info . zone. At that point, this began functioning perfectly.

Re: (mapping script) Generic GMCP Mapper Script

Posted: Mon Feb 21, 2022 4:27 pm
by Stack
if speedwalk is not functioning, below the local exitmap table add:

Code: Select all

local stubmap = {
    north = 1,      northeast = 2,      northwest = 3,      east = 4,
    west = 5,       south = 6,          southeast = 7,      southwest = 8,
    up = 9,         down = 10,          ["in"] = 11,        out = 12,
    northup = 13,   southdown = 14,     southup = 15,       northdown = 16,
    eastup = 17,    westdown = 18,      westup = 19,        eastdown = 20,
    [1] = "north",  [2] = "northeast",  [3] = "northwest",  [4] = "east",
    [5] = "west",   [6] = "south",      [7] = "southeast",  [8] = "southwest",
    [9] = "up",     [10] = "down",      [11] = "in",        [12] = "out",
    [13] = "northup", [14] = "southdown", [15] = "southup", [16] = "northdown",
    [17] = "eastup", [18] = "westdown", [19] = "westup",    [20] = "eastdown",
}
and in the handle_move function, change

Code: Select all

local dir = exitmap[n]
to

Code: Select all

local dir = stubmap[n]

Re: (mapping script) Generic GMCP Mapper Script

Posted: Tue Jul 05, 2022 4:38 pm
by Vadi

Code: Select all

exits = gmcp.Room.Info.exits
should be

Code: Select all

exits = table.deepcopy(gmcp.Room.Info.exits)
since it tries to manipulate the 'exits' key afterwards. See https://github.com/Mudlet/Mudlet/issues/6019

Re: (mapping script) Generic GMCP Mapper Script

Posted: Thu Sep 29, 2022 7:31 am
by Owl
I've been using this script on my (Envy 1.0-based) MUD and it is working relatively well. The issue I am having is that it won't create rooms properly if they don't have an exit back to the room I came from. For example, if I move south from a room into a room with no exit back north to the room I left, the new room will not be created. Has anyone had a similar issue, and if so, how did they solve the problem?

I have added all the 'fixes' suggested already in this thread, for what it's worth.

Thank you!