|
chosig Novice
Joined: 20 Apr 2008 Posts: 39 Location: Sweden
|
Posted: 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. |
|
|
|
chosig Novice
Joined: 20 Apr 2008 Posts: 39 Location: Sweden
|
Posted: 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...
|
|
|
|
Toxic Adept
Joined: 27 May 2008 Posts: 299
|
Posted: 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} |
|
|
|
Toxic Adept
Joined: 27 May 2008 Posts: 299
|
Posted: 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. |
|
|
|
chosig Novice
Joined: 20 Apr 2008 Posts: 39 Location: Sweden
|
Posted: Mon Jul 21, 2008 8:39 pm |
Thanks! :)
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: 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}
|
|
|
|
|
Toxic Adept
Joined: 27 May 2008 Posts: 299
|
Posted: 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.
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: 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}}}
|
|
|
|
|
|
|