|
Arde Enchanter
Joined: 09 Sep 2007 Posts: 605
|
Posted: Thu Sep 08, 2011 4:09 pm
[Feature request] Additional built-in event for mapper |
There are 3 walking modes in Mapper: fast, slow and safe.
I don't wanna my room scripts fired while I rush through an area in the "fast" mode. And I want for them to do something useful while I'm in slow or safe mode. Nice. Just 1 question: how my scripts are supposed to know when mapper mode has been changed? When a user have click on one of the buttons on mapper toolbar? Eh? There is no way to know that.
For a workaround I must
1) Keep calling %walkmode for each room (trust me, I have a lot of other useful scripts to run and use my CPU time instead of this)
2) Have a tracking variable
3) Have an expression type trigger to track changes to the variable.
And here is the right time to remember that %walkmode returns 0 for fast mode, which evaluates for "false", which, in turn, prevents trigger from firing. This leads us to
4) Add some weird math to our trigger
5) Add a lot of comments to explain why I did that.
Instead of all of this horror, CMUD should have 1 additional buil-in event. Say, onMapperSettingsChange or like. Let it have 2 parameters: setting name (must be == to corresponding function name) and setting value. It allows to add another settings for this event in the future, if needed. Then CMUD will be able to raise internally
onMapperSettingsChange walkmode 0
event which can be handled in scripts.
This event is very easy to add, it's logic is plain and straightforward, it doesn't interfere with any complex parts of CMUD. So... Can I expect it to arrive in next "July bug-fixing release"? |
|
_________________ My personal bug|wish list:
-Wrong Priority when copy-paste setting
-1 prompt trigger for Mapper, Session and General Options, not 3 different!
-#SECTION can terminate threads
-Buttons can't start threads |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Thu Sep 08, 2011 8:47 pm |
Room scripts are enabled when the onroomenter event is raised. In fast mode, this means that the only rooms that room scripts will run in are the current room before the walk was issued and the destination room.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Arde Enchanter
Joined: 09 Sep 2007 Posts: 605
|
Posted: Thu Sep 08, 2011 9:37 pm |
Thank you for your explanation, have got some valuable info from your post.
But my situation is a bit different. It seems that I was not accurate with my description. I have generic room scripts, not associated with particular room (do not have RoomXXX folders). Instead, I use "UserStr" field in room data to set a combination of room flags. Flags define what additional settings must be enabled for that room. Mapper sees this field in any walk mode and for any room in walk queue. |
|
_________________ My personal bug|wish list:
-Wrong Priority when copy-paste setting
-1 prompt trigger for Mapper, Session and General Options, not 3 different!
-#SECTION can terminate threads
-Buttons can't start threads |
|
|
|
|
|