Struggling with a few alias commands in the Mapper!! HELP!

Post Reply
trentont101
Posts: 17
Joined: Fri Jan 17, 2014 12:07 am

Struggling with a few alias commands in the Mapper!! HELP!

Post by trentont101 »

Howdy howdy howdy!!!!
I am currently playing swmud
swmud.org
port 6666

i believe its an offshoot of lpmud
andwho
Ive gotten a barely functional map program to work. Here is how it works now...
Start Mud, Activate all the scripts...Gyser box bottom right of screen..

alias
mapDELETE - deletes area, starts new map
mapROOM - deletes room, (i then follow my footsteps) , to fix CD problem
mapNEWAREA - DOESNT WORK, I want this to allow me to name the area (IE .. mapNEWAREA soleada)

mapDELETE and mapROOM are workin coo
mapNEWAREA not so much.....

is there a way I can use the alias mapNEWAREA(user input) so that I can input the name of the map directly into consol???

part 2.10
collision detection (CD) is not working. at first it recognized that there was a collision and it echoed a table to the screen... it was annoying... so i deleted it, now im regretting that. I would like to get collision detection working, i will post what I have of my script, if anyone can give me any pointers that would be SuPuRb!!!!
Even though CD is not working, the mapper continues to map, IE if there is no W, and I go W, the mapper goes W and continues to work (but obviously my spot is off by 1) this is why I build the mapROOM alias, so I can delete these rooms if i accidently go in that direction.
obviously this mapping method is rather irritating so I would LOVEEEEEE help!! I am not a great or even good programmer, but I can figure stuff out fast and im willing to put in some work :)
Thanks for reading and fixing all my problems and making my MUD life great
Trent


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!MAPPER SCRIPT!!!!!!!!!!!!!!!!!!!!!!!!!!

function mapperMoveRoom( id )
mapperRoomID = id
mapperPositionX, mapperPositionY, mapperPositionZ = getRoomCoordinates( id )
mapperAreaID = getRoomArea( id )

end

function mapperCheckExits( dir )
if not mapperRoomID then return false end
if not roomExists(mapperRoomID ) then return false end
local exits = getRoomExits(mapperRoomID);
if not exits then return false; end

if dir == "n" then
if table.contains(exits, "north" ) then
mapperMoveRoom( exits["north"] )
return true
end
end
if dir == "s" then
if table.contains(exits, "south" ) then
mapperMoveRoom( exits["south"] )
return true
end
end
if dir == "w" then
if table.contains(exits, "west" ) then
mapperMoveRoom( exits["west"] )
return true
end
end
if dir == "e" then
if table.contains(exits, "east" ) then
mapperMoveRoom( exits["east"] )
return true
end
end
if dir == "nw" then
if table.contains(exits, "northwest" ) then
mapperMoveRoom( exits["northwest"] )
return true
end
end
if dir == "ne" then
if table.contains(exits, "northeast" ) then
mapperMoveRoom( exits["northeast"] )
return true
end
end
if dir == "sw" then
if table.contains(exits, "southwest" ) then
mapperMoveRoom( exits["southwest"] )
return true
end
end
if dir == "se" then
if table.contains(exits, "southeast" ) then
mapperMoveRoom( exits["southeast"] )
return true
end
end
if dir == "up" then
if table.contains(exits, "up" ) then
mapperMoveRoom( exits["up"] )
return true
end
end
if dir == "down" then
if table.contains(exits, "north" ) then
mapperMoveRoom( exits["north"] )
return true
end
end
if dir == "in" then
if table.contains(exits, "in" ) then
mapperMoveRoom( exits["in"] )
return true
end
end
if dir == "out" then
if table.contains(exits, "out" ) then
mapperMoveRoom( exits["out"] )
return true
end
end

return false
end



function mapperMove( dir )
local _dir = 0; -- exit direction value see defines above
if not mapperCheckExits( dir ) then
if dir == "n" then mapperPositionY = mapperPositionY + mapperStep; _dir = 1 end
if dir == "s" then mapperPositionY = mapperPositionY - mapperStep; _dir = 6 end
if dir == "w" then mapperPositionX = mapperPositionX - mapperStep; _dir = 5 end
if dir == "e" then mapperPositionX = mapperPositionX + mapperStep; _dir = 4 end
if dir == "nw" then mapperPositionY = mapperPositionY + mapperStep; mapperPositionX = mapperPositionX - mapperStep; _dir = 3 end
if dir == "ne" then mapperPositionY = mapperPositionY + mapperStep; mapperPositionX = mapperPositionX + mapperStep; _dir = 2 end
if dir == "sw" then mapperPositionY = mapperPositionY - mapperStep; mapperPositionX = mapperPositionX - mapperStep; _dir = 8 end
if dir == "se" then mapperPositionY = mapperPositionY - mapperStep; mapperPositionX = mapperPositionX + mapperStep; _dir = 7 end
if dir == "up" then mapperPositionZ = mapperPositionZ + 1; end
if dir == "down" then mapperPositionZ = mapperPositionZ - 1; end


local roomCollisions = {}

if getAreaRooms( 1 ) ~= nil then
numRooms = getAreaRooms(1)
if # numRooms > 0 then




else

end
end
if table.size(roomCollisions) == 0 then

mapperRoomID_old = mapperRoomID
mapperRoomID = createRoomID();
addRoom(mapperRoomID)
setRoomCoordinates( mapperRoomID, mapperPositionX, mapperPositionY, mapperPositionZ )
setRoomArea( mapperRoomID, mapperAreaID )
setRoomEnv( mapperRoomID, 2 )
setExit( mapperRoomID_old, mapperRoomID, _dir )
setExit( mapperRoomID, mapperRoomID_old, mapperDirectionInvers[_dir] )

else

end
end
centerview( mapperRoomID )

end



!!!!!!!!!!!!!!!!!!!!!!!!! ALIAS SCRIPTS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

^mapADDAREA$
send("area added")
addAreaName(mapperAreaID)

^mapROOM$
x = getRoomsByPosition(1,mapperPositionX, mapperPositionY, mapperPositionZ)
deleteRoom(x[0])

^mapDELETE$
send("!!!MAP DELETED!!!")
deleteArea(mapperAreaID)



ugh im going nuts! thanks for helping!

Post Reply