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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Icarus
Beginner


Joined: 18 Sep 2003
Posts: 23
Location: Norway

PostPosted: Mon Jan 21, 2013 8:02 pm   

Going from zMud to CMud.... HELP!!!!
 
Ok, I've got a system (which might be quite annoying to some) that workED nicely for me... untill I decided that my old 7.21 zMud didn't cut it anymore, and bought CMud....

One of the things I've been highly depending upon in my system is the use of temporable variables for the room, example:

#var herb_here
default value: herbs

then, using the properties of the rooms on the map, "Room Script" tab, I add
herb_here="black pepper"

So, with a macro to F1 sending "search here for @herb_here", I can quickly move around searching the rooms for herbs. In one room I might be seeking general herbs, since none have more or less value to me, in some I will search for specific herbs because those are the ones I want from that room. And this may change from room to room.

My problem now, I can't find any working way to use the 'herb_here=<whateverherb>' in my maps under CMud, at least not in a way that works, and as a result, my job's gone from being quite good and easy and back to the stone-age pre-client old-telnet style of tiresome and annoying. And I am quite sure that this would and should work nicely in CMud as well somehow... I just can't figure out how!

Anyone?


Ic
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4772
Location: Pensacola, FL, USA

PostPosted: Mon Jan 21, 2013 8:11 pm   
 
Okay, open up the room properties window for the room in question
go down to the scripts tag (the gun)
edit scripts for this room (it will pull up the editor)

you should now be able to define your variable
_________________
Discord: Shalimarwildcat
Reply with quote
Icarus
Beginner


Joined: 18 Sep 2003
Posts: 23
Location: Norway

PostPosted: Tue Jan 22, 2013 12:07 am   
 
Been there, done that, still not workin' though.

Problem seems to be that even if I put in

herb_here=<the herb>

