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 Goto page 1, 2  Next
Nurodma
Beginner


Joined: 10 Oct 2005
Posts: 24

PostPosted: Wed Nov 15, 2006 5:06 am   

Importing Scripts From ZMud to CMUD
 
I know this has probably already been covered, but I could not find anything.

I have been trying, unsuccesfully, for a couple days to simply import my ZMud scripts to CMUD. I can not get it to import them, one of two things happens.

1) It tries to import a script other than what I selected.

2) It doesn't import any script, but instead opens several windows named "untitled" with no scripting in them.



If someone would please post a quick guide about how to import scripts I would be most gracious. Please, no links/help about converting, I can do that once the scripts have been imported.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Wed Nov 15, 2006 5:47 am   
 
One of the most straightforward ways to import is to go to the Package Editor, select File->Open and browse to the .MUD file you would like to import. To help with some of the conversions you may have to do, after the import, go to Tools->Compatability report in the Package Editor. I believe Zugg mentioned that will automatically launch, so you may have already seen it.

The untitled window you see is CMUD default online session. Depending on the approach you use to do your imports you may see the 'untitled' window and another tab representing the .MUD you imported.

Finally, if you are trying to import one portion of you .MUD scripts and not another you will need to take another approach. In that case you should do a text export from zMUD and paste the specific scripts you want to run into the CMUD editor.

Hope that helps. BTW the topics been covered a few times, so if you search the CMUD forums you will find more info.
_________________
Asati di tempari!
Reply with quote
kernighan
Novice


Joined: 14 May 2004
Posts: 37

PostPosted: Wed Nov 15, 2006 9:04 pm   
 
Is there no way in CMUD to simply File->Open a text file of a script for import? That, quite simply, is my first level of test. Why should I have to cut & paste a 4 page script?
_________________
Kernighan's Medievia Scriptorium
http://www.geocities.com/mishikal
Reply with quote
slicertool
Magician


Joined: 09 Oct 2003
Posts: 459
Location: USA

PostPosted: Wed Nov 15, 2006 10:39 pm   
 
I opened the normal editor (ctrl+shift+enter from the command line) opened the script file from there, made sure parsing was turned on in it and hit send. Tada, settings imported.
_________________
Ichthus on SWmud: http://www.swmud.org/
Reply with quote
kernighan
Novice


Joined: 14 May 2004
Posts: 37

PostPosted: Thu Nov 16, 2006 3:37 am   
 
Thanks, that works great!
_________________
Kernighan's Medievia Scriptorium
http://www.geocities.com/mishikal
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Nov 16, 2006 5:24 am   
 
Quote:

Is there no way in CMUD to simply File->Open a text file of a script for import? That, quite simply, is my first level of test. Why should I have to cut & paste a 4 page script?


CMud doesn't have an import/export system that operates on plain text like ZMud does. It instead uses XML, which is an obvious problem for ZMud as it doesn't support XML.
_________________
EDIT: I didn't like my old signature
Reply with quote
kernighan
Novice


Joined: 14 May 2004
Posts: 37

PostPosted: Fri Nov 17, 2006 2:19 am   
 
Yeah, but the main point, is there should be a way to import *.txt files, which there is. As we found out at my work, there are things XML is good for, and there are things it isn't good for. It'll be interesting to see which of these it is for CMUD.

I write a lot of scripts, some very long, for very particular purposes. Those scripts need updating from time to time as features on the mud I play change, etc. I don't see a great way to do this via CMUD. After importing just a single script, I have its class, and I can export to XML, but the export is for the entire world, and doesn't seem to have the concept of keeping the individuality of the script. In Zmud, I did this by making each script have its own Class and subclasses, so to upgrade you delete the existing class, and then import the new version of the text file.

At the moment, I don't really see a way to have this concept of isolated components in CMUD at all, really, other than to keep creating .txt files, importing them into the editor, and then "send"ing them to CMUD, which seems tedious. I was hoping the concept of "packages" would fix that, and each of my scripts could be a "package" that I could push out updates for. However, everything still seems to be full world based, and not individual component based. And I see no great way with the CMUD editor to edit or export these scripts into their own components.
_________________
Kernighan's Medievia Scriptorium
http://www.geocities.com/mishikal
Reply with quote
slicertool
Magician


