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
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Wed Oct 31, 2007 4:58 am   

new event type request
 
I am using 1.34 atm, so this may be included but I didn't see it listed under the cMUD manual online.

An event, called OnRoomLeave, that would fire when leaving a room. The instance I sought this needed was I have an anchoring ability, that makes my character unable to be moved by a fear spell, ect. So sometimes when I use a #walk command or just double click a room, I would like a check to see if i am ancored and if so to unanchor me before sending directions.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Wed Oct 31, 2007 9:13 am   
 
Hmm... seems to me like your problem would be better suited to an OnWalkStart event to match the current OnWalkEnd one. I can think of some other possible applications for that event too.

Running a script as you move through every room on a speedwalk can currently be done with the OnRoomWalk event, but I'm not sure exactly when that's raised. Perhaps an OnRoomLeave event would run whatever scripts immediately before the direction is sent?
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
chris-74269
Magician


Joined: 23 Nov 2004
Posts: 364

PostPosted: Wed Oct 31, 2007 2:41 pm   
 
The OnRoomLeave event would ideally run scripts immediately before the direction is sent, but you are right that an OnWalkStart would be the best situated. However I can think of circumstances where both events would be beneficial. The OnRoomWalk event doesn't solve this problem because it would de something like:

e
deanchor
s
deanchor

ect, so all directions would be wrong due to the first east never occuring.
Reply with quote
Iceclaw
Apprentice


Joined: 11 Sep 2005
Posts: 124

PostPosted: Wed Oct 31, 2007 3:45 pm   
 
This would be very helpful.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Oct 31, 2007 6:08 pm   
 
Yes, I actually have plans for many different mapper events when the mapper is rewritten next year. It's not something that I'll be adding right now though, sorry.
Reply with quote
Iceclaw
Apprentice


Joined: 11 Sep 2005
Posts: 124

PostPosted: Thu Nov 01, 2007 12:27 am   
 
I suspected as much, but stash this thread away until then, these would be VERY helpful, and might even make me consider upgrading to PRO/Z/CMapper ;)
Reply with quote
Anaristos
Sorcerer


Joined: 17 Jul 2007
Posts: 821
Location: California

PostPosted: Thu Nov 01, 2007 7:26 am   
 
Are you referring to the plugin or to the built-in mapper? At this point, zMapper is a waste for me since it just gets a access violation error when I try to load it up under cMUD, it didn't run too well under zMUD either (I am running under Vista), but it, at least, came up.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Nov 01, 2007 5:12 pm   
 
Both the plugin and the external program (probably called cMapper) will be updated.
Reply with quote
Anaristos
Sorcerer


Joined: 17 Jul 2007
Posts: 821
Location: California

PostPosted: Fri Nov 02, 2007 12:25 am   
 
Here is something to add to the automapper (by this I refer to the one one gets when clicking on the Map button...). A function that will access the checkbox in the potals dialog box disabling/enabling all portals. There have been many situations when I've found myself in a prison-flagged room where using held portals is not allowed. Now, I don't know any way to set that flag programmatically, so I execute a script that disables all my accessible portals. As you can imagine, this is a very slow process (compared to the events that may be taking place in the MUD). I think a simple modification to the %portalenable function would do the trick... %portalanable(0/1). That is, invoking the function with no portal name and just a flag value would set/reset the checkbox controlling the portals meta-state. Also, ...%portalenable(), with no arguments, would return the state of the checkbox.
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Fri Nov 02, 2007 3:19 am   
 
You could disable and enable portals very efficiently using an SQL query via ADO via COM, but the zScript would be somewhat nasty (a lot worse than your suggestion). You could search the forums for ADO examples (e.g. the SQL Server thread that came up last week for an introduction but use the last message in this thread for the Provider information). I don't think there is a way to run completely custom updates on the Map without using COM at the moment, but someone do correct me if I'm wrong. <--- BTW, this (SQL queries (selects and non-selects) on the map database) is something I would like to see added!
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Nov 02, 2007 5:50 am   
 
The functions like %portalenabled will never directly interact with the user interface...they are meant to access the map database from within a script. Seems like it would be easy to just keep a string list of all of your portal names. Then you can easily disable all portals using the existing %portalenabled function like this:
Code:
portals={clan|home|whatever}
#FORALL @portals {#CALL %portalenabled(%i,0)}

Seems like that should be fast enough, so I guess I'm not sure what else you are asking for.

Seb: You'll see more SQL map functions in the future cMapper plugin for CMUD. The current ADO/MDAC map database just isn't good enough for this...it's too quirky. Once it uses SQLite instead, then we will be able to do a lot more with it.
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