Jump to content
Sign in to follow this  
rübe

FSM Editor: scriptedFSM.cfg fix (extra comma in FinalStates, "NO TOKEN")

Recommended Posts

The current/official version of the scripted FSM compiler for the FSM Editor v.1.2.1 (i.e. the file: scriptedFSM.cfg) is slightly borked, as it produces a comma, and hence a state (without token - and that's what MakePBO for example yells at you: "NO TOKEN"!) too much, while printing the final states.

While this has been always the case and obviously causes no real problems (e.g. in game), tools like Mikero's might refuse to accept shitty code... and before we all end up packing our pbos verbatim - therby bypassing lint - why not simply fix the scriptedFSM.cfg instead:

old/sloppy code (lines 44-47):

    class FinalStates
    {
      print_1 = """%(finalStateName)"",\n";
    }

new/fixed code:

    class FinalStates
    {
      iffirst_yes = 1;
      print_1 = """%(finalStateName)""";
      iffirst_no = -1;
      print_2 = ",\n""%(finalStateName)"""; // not first, use comma separator
    }
    print_fs = "\n";

That is all.

Granted, this produces some blanks/spaces too much, but whatever... at least the indenting is spot on. :P

Make these changes yourself and use that compiler from now on or download this zip including a small readme and scriptedFSM-fixed.cfg which you need to copy to your FSM Editor directory to from now on select as compiler...

Tweak on!

8)

Share this post


Link to post
Share on other sites

Nice one :)

Share this post


Link to post
Share on other sites

thank you for your comments ruebe

the fact of the matter is, bis cannot have it both ways.

bis binarise screams it's head off when creating islands (eg) in ANY config if it discovers trailing commas in arrays. Not configs for THE island, ANY config on your pDrive

it is the source of the perplexing 'error 3' in the binarise.logs

So either bis change that to 'allow' trailing commas, or, they fix fsm. The choice is theirs to make.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×