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

#class disable/enable?

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion
View previous topic :: View next topic  
Author Message
davevnj



Joined: 22 Nov 2006
Posts: 55

PostPosted: Thu Nov 30, 2006 10:23 am    Post subject: #class disable/enable? Reply with quote

Is there a way to to enable and disable classes/actions?

They have this functionality in zMUD triggers, but I haven't been able to figure it out here. I guess presumably, you could kill the class, and then reload the actions. But I'd guess that would be more processing intensive, and my goal is really to both optomize things a bit, and prevent actions from triggering at certain times.

For instance, let's say you have an action like: #action {^You've been knocked down.^} {#var {prone} {1}} Well I wouldn't want that to trigger when I was reading a help file explaining messages that you might see in game, so it would be great if I could alias "help" to disable most actions until I see my next prompt.
Back to top
View user's profile Send private message Visit poster's website
davevnj



Joined: 22 Nov 2006
Posts: 55

PostPosted: Thu Nov 30, 2006 1:54 pm    Post subject: poking around Reply with quote

I was poking around the code a bit, and while I don't see the functionality there, it doesn't look like it would be extremely difficult to add:

- Add a NODE_FLAG_ENABLED
- in check_all_actions, check the flag before calling check_one_action
- add #CLASS {classname} {DISABLE} and #CLASS {classname} {ENABLE} to set and remove the flag from actions in a list of nodes.
- maybe add an extra parameter to #action for {ENABLE/DISABLE} (default being enable of course)
- modify #classes and #actions to display wether or not they are enabled/disabled
- and... maybe that's it.

Could be just a couple hours of coding/testing... I'm not sure how you handle patches and such, but I may be crazy enough to give it a go myself.

Also it would probably be good to move this to the Request section.
Back to top
View user's profile Send private message Visit poster's website
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3770

PostPosted: Thu Nov 30, 2006 2:14 pm    Post subject: Re: #class disable/enable? Reply with quote

davevnj wrote:
They have this functionality in zMUD triggers, but I haven't been able to figure it out here. I guess presumably, you could kill the class, and then reload the actions. But I'd guess that would be more processing intensive, and my goal is really to both optomize things a bit, and prevent actions from triggering at certain times.

It takes about 1 millisecond to kill a class. Reading a class back in takes about 2 to 10 milliseconds depending on the size of the file. So performance wise it's an excellent way to go about it as long as you don't open and close 100 large class files every second.

It's generally a bad thing to compare TinTin++ performance to zMud. I wouldn't be surprised if killing and reloading a class in tintin is faster than disabling and re-enabling a class in zMud, though it seems that a lot of people have some psychological hangup with the concept, guess I'll mention it in the help file.

If you however switch a lot it's probably best to use a variable and use #if to determine if it's enabled or disabled: #if {"$var" == "on"} {do stuff}

davevnj wrote:

For instance, let's say you have an action like: #action {^You've been knocked down.^} {#var {prone} {1}} Well I wouldn't want that to trigger when I was reading a help file explaining messages that you might see in game, so it would be great if I could alias "help" to disable most actions until I see my next prompt.

You'd probably be best off using #buffer lock.

#alias {help} {#send help %0;#delay 0.5 #buffer lock}
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> General Discussion 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