in the script box as it should (or just edit out the "excess crap" from zmud conversion, giving the same result, it doesn't fuction with my F1 or trigger system.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue Jan 22, 2013 1:02 am   
 
You'll have to give more details about the situation where it is not working. We will probably need to see the actual scripts, and details of how your trigger system is supposed to interact with it.
Reply with quote
Icarus
Beginner


Joined: 18 Sep 2003
Posts: 23
Location: Norway

PostPosted: Tue Jan 22, 2013 2:12 pm   
 
Ok, on the request, I figure I need to show how it worked for me in zMud, then how it seems not to work for me (same way) in CMud:


zMud:
-------
Room Properties:

Top tab: Text

Bottom tabs: Notes | Room Script | Walk Script

Chosen tab: Room Scrip
----------------------------
herb_loc=trees
herb_here=whitehorn
----------------------------

Macro:

Key: F1
search @herb_loc for @herb_here


Vars:
herb_here

Default value: herbs
Value: *

herb_loc
Default value: here
Value: *

* means either herbs/here or the room script value for given variable


triggers:

You find a*
search @herb_loc for @herb_here


-----------------------
Now this works nicely, I press F1 it does this exactly as planned.
-----------------------

CMud:
-------

Same Macro (F1)
Same variables
Same trigger

Room Script:

Tab: Scripts

herb_loc=trees
herb_here=whitehorn


--------------
Difference is... in CMud this does NOT work, in CMud this always returns "here" and "herbs".

I tried setting the room script to do #var herb_*=<loc/herb> but the only result from that was that it never revert back to "herbs".
Also using trigger to set room colour based on what herb is in the room, and again, not working in CMud.


Hope this helps. Dunno how to print out a full script list directly from the client, so I hope this does the trick.


Ic
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4772
Location: Pensacola, FL, USA

PostPosted: Tue Jan 22, 2013 5:16 pm   
 
Oh, i bet i know what it is
Variables defined in room scripts are made inside the rooms class folder under the map
if you delete the variable that is in the session package it will force it to reference the one in the map instead
_________________
Discord: Shalimarwildcat
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue Jan 22, 2013 5:23 pm   
 
The way you would copy the script into this forum is:
Find the script in the Package Editor
Click the XML button at the bottom of the Editor
Highlight the entire XML script in the Editor and click CTRL-C to copy it to the clipboard
In your reply on this forum, type: [code]
Click CTRL-v to paste the code
Type: [/code]

It is expected behavior that, once this script sets the variables, the values will not change until some other script sets them to something else, or you restart Cmud. This might be a change from Zmud for room scripts. So it sounds like the #VAR format was working correctly. I'm not sure why the var=value format was not working; I'd probably have to see the script itself.

If you want to change the variables to some value when you enter the room, and reset the variables to a default when you leave the room, you will have to take advantage of some of the new features of Cmud 3.xx. Cmud now uses a completely different method for implementing room and zone scripts. If you examine some classes in the Package Editor, you will see that you can create a script which will execute whenever that class is enabled, and another script that is executed whenever the class is disabled. You can also specify a "key" for the class. When you create a room script in the mapper, it simply creates a new class (under the Mapper module), with a key of "Room=XXX" where XXX is the ID of the room. Whenever you enter the room with that ID number, the mapper will automatically enable this class, and disable it when you exit the room. The room script is actually the Enable script for this class. I think what you want is both an Enable script and a Disable script. This new feature gives you a whole lot more flexibility, and can even allow you to create triggers and aliases which are only available when the class is enabled (i.e. when you are in the room). I suggest you find the class associated with this room, and manually edit both the Enable script and the Disable script. Use the #VAR format if that seems to work better.
Reply with quote
Icarus
Beginner


Joined: 18 Sep 2003
Posts: 23
Location: Norway

PostPosted: Tue Jan 22, 2013 7:51 pm   
 
[quote:Rahab]It is expected behavior that, once this script sets the variables, the values will not change until some other script sets them to something else, or you restart Cmud. This might be a change from Zmud for room scripts. So it sounds like the #VAR format was working correctly. I'm not sure why the var=value format was not working; I'd probably have to see the script itself. [/quote]

using #var to set the value in the room works for setting the variable, but not for resetting the variable thereafter. I'm now trying the solution shalimar suggested.


Ok, been trying that now; result: nope.... it then creates the variable, and thus it's back to permanent....

The code:

Macro:
Code:
<macro key="F1" id="66">
  <value>#if (@herb_loc=="") {#if (@herb_here=="") {search here for herbs} {search here for @herb_here}} {#if (@herb_loc=="") {search here for @herb_here} {search @herb_loc for @herb_here}}</value>
</macro>


The Trigger
Code:
<trigger priority="4390" id="439">
  <pattern>You find a*</pattern>
  <value>#if (@herb_loc=="") {#if (@herb_here=="") {search here for herbs} {search here for @herb_here}} {#if (@herb_loc=="") {search here for @herb_here} {search @herb_loc for @herb_here}}</value>
</trigger>


The example of a room script:
Code:
<class name="Room1169" keyword="Room1169" enabled="false" id="770">
  <onenable>herb_loc=trees
herb_here2=whitehorn</onenable>
</class>




Ic
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Tue Jan 22, 2013 9:39 pm   
 
Well, variables are supposed to be permanent. From what I see of your code, you're getting expected behavior. Once a variable is set, it won't be changed until you set it to something else. You don't have any code that sets the variables back to blank. You *might* be able to use an OnRoomEnter event to clear them, but I'm not sure if that would fire before or after the room script, so you might end up overwriting the variables as soon as they're set. But really, I think you're overthinking this. I wouldn't bother using room scripts, I'd just use a database variable with room ids as the keys and herbs as the values.
Reply with quote
Icarus
Beginner


Joined: 18 Sep 2003
Posts: 23
Location: Norway

PostPosted: Tue Jan 22, 2013 10:16 pm   
 
And thus my dilemma, Daern; in zMud I could set the variable to have a default value, and when leaving the room, it automatically reverted to that. So, fact is, CMud's room script system for using basic <variablename>=<value> for a room only temporary value doesn't show the same intelligence level of zMud, which seems to be quite a step BACK imho...

Ic
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Wed Jan 23, 2013 4:01 am   
 
Actually, I thought of a different solution if you want to continue using room scripts for this. As Rahab said above, classes can have enable scripts and disable scripts. You could set the disable scripts of all your room classes to reset the variables to the default. Depending on the number of classes, that might be a lot of work, but it could be automated too. You could just dump all the classes to XML, delete them from CMUD, then in a text editor replace "</class>" with "<ondisable>herb_loc="";herb_here=""</ondisable></class>", and reimport.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Jan 23, 2013 6:12 am   
 
In ZMud, room scripts were stored in the mapper. This means they were loaded and unloaded from memory as appropriate, and this is why variables went back to a default state. CMud keeps room scripts in the package file, so there's no longer the constant creation/destruction events to reset values. This translates into a very large increase in speed, separate from what improvements compiled scripts bring.

Quote:
<ondisable>herb_loc="";herb_here=""</ondisable>


A more efficient way would be to use #RESET. In order to keep it identical for quick find/replace completion, you could use #RESET Room%roomkey(), but it may be a bit faster still if you used the specific room number instead. Of course, if you changed your room script class names to something more easily-identifiable then you'd have to change the names to that instead.
_________________
EDIT: I didn't like my old signature
Reply with quote
Icarus
Beginner


Joined: 18 Sep 2003
Posts: 23
Location: Norway

PostPosted: Wed Jan 23, 2013 10:32 am   
 
Quote:
Actually, I thought of a different solution if you want to continue using room scripts for this. As Rahab said above, classes can have enable scripts and disable scripts. You could set the disable scripts of all your room classes to reset the variables to the default. Depending on the number of classes, that might be a lot of work, but it could be automated too. You could just dump all the classes to XML, delete them from CMUD, then in a text editor replace "</class>" with "<ondisable>herb_loc="";herb_here=""</ondisable></class>", and reimport.


As I obviously suck at this, any chance you could show that with the full code?


Quote:
In ZMud, room scripts were stored in the mapper. This means they were loaded and unloaded from memory as appropriate, and this is why variables went back to a default state. CMud keeps room scripts in the package file, so there's no longer the constant creation/destruction events to reset values. This translates into a very large increase in speed, separate from what improvements compiled scripts bring.

Quote:
<ondisable>herb_loc="";herb_here=""</ondisable>


A more efficient way would be to use #RESET. In order to keep it identical for quick find/replace completion, you could use #RESET Room%roomkey(), but it may be a bit faster still if you used the specific room number instead. Of course, if you changed your room script class names to something more easily-identifiable then you'd have to change the names to that instead.


So... again, how would I do this in the actual code, and where, and how do you mean the room script classes need more easily-identifiable? Do you mean the herb_loc and the herb_here variables? All my herbing variables and triggers are in a set of directories from "joined system" (since I have mutiple characters I play indepentantly) and then in subdirectory "herbs" where it again get split up in subgroups, in this case they are put in "Finding", so they are quite easy to find...

Ic
Reply with quote
Icarus
Beginner


Joined: 18 Sep 2003
Posts: 23
Location: Norway

PostPosted: Wed Jan 23, 2013 10:49 am   
 
Ok, forget it. CMud just did what zMud did before I figured out a way to cicumvent the problems with running zMud under windows 7. It deleted all my repaired settings, all my altered to work with CMud changes... And here I thought CMud was supposed to WORK under Win7... Obviously I was misstaken!

I'm parking CMud as a currently USELESS replacement for zMud and move back to the client that actually works, and wait untill the obvious issues in CMud are resolved.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Jan 23, 2013 1:47 pm   
 
Cmud does work, and does work under Win7. It jut doesn't work the same as Zmud. We have actually told you how to make it do what you want, but I guess we will have to give you more explicit step-by-step directions. I am not currently on a computer with Cmud, but I will try to give you explicit instructions when I get home tonight, if no one else has done it by then.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Wed Jan 23, 2013 5:24 pm   
 
Indeed, I did give very specific instructions, but I'll say it step-by-step anyway:
1) Export all your room classes to XML. This can be done by highlighting them all in the package editor, then going to File -> Export XML.
2) Delete all the room classes from CMUD.
3) Open the XML in a text editor (notepad will do, it comes with windows), open the replace window (if you're using notepad, it's in the edit menu). Replace "</class>" with "<ondisable>#RESET herb_loc;#RESET herb_here</ondisable></class>". Save the XML.
4) Import the XML back into CMUD (File -> Import XML in the package editor).

