|
chris-74269 Magician
Joined: 23 Nov 2004 Posts: 364
|
Posted: 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. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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? |
|
|
|
chris-74269 Magician
Joined: 23 Nov 2004 Posts: 364
|
Posted: 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. |
|
|
|
Iceclaw Apprentice
Joined: 11 Sep 2005 Posts: 124
|
Posted: Wed Oct 31, 2007 3:45 pm |
This would be very helpful.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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.
|
|
|
|
Iceclaw Apprentice
Joined: 11 Sep 2005 Posts: 124
|
Posted: 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 ;)
|
|
|
|
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: 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.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Nov 01, 2007 5:12 pm |
Both the plugin and the external program (probably called cMapper) will be updated.
|
|
|
|
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: 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.
|
|
|
|
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: 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!
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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. |
|
|
|
|
|