Joined: 09 Oct 2003
Posts: 459
Location: USA

PostPosted: Fri Nov 17, 2006 6:45 am   
 
You can create packages which you then upload into the package library. As these packages are updated, then as the creator, you can upload the latest version over the top of the old one in the package library and update the version number. After that, people can download the new version directly without having to do any real 'import' other than attaching that package to their current settings.

Currently, I'm still a little bit confused about packages, but that's because I'm the only person from my mud who is creating cmud scripts, so I can only view the process from the creator's point of view. I haven't had the opportunity to try this from the user's point of view.
_________________
Ichthus on SWmud: http://www.swmud.org/
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Nov 17, 2006 10:09 am   
 
You can use separate packages to split the script components into parts you can update separately via the Package Library. I'm not sure exactly what your situation is to understand how text files are more convenient than this. You can split them into modules if you just want them to be distinctly separate but related enough to deserve updating at the same time.

This IS an option to export whatever you have selected to XML, though. It's on the Edit menu.

EDIT: The revelation with packages came for me really when I realised there wasn't really that much to understand. Modules are just "super classes" as they're described in the help file, only they can be selectively set to be visible to modules in other packages. Windows are what we had before in zMUD, a window and an associated settings tree. Packages are the pretty wrapper they come in, and the part that gets put in the library.

I really like this system - the only thing I think could be improved is having modules and windows be Read Only rather than packages.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
The Raven
Magician


Joined: 13 Oct 2000
Posts: 463

PostPosted: Fri Nov 17, 2006 4:48 pm   
 
You can export just a portion of your scripts. Put the scripts you want to import/export separately into their own class. Then you can export just that class by right-clicking on it in the Package Editor.
Reply with quote
kernighan
Novice


Joined: 14 May 2004
Posts: 37

PostPosted: Fri Nov 17, 2006 8:52 pm   
 
But this exports them into fairly undreadable XML. My issue is that with a text file, I could easily edit and modify a script that was many hundreds of lines long. I don't see any way to do that with CMUD at this point.

Thanks for the information on the packages & components, it looks like that will address that concern.

--Kernighan
_________________
Kernighan's Medievia Scriptorium
http://www.geocities.com/mishikal
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Nov 17, 2006 9:45 pm   
 
You do have a point there kernighan but if I'm perfectly honest, I don't see much point in using XML export at all. I can't think of a situation where having them in a different file format is more useful then just leaving them in the .pkg files, apart perhaps for rolling out a small update to a number of users, but if you leave it as a .pkg you can use the library. Since they don't get corrupted like .mud files there's no danger in leaving them alone, and they'll transfer between computers and users with the same ease. If you want to edit them you can just load them up without a session.

EDIT: Bear in mind also that the TXT export liked to eat very complicated scripts. XML doesn't do this, and I'd rather have to load my file into CMUD to edit it than try to jiggle my scripts into a format the txt exporter likes.
Reply with quote
kernighan
Novice


Joined: 14 May 2004
Posts: 37

PostPosted: Fri Nov 17, 2006 10:35 pm   
 
And my issue is, I don't see a great way to edit very large complex scripts in CMUD. I really don't care how it is stored internally in CMUD. What I want, is to be able to "see" the entire script in its *code form*, and be able to edit it from there... Be able to do things like search for particular variables across all the lines of the script, etc.

--Kernighan
_________________
Kernighan's Medievia Scriptorium
http://www.geocities.com/mishikal
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Nov 17, 2006 10:38 pm   
 
I see. It's a good idea for expanding the settings window's search function actually. I'm not sure what you mean by "in its code form" though - doesn't the settings window do that?
Reply with quote
The Raven
Magician


Joined: 13 Oct 2000
Posts: 463

PostPosted: Fri Nov 17, 2006 10:44 pm   
 
Speaking as someone who writes very large, very complex scripts in CMUD, I can say that while it would be nice if there was a way to edit blocks of code outside of CMUD, I don't really have a problem doing it all in the editor (assuming the editor didn't crash so often). And there is no easy way to have a human-readable export option that perfectly allows re-importing.

There's nothing wrong with making a script that re-creates your settings from scratch however. For example:

#DELCLASS MyScripts
#CLASS MyScripts
#VAR Foo
#VAR Bar
#ALIAS A {Does B}
etc...
#CLASS 0

