这个贴子不能沉
请教maper和ddid.mush的这个新地图功能用的什么数据库?和Zmud一样用的Mdb?还是别的? 数据库都应该可以。http://github.com/nickgammon/plugins/blob/master/ATCP_Mapper.xml这里可以看到表结构,其实和zmud的内容差不多。可以细细观察。表结构如下:function create_tables ()
-- create rooms table
dbcheck (db:execute[[
PRAGMA foreign_keys = ON;
CREATE TABLE IF NOT EXISTS areas (
areaid INTEGER PRIMARY KEY AUTOINCREMENT,
uid TEXT NOT NULL, -- vnum or how the MUD identifies the area
name TEXT, -- name of area
date_addedDATE, -- date added to database
UNIQUE (uid)
);
CREATE TABLE IF NOT EXISTS environments (
environmentid INTEGER PRIMARY KEY AUTOINCREMENT,
uid TEXT NOT NULL, -- code for the environment
name TEXT, -- name of environment
color INTEGER, -- ANSI colour code
date_added DATE, -- date added to database
UNIQUE (uid)
);
CREATE INDEX IF NOT EXISTS name_index ON environments (name);
CREATE TABLE IF NOT EXISTS rooms (
roomid INTEGER PRIMARY KEY AUTOINCREMENT,
uid TEXT NOT NULL, -- vnum or how the MUD identifies the room
name TEXT, -- name of room
area TEXT, -- which area
building TEXT, -- which building it is in
terrain TEXT, -- eg. road OR water
info TEXT, -- eg. shop,postoffice
notes TEXT, -- player notes
x INTEGER,
y INTEGER,
z INTEGER,
date_added DATE, -- date added to database
UNIQUE (uid)
);
CREATE INDEX IF NOT EXISTS info_index ON rooms (info);
CREATE INDEX IF NOT EXISTS terrain_index ON rooms (terrain);
CREATE INDEX IF NOT EXISTS area_index ON rooms (area);
CREATE TABLE IF NOT EXISTS exits (
exitid INTEGER PRIMARY KEY AUTOINCREMENT,
dir TEXT NOT NULL, -- direction, eg. "n", "s"
fromuid STRINGNOT NULL, -- exit from which room (in rooms table)
touid STRINGNOT NULL, -- exit to which room (in rooms table)
date_addedDATE, -- date added to database
FOREIGN KEY(fromuid) REFERENCES rooms(uid)
);
CREATE INDEX IF NOT EXISTS fromuid_index ON exits (fromuid);
CREATE INDEX IF NOT EXISTS touid_index ON exits (touid);
]])
[ 本帖最后由 killunix 于 2010-5-21 09:10 PM 编辑 ] 尝试了一下mush的mapper,只找到ATCP的,下了个atcp_mapper.xml加载,结果提示需要ATCP_NJG。
MUSHclient mapper installed, version 2.0
Plugin 'ATCP_NJG' not installed. Attempting to install it...
--------------------------------------------------------------------------------
Plugin 'ATCP_NJG' not installed. Please download and install it.
It is required for the correct operation of the ATCP_Mapper plugin.
--------------------------------------------------------------------------------
找到ATCP_NJG.xml,加载过程中报错。
D:\MUSH3\worlds\plugins\ATCP_NJG.xml
第 9 行: Attribute name 'xml' not followed by '=' (Cannot load)
查到代码为这行:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
有问题吗? maper和ddid测试用的是ATCP的还是非ATCP的? 不用ATCP 用Gammone的Simple_Mapper.xml就可以了,但需要自己改不少东西。
还要注意数据库,如果用Access做数据库,没什么问题,如果用SQLite做数据库,MUSH中的SQLITE数据库操作函数在中文处理上有个BUG,正在向Gammon提交BUG,请Gammon他老人家修改。
到最新的MUSH 4.66,还没改好 …… hzw
新人学习ing
请教下Simple_Mapper.xml,哪里下载。具体如何应用呢?新人学习学习。 右键天书。 原帖由 littleknife 于 2010-11-1 17:45 发表 http://pkuxkx.net/forum/images/common/back.gif
请教下Simple_Mapper.xml,哪里下载。具体如何应用呢?
新人学习学习。
在Gammon的论坛,搜索 "generic graphical mapper module" 这个模块年前准备重写lua代码的时候看过。
那时似乎没提到可以有完善的寻路功能?