Edit: Note that since I'm using Matt's suggestion to use #RESET, you MUST have a default value set for your variables.
Reply with quote
Icarus
Beginner


Joined: 18 Sep 2003
Posts: 23
Location: Norway

PostPosted: Wed Jan 23, 2013 7:51 pm   
 
Quote:
Cmud does work, and does work under Win7. It jut doesn't work the same as Zmud. We have actually told you how to make it do what you want, but I guess we will have to give you more explicit step-by-step directions. I am not currently on a computer with Cmud, but I will try to give you explicit instructions when I get home tonight, if no one else has done it by then.


Look at the end for why I choose to ignore my CMud due to it's obvious missgiving in this.


Quote:
Indeed, I did give very specific instructions, but I'll say it step-by-step anyway:
1) Export all your room classes to XML. This can be done by highlighting them all in the package editor, then going to File -> Export XML.
2) Delete all the room classes from CMUD.
3) Open the XML in a text editor (notepad will do, it comes with windows), open the replace window (if you're using notepad, it's in the edit menu). Replace "</class>" with "<ondisable>#RESET herb_loc;#RESET herb_here</ondisable></class>". Save the XML.
4) Import the XML back into CMUD (File -> Import XML in the package editor).

Edit: Note that since I'm using Matt's suggestion to use #RESET, you MUST have a default value set for your variables.



All of this would be well and good, but it all requires that CMud, which has, from one day till the next have DELETED or LOST all my room scrips for some strange and unexplainable reason, still had anything to export and change. This is what zMud did when it wasn't placed a place it would have the permissions needed to follow through on saving. CMud does have those permissions, and I am the onlyone using my computer.

So, I uphold my claim, CMud screwed me over, and thus, zMud, with all it's faults work that much better, that I now can live to regret having spent money on the CMud as well.


Ic
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4772
Location: Pensacola, FL, USA

PostPosted: Wed Jan 23, 2013 8:51 pm   
 
