MFixer v1.00 by Majere (majere@totalise.co.uk) MFixer is available from http://www.users.totalise.co.uk/~majere/index.html Disclaimer I don't guaruntee MFixer will work. If it blows up your PC, it's not my fault, or Microsoft's, or Elecbyte's, or for that matter, my goldfish's. Terms of use Permission is given to do what you please with MFixer. Just don't sell it wihout asking me, and credit me if you use or distribute it. Credits MFixer is written in Microsoft Visual Basic 5 by Majere. Thanks to MHZ whose Autofix provided lots of useful information about what formats the new MUGEN was actually expecting.. What is MFixer? MFixer is basically an intelligent search-and-replace program that takes a lot of the work out of updating MUGEN characters. It's flexible enough to be adapted to convert characters to any new versions of MUGEN which may be released. Hopefully. :) MFixer is primarily intended to encourage creators to update their own characters. Feel free to use it to update downloaded characters, but bear in mind that you might have trouble getting things to work exactly right if you run into any bad syntax etc. How do I use it? First, run the setup program to install Mfixer. When you run MFixer, you'll see 3 buttons: Define a fix Apply a fix Exit. ------------------------- Example of basic use- fixing a .cns file. First, use the 'define fix' button to load the cns2000-06-27fix.mfx fix file. MFixer displays the fix in a table. You could edit the fix here, but there's no need, so press the 'save and use' button. Mfixer returns to the first screen, and displays the name of the fix you loaded. Click the 'apply a fix' button. Mfixer displays a screen with a status readout, and a big button marked 'Apply fix now!". Press this button. Mfixer displays a file requester. Find the .cns file you want to fix. (HINT- if you can't tell which is the .cns file, use 'view details' from the right click menu of the file requester) Once the file is selected, the fixing begins. This is pretty slow, so get a book or some coffee or something... :) Eventually, MFixer will beep and display a message telling you it's finished. It will also tell you the filename of the fixed file. (it justs sticks the word 'FIX' into the filename) Now all you have to do is either delete or rename the old file, and replace it with the fixed one, OR edit your .def file to point at the new version of the file. ------------------------------ Detail of how to define fixes Define a Fix: This option loads or creates a .mfx (fix) file. 3 are provided with this release- def2000-06-27fix.mfx <- fixes .def files cns2000-06-27fix.mfx <- fixes .cns files cmd2000-06-27fix.mfx <- fixes .cmd files When you press the define fix button, a requester pops up asking for a filename. You can either load an existing .mfx file, or give a name for a new one. For now, load up def2000-06-27fix.mfx You'll then see a screen with a big table on it marked 'Change from' and 'Change to'. This table defines what alterations your fix will make to a file. For example, def2000-06-27fix.mfx contains only one fix, which looks like this: Change From Change To Name=%s Name="%s" What this does is tell MFixer that whenever it sees "Name=" followed by a string (specified by %s) it should put quote marks around the string. MFixer ignores cases and insignificant spaces, so this will also pick up on "name=" or " Name = " for example. If you load up the cns2000-06-27fix.mfx fix, you'll get a much bigger table! This also includes lines like this: Change From Change To Numhelper%n Numhelper(%n) Here, %n means "any number" (including floats and negative numbers), so this line tells MFixer to put brackets around numbers attached to the end of the word "NumHelper" Both types can be combined: Change From Change To trigger%n=command=%s trigger%n=command="%s" Here, we use both %n and %s to put quote marks around the command name in a trigger. Note that we need another entry to deal with 'triggerall' because 'all' isn't a number. -------------------------- Example of creating a fix For the sake of argument, lets say elecbyte have just released a new version of mugen. It has one major change- due to a sudden fruit fixation, the 'Statedef' line is to be replaced with 'Banana'. To make matters worse, instead of [Banana 1000], the new format is Banana [1000]. Here's how we would go about fixing this: First, press the 'define a fix' button. When the requester comes up, name your fix (Say, BananaFixer.mfx) Now, when the table comes up, we would click the top of the 'from' column, and enter this: [Statedef %n] This tells MFixer to look for an open square bracket, the word 'statedef', then a number, and then a close square bracket. In the 'To' column, we would then enter this: Banana [%n] This tells MFixer to replace what it's just found with the word 'Banana', followed by a single space, and then the same number it just found, but enclosed in square brackets. This defines our fix. If we wanted to make more changes, we'd use the 'add line' button to make more space in our table. Otherwise, we just press 'save and use', and we're ready to fix files! ------------------------- Advanced stuff Order of fixes Fixes are applied in order, from the first in the table to the last. This can cause trouble, but can be useful: Example of 'trouble' Change From Change To Anim = 5010 Anim = 5020 Anim = 5020 Anim = 5010 What this is _supposed_ to do is swap over Anim=5010 and Anim=5020. But since the first fix is applied before the second, we end up changing all occurences of Anim=5020 to Anim=5010, but not changing Anim=5010 at all, because it just gets 'fixed' straight back again! Oops. What we need is something like this: Change From Change To Anim = 5010 Anim = @@@@ Anim = 5020 Anim = 5010 Anim = @@@@ Anim = 5020 That way, the dummy value '@@@@' stops the double-swap from happening. Example of 'useful' Change From Change To sparkno =0,%n sparkno = %n sparkno =1 sparkno = 0 sparkno =2 sparkno = 0 In this example, the two changes to the 'sparkno' can be made in easy steps- the first line gets rid of the now-unwanted '0,' bit, and then the later lines start remapping the spark numbers. ------------------------ Limitations There are several limitations to MFixer: Must preserve order, number of numbers: MFixer deals with numbers in the order it finds them. You cant change '%n To %n' to something else to swap the numbers over. You also can't change "%n,%n" to just "%n" and get the second number- you get the numbers in order. Strings are very liberal: A '%s' tends to mean 'anything left on the line'. It only stops at an end-of-line character, or a ';' meaning a comment has started. For example, "Bob says %s to fred" can't be detected because the 'to fred' bit just looks like more text to go in the %s section. Generally, %s will only work properly at the end of an entry in the 'from' box. In the 'to' box, it's a little more reliable. AIR files: Obviously, this method can't really swap anim frames and numbers around in the AIR file. You'll have to do that yourself. ----------------------- The fix files The three included fix files are designed to fix files from the 2000.01.01 version of MUGEN to the 2000-06-27 version. There are several fixes made to the CNS which are not mentioned by elecbyte as far as I can see, for example the ' = Time [0,x]' expression is no longer allowed - the fix file replaces this with '= Time <= x' Reliability of the fix files def2000-06-27fix.mfx <- if this doesn't fix your DEF, I'll be surprised! cmd2000-06-27fix.mfx <- pretty reliable. There aren't many odd syntax issues. cns2000-06-27fix.mfx <- Well, it does all it can! Problems like sloppy syntax, extra parameters and floats where integers are required must be left up to us humans. If you remember to check for these when MUGEN complains, it shouldn't be too hard to fix your character. Majere, 20 July 2000, at almost 3.00 am- I must be insane.. ;-P