|
Dyron Apprentice
Joined: 08 Apr 2004 Posts: 103 Location: USA
|
Posted: Sun Dec 07, 2008 6:14 pm
Script Editing |
Is there any way to use the zmud way of viewing scripts? I can never tell what's wrong with scripts in cMUD
they all show up to be working just fine. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun Dec 07, 2008 8:16 pm |
Sure, just open up CMud's Package Editor, click on the setting, and click on the Zscript tab. If you want the more comprehensive Class Code version, either it's not possible or you can just click on the class folder icon and see it automatically where the class options used to be.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sun Dec 07, 2008 10:28 pm |
I think what he means is that when hitting the Save Changes button zMud would suddenly whine about errors. CMud of course doesn't do this even though it is more strict about syntax.
The ways to check on the health of a given script are:
1. Look at the Compiled Code tab after clicking Save Changes. If there is an error it will say something there, otherwise it will display a tokenized version of the script.
2. Press CTRL-K at any time while focus is in the script editting box. This will preform the full syntax check and compile on the script in its current form. If there is an error it will tell you what it found and where.
In both cases the error messages can sometimes be ambiguous and may indicate a location that is not the exact spot that a correction is required. This is pretty much true of any compiler system. The messages are always consistent, and there is are discernable patterns in where it will incorrectly point you. It doesn't take too long to figure out what you should be looking for when the error+location doesn't make sense. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Dyron Apprentice
Joined: 08 Apr 2004 Posts: 103 Location: USA
|
Posted: Mon Dec 08, 2008 4:56 am |
Hrmm.. what about zmud's automatic formatting? How it made the ifs easier to read.. any way to make cmud do that?
|
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Mon Dec 08, 2008 11:30 am |
There is a Reformat Script command in one of the menus, it also has a keyboard shortcut. It was decided to not make it automatic because many people have very specific formatting patterns that they like. zMud had a lot of feedback about its pretty printer that said users were just turning it off, so CMud implemented it as an on demand item. After you get used to CMud's ways you will find that script writing is much easier.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Dec 08, 2008 2:41 pm |
Mmm, the pretty printer caused all kinds of cock-ups, especially on slow computers, because of the way it moved the cursor around while you were typing. When a line wrapped, it wouldn't be uncommon for you to suddenly by typing somewhere completely different. So not having it on-the-fly is a plus :P
|
|
|
|
|
|