This would delete the MyScripts class (and everything inside it), and then go through re-creating the settings. Make all the edits you like, and then run it every time you're done editing.

You would need to keep variables that change (like your current health, etc) outside of that class, so those variables would not be lost when you re-ran the code block to recreate your scripts.
Reply with quote
kernighan
Novice


Joined: 14 May 2004
Posts: 37

PostPosted: Fri Nov 17, 2006 11:29 pm   
 
Hm, I tried to get a script I had imported to show up as an editable script in the editor without any luck, but I will give it another go.

--Kernighan
_________________
Kernighan's Medievia Scriptorium
http://www.geocities.com/mishikal
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Sat Nov 18, 2006 2:32 pm   
 
I do exactly what Raven describes when I write my scripts. I then load my scripts into CMUD's editor window and use the Send button to execute the script. It works like a charm, as long as my script is correctly formatted.
Reply with quote
Melindhra
Newbie


Joined: 24 Sep 2005
Posts: 9
Location: Toronto

PostPosted: Sat Nov 18, 2006 9:41 pm   
 
Whenever I open my old .MUD file from CMUD and attempt to import the settings, CMUD just starts spitting out access violations. I'm not sure why it's happening, but boy is it annoying. Has anyone else had the same problem?
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Sun Nov 19, 2006 6:20 pm   
 
How are you opening you .MUD file in CMUD?
Reply with quote
Melindhra
Newbie


Joined: 24 Sep 2005
Posts: 9
Location: Toronto

PostPosted: Sun Nov 19, 2006 6:58 pm   
 
Sorry. I didn't know that there was more than one way to import a .MUD file.

I go into Settings -> File -> Open -> select the .MUD file -> Click OK -> Save the package as a package in my CMUD\Game folder

Is there something else that I should be doing?
Reply with quote
Melindhra
Newbie


Joined: 24 Sep 2005
Posts: 9
Location: Toronto

PostPosted: Sun Nov 19, 2006 7:12 pm   
 
I uninstalled CMUD, deleted the CMUD folder, then reinstalled. I imported my .MUD settings files again. Now, I am getting the errors when I connect to Dragonrealms and am presented with the character selection screen. Here is the error (with personal info removed):

date/time : 2006-11-19, 13:59:05, 148ms
computer name : *removed*
user name : *removed* <admin>
operating system : Windows XP Service Pack 2 build 2600
system language : English
system up time : 21 hours 42 minutes
program up time : 4 minutes 21 seconds
processors : 2x Intel(R) Pentium(R) 4 CPU 3.20GHz
physical memory : 1047/2046 MB (free/total)
free disk space : (C:) 677.35 MB (E:) 11.24 GB
display mode : 1280x1024, 32 bit
process id : $279c
allocated memory : 38.09 MB
executable : cMUD.exe
exec. date/time : 2006-11-11 13:41
version : 1.15.0.0
madExcept version : 3.0b
contact name : *removed*
contact email : *removed*
callstack crc : $1b746de7, $cbd99c74, $cbd99c74
exception number : 1
exception class : Exception
exception message : Syntax error in Alias: SaveData : unrecognized command.