Chalk it up to growing pains... it can and will work...
thought thinking about this, you guys are making it more complex then in needs to be
you could bypass the need for room scripts at all really

use an onRoomEnter #EVENT
inside of it defint some local variables

$thisHerb=room name 1|roomname2|etc
$thatHerb=roomnamesgalore|room over there

#IF (%ismember(%roomname, $thatHerb)) {search location for herb}

then you have one setting that can pull of the entirety of what you are trying to do
_________________
Discord: Shalimarwildcat
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Jan 23, 2013 9:21 pm   
 
For most people, Cmud is far more stable than Zmud ever was. If you want us to help you figure out what happened to make your scripts apparently disappear, you will have to give us more details. Did anything unusual happen? Are the files themselves gone? Are your sessions gone? What have you tried to do to recover or locate them? It is unlikely that your scripts disappeared for no reason, and very possible that they are not actually lost. If you wish to throw up your hands and give up, you may do that instead. We are willing to help you if you are willing to work with us.
Reply with quote
Icarus
Beginner


Joined: 18 Sep 2003
Posts: 23
Location: Norway

PostPosted: Wed Jan 23, 2013 11:02 pm   
 
Ok.

I log off, close up CMud, get into my bed, sleep for some hours, wake up, go to some meetings, return home.

I flip open my laptop, start up Google Chrome, log into the zuggsoft forums for CMud to see if anyone have a new take on my problems. Start up CMud and log in on my mud. First I notice is that my map didn't open automatically at it should, and when I open it I see that my layout (with a free floting map) had been changed to a map sharing room with the main window. I unlock the layout and release the map as I preffer it, thinking nothing of this. However, now there seems to be _no_ room scripts left on the map. All rooms, room-names etc are still present as they should, it's only the scripts that I've spent some time removing the remnants of zMud ("All(RS)") from. All other scripts are also still present, the only thing that has disappeared are the room scripts.


Now, to be more detailed, I would have to tell you more personal stuff about my toilet habits, weither or not I showered, and then how that was, any sexual experiences during this period, what I ate, how it tasted, weither or not I drove a car, who's care that would be, or just took the bus, or even if I stole a bus...
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4772
Location: Pensacola, FL, USA

PostPosted: Wed Jan 23, 2013 11:13 pm   
 
No need to mock the people trying to help you.
Anything not relating to CMUD is already superfluous.

I have found that manually loading a map causes a new map object to appear in the settings editor
Roomscripts are notoriously hard to attach to a map object that didn't create them (in my experiance)
Which is why i suggested the workaround above which only relies on one thing of the map, referencing %roomname
_________________
Discord: Shalimarwildcat
Reply with quote
Icarus
Beginner


Joined: 18 Sep 2003
Posts: 23
Location: Norway

PostPosted: Wed Jan 23, 2013 11:23 pm   
 
Well, referencing to %roomname would be nice and good, except for this meaning finding the name of several hundreds of rooms. The mud I'm playing have only a few rooms with the same name in total, and in many cases, when they do, their herbal content is different from eachother. This is not the first time I have had to reload the map manually, this is just the first time it returns without hours of work included. And that is why I choose to stop using CMud and return to zMud, which abeit unstable, at least does the job I ask it to do.

So, I feel that my $40 for CMud Pro v.3.34 was a waste, as I actually thought it would out-perform my zMud 7.23, so far it has not done that by far.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Jan 23, 2013 11:57 pm   
 
I suggest that you open your session in offline mode and check your Package Editor. See whether you have more than one Map object in your main session package. If you have multiple Map objects, it almost certainly means that you are currently using the newly created Map object (without your room scripts). Open the Map objects. One of them should have a bunch of classes in it, representing the rooms which have room scripts. The other probably does not have anything unless you started trying to recreate the room scripts. Delete the Map object which does not have the room scripts, close Cmud, and restart it. You should see all your room scripts again.
Reply with quote
Icarus
Beginner


Joined: 18 Sep 2003
Posts: 23
Location: Norway

PostPosted: Thu Jan 24, 2013 1:53 am   
 
Ok, tried that, and it sort-of worked....

My problem is, I have seven characters who never are online on the same time, who uses the same files and settings, same maps, but have, by a delicate trigger system. But the map gets screwed each time I try to switch characters by opening a different character from the sessions menu.

Also, no, I did not have more than one map-object. CMud decided that sinceI switched character session, it would delete all my new additions to the total script, as well as alterations to the same, pluss clear all room scripts, even those imported with the maps, and basically say "fuck you" to me.

Again, not something I have a problem with in zMud... so my previous claim that the $40 expence on CMud was a waste of money still ring true for me.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Jan 24, 2013 2:24 am   
 
You need to fix your corruption issues. Refer to the sticky.
_________________
EDIT: I didn't like my old signature
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion 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