(mapping script) Generic GMCP Mapper Script
(mapping script) Generic GMCP Mapper Script
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:
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
This was very much needed, thanks!
Re: (mapping script) Generic GMCP Mapper Script
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?
Last edited by Pixie on Wed Sep 08, 2021 10:09 pm, edited 2 times in total.
Re: (mapping script) Generic GMCP Mapper Script
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.
- 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
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.
- Stack
- Posts: 10
- Joined: Tue Feb 15, 2022 12:12 am
- Location: Las Vegas, NV
- Discord: Stack#4899
- Contact:
Re: (mapping script) Generic GMCP Mapper Script
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.Pixie wrote: ↑Mon Sep 13, 2021 10:09 pmSolution: 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.
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?
- Stack
- Posts: 10
- Joined: Tue Feb 15, 2022 12:12 am
- Location: Las Vegas, NV
- Discord: Stack#4899
- Contact:
Re: (mapping script) Generic GMCP Mapper Script
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.
- Stack
- Posts: 10
- Joined: Tue Feb 15, 2022 12:12 am
- Location: Las Vegas, NV
- Discord: Stack#4899
- Contact:
Re: (mapping script) Generic GMCP Mapper Script
if speedwalk is not functioning, below the local exitmap table add:
and in the handle_move function, change to
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",
}
Code: Select all
local dir = exitmap[n]
Code: Select all
local dir = stubmap[n]
Re: (mapping script) Generic GMCP Mapper Script
Code: Select all
exits = gmcp.Room.Info.exits
Code: Select all
exits = table.deepcopy(gmcp.Room.Info.exits)
Re: (mapping script) Generic GMCP Mapper Script
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!
I have added all the 'fixes' suggested already in this thread, for what it's worth.
Thank you!
Imm over at Dragons Domain MUD