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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
chosig
Novice


Joined: 20 Apr 2008
Posts: 39
Location: Sweden

PostPosted: Mon Jul 21, 2008 8:02 pm   

[2.32] Need help with a dead easy to mapper script
 
Code snips first...

General room
Code:
{rname}The Finishing Blow
{coords}-1
{rdesc}
  You've entered a small, quaint bar, with beat-up tables and little
decoration save a filthy fireplace.  There are 14 tables in the bar, only
three of which have customers.  The bar itself has one man seated alone.
This is likely the dirtiest place you've visited in Aylor.  It's no wonder
there is little patronage. 
{/rdesc}

{exits}[Exits: east west]


Room names with different flags
Code:
{rname}The Finishing Blow (G)
{rname}The Finishing Blow [**> PK <**]
{rname}The Finishing Blow [**> CMAZE <**]


Exit with a door in it - marked with parenthesis
Code:
{exits}[Exits: (east) west]


Messages related to opening doors...
Code:
Unlock failed: You do not have a key for the door.
  open failed: The door is locked and you do not have a key.
  walk failed: The door is closed.

  open success: You open the door.
unlock success: *CLICK*
unlockin a door not locked: The door is not locked.


I really need help with a fail-proof mapper script here... I'm not new to scripting, but the {} in the tags buggers the ... out of me, so does creating locked doors from a trigger.
Reply with quote
chosig
Novice


Joined: 20 Apr 2008
Posts: 39
Location: Sweden

PostPosted: Mon Jul 21, 2008 8:19 pm   
 
Oh, and it would be really nice if somebody could explain to me (if it's possible) to attach your own room flags to the mapper, like if a room is marked pk or cmaze - i do not want to enter them if it's possible, but i don't want to mark do-not-enter...
Reply with quote
Toxic
Adept


Joined: 27 May 2008
Posts: 299

PostPosted: Mon Jul 21, 2008 8:23 pm   
 
Ok first.
Code:

#TR {~{rname~}} {#SUB ""}
#COND {(*)} {#TAG name %1} {reparse}

That will tag your room name.

There is no reason to worry about the additional tags added to room names as they are 99.9% stationary. Let them be added to the room name in the mapper.

For Exits:
Turn off the exit tag, its basicly worthless for this purpose. And use.
Code:

#TR {^~[Exits:(*)~]} {#TAG exit %1}


In all reality you dont even need to tag the exits because the mapper does a good job of grabbing them.

Then, on all messages that might stop your speedwalk or movement into another room do this...

#TR {The door is closed.} {#NOMAP}
Reply with quote
Toxic
Adept


Joined: 27 May 2008
Posts: 299

PostPosted: Mon Jul 21, 2008 8:28 pm   
 
chosig wrote:
Oh, and it would be really nice if somebody could explain to me (if it's possible) to attach your own room flags to the mapper, like if a room is marked pk or cmaze - i do not want to enter them if it's possible, but i don't want to mark do-not-enter...
j

Use the %roomcost() function to set the roomcost to somewhere around 1000. That will keep the mapper from creating speedwalks that go thru that room unless it has to to get from point a to point b.

Something like
Code:

#TR {~[~*~*~> PK ~<~*~*~]$} {%roomcost(1000)}


I think you need to prefix %roomcost with a command like #SEND or something but not sure what it is... Maybe #RETURN.

Someone should be able to help you with that tho.
Reply with quote
chosig
Novice


Joined: 20 Apr 2008
Posts: 39
Location: Sweden

PostPosted: Mon Jul 21, 2008 8:39 pm   
 
Thanks! :)
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue Jul 22, 2008 4:53 pm   
 
Quote:

Then, on all messages that might stop your speedwalk or movement into another room do this...

#TR {The door is closed.} {#NOMAP}

Shouldn't that be:
Code:

#TR {The door is closed.} {#NODIR}
Reply with quote
Toxic
Adept


Joined: 27 May 2008
Posts: 299

PostPosted: Tue Jul 22, 2008 5:03 pm   
 
Actually, you should use both, to be sure. But using one or the other I 'think' effectivly does the job.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue Jul 22, 2008 5:25 pm   
 
Quote:

I think you need to prefix %roomcost with a command like #SEND or something but not sure what it is... Maybe #RETURN.

That would be #call

There isn't an easy way to make locked doors in a script, but you can make doors. I haven't tested the following, but it should give you the idea:
Code:

#TR {^~[Exits:(*)~]} {#TAG exit %1;$words = %replace(%1, "|"); #forall $words {#if (%left(%i,1) = "(") {$word = %remove(")",%remove("(",%i));#door $word}}}
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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