From AardWiki

Main: HowToWriteARoomProgThatAllowsDisallowsMovement

The old way of doing things was to create a mob that stopped your travel in certain directions. With Lua, you can utilize room programs to stop players from moving in certain directions. It's tricky because you have to think of all the possible character combinations that a player might use to get to a room. Keep that in mind when you're editing the room. For example, up could be 'u', 'up', or 'go up' and all three commands need to be considered when creating the room progs.

 if mobexists("area-1",getroom("area-1")) then
   movechar(ch,"area-2")
   --- In this example, nothing is outputted to the character, but they just go up.
 else
   self = ch
   echo(ch.name .. " tries to climb up the tree, but breaks a branch.",ch)
   send(ch,"The tree is really young, there is nothing to hold onto really.")
 end
Retrieved from http://wiki.aardwolf.com/index.php/Main/HowToWriteARoomProgThatAllowsDisallowsMovement
Page last modified on January 19, 2009, at 11:55 PM EST