Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
ToyMage
Apprentice


Joined: 01 Sep 2005
Posts: 120

PostPosted: Sun Aug 27, 2006 4:41 pm   

Auto Maze Walker
 
Okie I haven't figured how to do this at all... Clueless...

There is a maze in my mud which is called The Void. There are markers in the maze which we can look for which shows the right direction. The markers are usually a pile of coins. So I 'Look North|South|East|West|Up|Down'

The exits are random too.

1) How do I capture the Exits available in the room?
2) How do I 'Look' through the available Exits?
3) How do I move in the Direction once 'A pile of gold coins' is found?

Thanks.



--------
The Void
[Exits: east south west up down]
You are suspended in cool electric space above a translucent plain. You feel synesthesia invading your nerves and reshuffling your senses. The sky is the same obsidian color as the ground and you can't find a horizon.

<987/987hp 630/630mn 574/574mv 912exp> Look up

The Void
[Exits: north east west up down]
You are suspended in cool electric space above a translucent plain. You feel synesthesia invading your nerves and reshuffling your senses. The sky is the same obsidian color as the ground and you can't find a horizon.
A pile of gold coins.
Reply with quote
ToyMage
Apprentice


Joined: 01 Sep 2005
Posts: 120

PostPosted: Sat Sep 02, 2006 6:45 am   
 
How can we capture the exits available in a room?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Sep 02, 2006 4:56 pm   
 
With a trigger.

#trigger {~[Exits: (*)~]} {#variable RoomExits %replace("%1"," ","|")}
_________________
EDIT: I didn't like my old signature
Reply with quote
ToyMage
Apprentice


Joined: 01 Sep 2005
Posts: 120

PostPosted: Sun Sep 03, 2006 3:54 pm   
 
hmm,

how to make it 'Look' through the exits available?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Sep 04, 2006 3:28 am   
 
Depends on how you want to do it. I'd suggest not using a loop at all, since there'd be no way to really stop the loop at the correct time if you found a way to go. Therefore, in the above trigger, I'd use the %item() function to send the first direction.

I'd then make a second #trigger to match what was displayed by the LOOK command (if the only directions to move are NSEW types instead of non-standard types, you can limit this pattern to "look %t"). This would be a multistate trigger that started out matching the look command, with subsequent states matching the output generated. The #condition for "a pile of gold coins" would set a #variable to 1. The prompt condition would then use an #if command to check this variable. If true, then the direction captured in the zero-state would be sent to the mud and for neatness's sake the RoomExits variable would be set to "". If false, then a #DELNITEM command is needed to flush out the direction you already moved from RoomExits before using another %item() to look in another direction.
_________________
EDIT: I didn't like my old signature
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net