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 question

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



Joined: 14 Feb 2015
Posts: 66

PostPosted: Mon Feb 23, 2015 8:29 am    Post subject: #class question Reply with quote

How can I turn on or turn off one class of #action in another class in the same tin file.

eg.

in the same aa.tin which has been #class read aa.tin in main.tin

#class looking open;

#action {hello} {say hi};

#class looking close;

then I want

#class finded open;

#action {sssss} {{here, turn #class finding on} say hello; {then turn #class finding off}};

#class finded close;
Back to top
View user's profile Send private message
PowerGod



Joined: 04 Aug 2014
Posts: 339

PostPosted: Mon Feb 23, 2015 1:28 pm    Post subject: Reply with quote

If you need to turn on/off single actions it is better to just use #unaction

example:

Code:

#action {bread} {eat bread}

#unaction {bread}


As far as I know, the #class method is mostly used to load single files:

Code:

#class objects READ objects.tin
#class weapons READ weapons.tin
#class speak READ speak.tin


and it's useful to deactivate an ENTIRE class when you want

Code:

#class weapons kill
Back to top
View user's profile Send private message
dawang10



Joined: 14 Feb 2015
Posts: 66

PostPosted: Mon Feb 23, 2015 1:39 pm    Post subject: Reply with quote

Thanks for your reply.

can I use #unaction {xx} in a different class in the .tin file from the class of #action {xx}? or it has to be done in the same class.

#class xxxx open;
#action {bread} {eat bread};

#class xxxx close;

#class aa open;
#unaction {bread}
#class aa close;

if not, it seems that I need to create a new file to do this.
Back to top
View user's profile Send private message
dawang10



Joined: 14 Feb 2015
Posts: 66

PostPosted: Mon Feb 23, 2015 1:50 pm    Post subject: Reply with quote

add one more question..

after #unaction, how can I do to turn it on again?

sorry for a lot of question. I am quite new to wintin
Back to top
View user's profile Send private message
PowerGod



Joined: 04 Aug 2014
Posts: 339

PostPosted: Mon Feb 23, 2015 1:50 pm    Post subject: Reply with quote

if the action is running, unaction will delete it, it doesn't depend on classes
Back to top
View user's profile Send private message
PowerGod



Joined: 04 Aug 2014
Posts: 339

PostPosted: Mon Feb 23, 2015 1:57 pm    Post subject: Reply with quote

dawang10 wrote:

after #unaction, how can I do to turn it on again?


Well, if it was created by a class, you should reload the entire class, else it can be created by everything still active on that class...

example:
Code:

#action {a tavern} {#action {bread} {eat bread}}

#unaction {bread}


in this case even if you delete the #action {bread}, it will be recreated when you will encounter "a tavern"

or you can make an alias to reactivate it easily by hand
Code:

#alias startbread {#action {bread} {eat bread}}
Back to top
View user's profile Send private message
dawang10



Joined: 14 Feb 2015
Posts: 66

PostPosted: Mon Feb 23, 2015 2:25 pm    Post subject: Reply with quote

Thank you very much.
alias could be preferable way.

putting all relevant in a .tin file appears clearer.
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 -> 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