Page 1 of 1
Minimal mapping script
Posted: Thu Sep 03, 2015 5:25 pm
by keevitaja
Hello!
I am trying to create a mapping script, i think it throws lua error.
mudlet = mudlet or {}; mudlet.mapper_script = true
function readNewRoom()
local info = gmcp.room.info
addAreaName(info.zone)
addRoom(info.num)
setRoomCoordinates(info.num, info.coord.x, info.coord.y, info.coord.z)
setRoomArea(info.num, info.zone)
centerview(info.num)
print("Mapper test: " .. info.zone)
end
registerAnonymousEventHandler("gmcp.room.info", "readNewRoom")
How can i display errors and/or what is wrong with this script. If i comment mapper functions the mapper test print works!
Re: Minimal mapping script
Posted: Thu Sep 03, 2015 7:25 pm
by Belgarath
Hey Keevitaja,
I notice you're using GMCP, which is generally an IRE thing. Mudlet has an IRE mapping script already and it is kept up-to-date with lots of useful functionalities. You can view it
here.
In answer to your question, you can display errors by clicking on the Errors or Debug window within the Mudlet editor.
I'm not too familiar with GMCP, but I think the event handler would be
gmcp.Room.Info, with the caps.
Re: Minimal mapping script
Posted: Thu Sep 03, 2015 7:46 pm
by keevitaja
what is IRE?
I am playing aardwolf... and gmcp variable is correct in my script!