|
Phanku Novice
Joined: 09 Oct 2003 Posts: 40
|
Posted: Fri Oct 21, 2005 12:42 pm
A Real Challenge for you |
Okay Gurus out there.. I need help once again.
Here is the deal, I play on 3K and there is a few areas that when you enter them you end up in a random location with in the area. Well I have these area's mapped, however it takes me a good 10-15 minutes to locate where I am on the map so I then know where I am and how to get out.
Okay so here I am asking for mega help. I am not that bad at scripting in Zmud and I have made a few scripts that are pretty kick ass. But I have no idea how to do the whole Mapquerys or even how to start to find where i am on a map.. So to give you guys help I have map an image of a map of one area where when you enter it (through a toilet that some one flushes once you get into it) you end up in a random spot on the map (the sewers). The up exits are the actual exits out of the area.
Here is a few examples of the room description.
Quote: |
Sewer Maze
Sewer Maze
Sounds echo off the endless concrete walls of this maze. The smell of
the maze is so strong that it nearly brings a tear to your eye. The
once smooth concrete walls of the sewer are now pitted and cracked. To
the west you make out that the sewer continues.
There are two obvious exits: north, west
|
Quote: |
Sewer Maze
Sewer Maze
The sounds of wailing beasts can be heard echoing off the old walls.
Small puddles in the floor ripple as you disturb their peace. The
sounds of your footsteps echo off the sewer walls.
There are three obvious exits: south, west, east
|
The room descriptions are reused over and over again in random rooms so the exits are the only real way to figure out where you are. The only way I could figure out how to locate my self on this map was to use the room exits.
First I would see what exits are in the room I started in and some how populate a list of all the rooms in the zone that have the same exits. Then move one direction and populate another list of rooms that have the same exits plus the connection to the last room. Would probably have to do this a few time to actually locate where you are. I have no idea how to do this. Just even feed back would be great. Thanks guys
Phanku |
|
|
|
Vodoc Apprentice
Joined: 11 Apr 2003 Posts: 119 Location: Sweden
|
Posted: Fri Oct 21, 2005 8:20 pm |
I would suggest start by using %mapquery to get all rooms in the current zone with the right name. Proceed by looping through all rooms and use %roomexit to match if you got the same exits as in your current room. That's a start. Read the help for both those functions, I'm sure you can figure it out. And yeah, you can't use %roomexit on your current room since you don't know which one it is, you have to create a custom function to read the exits in your current room to match against all the mapped ones (there are several possibilities on how to do this).
|
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Oct 21, 2005 10:01 pm |
I am willing give you some snippets from my current child window mapping setup. I use "find" in my main window command line to tell the child window that it needs to locate me. Well it is a bit more then a snippet; I just can't be bothered to sperate out the pertinent portions, the aliases Step and MovementCompleted are called by my main window. MovementCompleted contains an example or 2 of the type of searching you want; I included Step so you would be able to have an idea what the flags on my "find" command are.
#CLASS {MapCreator}
#ALIAS Step {#IF (%trigger(AutoMapper)) {#MENU {Mapper|File|Follow Mode}};#NOOP %maplocked(0);LinkPretext="";LinkSubText="";RoomFlags="";RoomVnum="";PossibleRoom="";#IF (%ismember(@Veroule.LastDir,"north|south|east|west|up|down")) {DirQueue=%left(@Veroule.LastDir,1)} {#IF (%ismember(@Veroule.LastDir,"northeast|southeast|northwest|southwest")) {DirQueue=%concat(%left(@Veroule.LastDir,1),%copy(@Veroule.LastDir,6,1))} {DirQueue=@Veroule.LastDir}};#IF (%ismember(@DirQueue,"n|s|e|w|ne|se|nw|sw|u|d|in|out")) {LinkedRoom=%roomlink(,@DirQueue);ReverseDir=%reversedir(@DirQueue);RoomPrev=%roomvnum();#IF (@LinkedRoom!=-1) {#NOOP "#VAR NewX {%map.GetRoom(%roomkey)}";#NOOP "#VAR ComTemp {@NewX.ExitDir(@zMapDirType(@DirQueue))}";#NOOP "#VAR NewX {}";#NOOP "#IF (@ComTemp.KindID=3) {";#IF (%roomcol(@LinkedRoom)=%colorname(blue)) {LinkPretext="swim"};#VAR ComTemp {}}} {#IF (%ismember(@DirQueue,"look|ql")) {LinkedRoom=%roomnum;RoomPrev="";ReverseDir=""} {#IF (@DirQueue="find") {LinkedRoom=-5;RoomPrev="";ReverseDir="";LinkSubtext="look"} {#IF (%portalenabled(@DirQueue)) {LinkedRoom=%portal(@DirQueue);#IF (@LinkedRoom=0) {LinkedRoom=-4};RoomPrev="";ReverseDir="";RoomFlags="P"}}}};#IF (@PathSet) {#IF (%item(@PathSet,1)=@DirQueue) {#DELNITEM PathSet 1}}}
#ALIAS MovementCompleted {#IF (@DirQueue) {RoomVnum=%eval(%mapvnum(%numrooms)+1);#IF (@LinkedRoom>-1) {#IF (%ismember(@DirQueue,"look|ql")) {RoomVnum=@LinkedRoom;onroomcreate} {#IF (%begins(@Veroule.RoomName,%roomname(@LinkedRoom))) {#IF (@Veroule.RoomDesc) {#IF (%begins(@Veroule.RoomDesc,%roomdesc(@LinkedRoom))) {RoomVnum=@LinkedRoom;#TELEPORT @RoomVnum}} {RoomVnum=@LinkedRoom;#TELEPORT @RoomVnum}}}};#IF (@RoomVnum!=@LinkedRoom) {PossibleRoom=%mapquery(%concat("([Name]='",@Veroule.RoomName,"') AND ([Desc]='",@Veroule.RoomDesc,"')"));#IF (@PossibleRoom) {#IF (%numitems(@PossibleRoom)=1) {#IF (%roomlink(@PossibleRoom,@ReverseDir)=@LinkedRoom) {ComTemp=1;NewX=@Veroule.RoomExit;NewY=@DirConvert(%roomexit(@PossibleRoom));#WHILE ((@ComTemp=1)&(@NewX!="")&(@NewY!="")) {#IF (%iskey(@NewX,%item(@NewY,1))) {#DELKEY NewX {%item(@NewY,1)};#DELNITEM NewY 1} {ComTemp=0}};#IF (@ComTemp) {#IF ((@NewX)|(@NewY)) {PossibleRoom=""}} {PossibleRoom=""};#IF (@PossibleRoom) {RoomVnum=@PossibleRoom;#TELEPORT @RoomVnum;#IF (@DirQueue!="find") {onroomcreate}} {#IF (@DirQueue!="find") {MakeRoom} {RoomVnum=@PossibleRoom;#TELEPORT @RoomVNum}}} {#IF (@DirQueue!="find") {MakeRoom} {RoomVnum=@PossibleRoom;#TELEPORT @RoomVNum}}} {#SHOW Multiple possibilties narrow down.;#FORALL @PossibleRoom {#IF (%roomlink(%i,@ReverseDir)!=-2) {#SHOW Exits nonlinking %i of @PossibleRoom.;#DELITEM PossibleRoom {%i}}};#FORALL @PossibleRoom {#SHOW Verifying %i;ComTemp=1;NewX=@Veroule.RoomExit;NewY=@DirConvert(%roomexit(%i));#WHILE ((@ComTemp=1)&(@NewX!="")&(@NewY!="")) {#IF (%iskey(@NewX,%item(@NewY,1))) {#DELKEY NewX {%item(@NewY,1)};#DELNITEM NewY 1} {ComTemp=0}};#IF (@ComTemp) {#IF ((@NewX)|(@NewY)) {#DELITEM PossibleRoom {%i}}} {#DELITEM PossibleRoom {%i}}};#IF (%numitems(@PossibleRoom)>1) {#SHOW Double fault} {#IF (@PossibleRoom) {#SHOW Exits matched @PossibleRoom.;RoomVnum=@PossibleRoom;#TELEPORT @RoomVnum;#IF (@DirQueue!="find") {onroomcreate}} {#IF (@DirQueue!="find") {MakeRoom}}}}} {#IF (@DirQueue!="find") {MakeRoom}}}};#IF (@PathSet) {#T+ SlowWalkMovement}}
#CLASS 0 |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
chris-74269 Magician
Joined: 23 Nov 2004 Posts: 364
|
Posted: Mon Oct 24, 2005 1:09 am |
whee more sewer bots on 3k
|
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|