Main ($2318):
00ced04a +0ce cMUD.exe CodeExec 900 +12 AliasError
00ced1a8 +0e4 cMUD.exe CodeExec 921 +10 PushPref
00ced49c +1cc cMUD.exe CodeExec 978 +33 HandleVar
00ced7c4 +1f0 cMUD.exe CodeExec 1029 +29 HandleVarRef
00cf1157 +44f cMUD.exe CodeExec 2129 +61 TCodeExec.InternalExecute
00ceb288 +084 cMUD.exe CodeExec 310 +11 TCodeExec.Execute
00cecf13 +0cf cMUD.exe CodeExec 877 +12 ExecAlias
00ced151 +08d cMUD.exe CodeExec 917 +6 PushPref
00ced49c +1cc cMUD.exe CodeExec 978 +33 HandleVar
00ced7c4 +1f0 cMUD.exe CodeExec 1029 +29 HandleVarRef
00cf1157 +44f cMUD.exe CodeExec 2129 +61 TCodeExec.InternalExecute
00ceb288 +084 cMUD.exe CodeExec 310 +11 TCodeExec.Execute
00ce97ab +02b cMUD.exe PrefDat 9024 +3 TCacheNode.Execute
00ce7eae +0ce cMUD.exe PrefDat 8127 +17 PrefRec.Execute
00a605da +026 cMUD.exe ADODB 5407 +2 TCustomADODataSet.SetMarshalOptions
00c3d40b +073 cMUD.exe MAIN 959 +6 TMUDForm.ExecAlias
00c53454 +160 cMUD.exe MAIN 7570 +19 TMUDForm.DoDisconnect
00c7c779 +00d cMUD.exe MAIN 17235 +1 DoExit
00c7d1b3 +a0b cMUD.exe MAIN 17392 +154 TMUDForm.ProcessAuth
00c5495f +367 cMUD.exe MAIN 7952 +44 TMUDForm.ProcessCompress
00c54a84 +068 cMUD.exe MAIN 7967 +8 TMUDForm.MUDSockRead
00a430ef +257 cMUD.exe zsock 740 +60 TClientSocket.DoRead
00a42cb6 +03e cMUD.exe zsock 602 +6 TClientSocket.OnSockMsg
00a42a6d +03d cMUD.exe zsock 538 +4 TClientSocket.WndProc
0047f828 +014 cMUD.exe Classes 10966 +8 StdWndProc
77d496c2 +00a USER32.dll DispatchMessageA
0052e6f0 +0ac cMUD.exe Forms 6873 +13 TApplication.ProcessMessage
0052e737 +00f cMUD.exe Forms 6892 +1 TApplication.HandleMessage
0052e9d2 +0a6 cMUD.exe Forms 6976 +16 TApplication.Run
00d4604c +088 cMUD.exe CMUD 312 +17 initialization
7c91312f +069 ntdll.dll RtlUnicodeStringToAnsiString
7c812b94 +0b6 kernel32.dll GetVersionExA

error details:
Clicking cancel when the Simu logon screen appeared.

This time, the error is related to an alias. It's probably the #update command, so I'll go look that up. This is going to be a lot of work! I'm sure there are at least 70 more aliases and triggers that need to be changed in various ways. Hopefully the other error doesn't come back. *cry*
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Sun Nov 19, 2006 7:36 pm   
 
Did you try running the compatibility report to see if anything came up? Usually if something doesn't compile, it will show up there.
_________________
Asati di tempari!
Reply with quote
Melindhra
Newbie


Joined: 24 Sep 2005
Posts: 9
Location: Toronto

PostPosted: Sun Nov 19, 2006 8:07 pm   
 
Yes. I ran it. However, it doesn't tell you what specific problems are, like #UPDATE. I've had to go back and forth between my zMUD and CMUD command reference to figure some of them out.

I keep getting access violations as I go through the report fixing problems, such as "%1", #priority, etc. I also got something similar to an ArrayIndexOutOfBounds exception. I would have saved that too, but I'm getting sick and tired of saving all of the errors. I'm not sure how I'm supposed to correct issues if the program keeps generating exceptions and stops responding properly.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Nov 19, 2006 9:55 pm   
 
I find that a lot of the errors I get are actually my fault rather than CMUD - like that one you posted was a syntax error rather than an actual error. Of course if there really isn't a syntax error, then there's cause for concern, but I don't worry about those if there isn't. I just continue the program and everything is fine.

I get that List Index Out of Bounds(nn) error quite often though, and it doesn't sound like something I did, so I'm usually sure to submit it.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Sun Nov 19, 2006 10:41 pm   
 
Melindhra, if you are getting wierd import errors that aren't due to syntax errors or other errors on the bug list, you might try importing your MUD file in the 'normal' way - that is either
(a) after installing CMUD
(i) putting a copy of chardb.db (from your zMUD folder) to your CMUD folder right after an install but before you run CMUD for the first time - this will cause CMUD to import your characters from zMUD.
(ii) putting a copy of your zMUD settings in your CMUD folder so that CMUD can automatically convert them when you open CMUD for the first time.
(b) whenever you want
(i) putting a copy of your zMUD settings in your CMUD folder
(ii) create a session, or edit an existing session, but before opening the session, changing the file in the Files tab to point at your *.MUD file. CMUD will convert the file when you open the session, and save it as a pkg file with the same name.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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