Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Thu May 10, 2007 3:16 pm   

[1.33] #RESET questions
 
I'm building a module to track warrior attacks against me, and I want to reset a class of variables after the tracking is done (on the next prompt). I'm having trouble figuring out how to get this to work, and I'm wondering if I have the wrong syntax or if the command is still not fully functional in 1.33. (This is just an early start to my tracking, so this is my first hurdle in getting it working.)

After creating the "Palisade Assaults" package:
Code:
#MODULE "Palisade Assaults"

#DELCLASS Internals

#CLASS Internals
#ALIAS i_offassaults {
#SAY "Struck: "@struck", Assault_Hit: "@assault_hit", Assaulted: "@assaulted", Side_Hit: "@side_hit", Assault_Class: "@assault_class
#RESET Assault/State
}
#CLASS 0

#DELCLASS Assault

#CLASS Assault|State
#VAR assaulted 0 0
#VAR assault_class "" ""
#VAR assault_hit "" ""
#VAR side_hit "left" "left"
#VAR struck "" ""
#CLASS 0

#MODULE 0


I tried #RESET with quotes and/or brackets around the class name. I tried Assault|State, Assault/State, /Assault/State (doesn't compile), //Palisade Assaults/Assault/State (thinks it's a comment without quotes, of course)...

The values just don't want to go back to their defaults, whether the alias is executed from the command line or in a trigger/alias inside the Palisade Assaults package.
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Thu May 10, 2007 5:47 pm   
 
I found that if you use this your variables do rest.

#reset "Palisade Assaults"

But I was unable to specify a class within the module. It was all or nothing.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Zugg
MASTER


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

PostPosted: Thu May 10, 2007 7:49 pm   
 
You cannot mix a module name and a class name with #RESET. The proper way to do this is to create an alias within your package that is used to reset the variables that you want:

#ALIAS ResetState {#RESET State}

Put this into your Assault module. Now, from outside the module, use the ResetState alias to reset the variables. This method helps keep your modules more modular. I'll considering supporting the //Module/Class syntax in the future.
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Thu May 10, 2007 8:51 pm   
 
My alias is already inside my module. You're saying that I can't specify the full path to the class as an argument to #RESET, like Assault|State?

I just didn't want to get into context problems that I had before where I'd reset a folder in a different module/package that happened to have the same name.

I tried it your way and it didn't reset the variables for me. It's a clean 1.33 with a nice, new package, and the variables all have the "use default" option checked. If I close CMUD and re-open it, the variables are still not reset, so maybe it's a problem with the default option and not necessarily the #RESET command itself?
Reply with quote
Zugg
MASTER


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

PostPosted: Sat May 12, 2007 7:05 pm   
 
If closing CMUD and re-opening it doesn't reset the variables, then there is something else wrong. #RESET calls the same routine that is called when you first load a package to initialize it.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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