TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

Direction blocking

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Script Help
View previous topic :: View next topic  
Author Message
wstopek



Joined: 27 Dec 2012
Posts: 22

PostPosted: Sat Dec 31, 2016 7:33 am    Post subject: Direction blocking Reply with quote

Let say I have map like this:
Code:

[ ]-[#]-[ ]

There are two safe available exits w, e and one trap on north which is not mapped. Is it possible to block sending "n" command just only in this room? I would like to avoid map enter room command this time.
Thank you.
Back to top
View user's profile Send private message
PowerGod



Joined: 04 Aug 2014
Posts: 339

PostPosted: Sat Dec 31, 2016 7:57 am    Post subject: Reply with quote

Do you want to block "n [ENTER]" ? As if you type it by mistake ?

If that's the case you could create a temporary "n" #alias that does nothing (or a warning echo), and this alias could be created/deleted by the events ENTER ROOM / EXIT ROOM
Back to top
View user's profile Send private message
PowerGod



Joined: 04 Aug 2014
Posts: 339

PostPosted: Sun Jan 01, 2017 2:06 pm    Post subject: Reply with quote

Another way could be to use a conditioned alias, but this will be checked at every room, everytime you send 'n'

Just substitute the "1" with the room number where you want to disable 'n'

Code:

#alias n
{
  #map get roomvnum thisroom;
  #if {$thisroom==1} {#echo {WARNING !! TRAP !!}} {#send {n}}
}
Back to top
View user's profile Send private message
wstopek



Joined: 27 Dec 2012
Posts: 22

PostPosted: Mon Jan 02, 2017 12:18 pm    Post subject: Reply with quote

Thank you so much. In my situation using #map enter room event is optimal solution.
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Mon Jan 02, 2017 7:03 pm    Post subject: Reply with quote

If you map the room you can change the exit command.

#map exit {n} {command} {#showme <118>blocked room}

This won't stop the map from following along, so if you accidentally type north you'll have to use #map goto or #map move s to return to the right room.

You'll also have to set the avoid flag so the path finder avoids the room.
Back to top
View user's profile Send private message Send e-mail
Slysven



Joined: 10 Apr 2011
Posts: 365
Location: As "Jomin al'Bara" in WoTMUD or Wiltshire, UK

PostPosted: Tue Jan 17, 2017 2:45 pm    Post subject: Reply with quote

And if the trap gets removed and you want to use that exit again, you will want to restore the direction command in starting room with:

#map exit {n} {command} {n}

Clearing the command entirely (with a value of {}) is a great way to confuse yourself as to why nothing happens on the map when you enter a seemingly valid direction, especially if it was done via an #ALIAS and if you swap opposite direction commands over by accident, things get screwy fast...! Laughing
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Script Help All times are GMT - 5 Hours
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
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group