sfall script editor

Discussion in 'Fallout General Modding' started by Timeslip, May 29, 2010.

  1. Timeslip

    Timeslip Water Chip? Been There, Done That
    Modder

    921
    Aug 15, 2007
    Since FSE doesn't play nicely with sfall's script compiler, I've started knocking up a new script editor of my own. At the moment it has only basic file open/save/compile, syntax highlighting and code folding, so if anyone has their own ideas of useful features for a script editor, now would be a good time to make suggestions.



    It includes a new version of sslc to do its compilation. It can do its own preprocessing, and can do a small amount of optimization on the scripts it generates. There's also some slightly better code emitted for for and foreach loops, some better behaviour for escape sequences in strings, and 'pure' and 'inline' are now keywords. It can still be used separately by anyone working from the command line; run it without any arguments to get a list of the new options. (For anyone using p.bat, the inbuilt preprocessor will save having to get watcom/visual studio working.)

    It'll be replacing the compiler.exe/dos4gw.exe combination in the sfall modders pack at some point, but for now download from here. (Edit: Download removed; it's out of beta and is an official part of the sfall modders pack now.) This is a very early alpha version, so it goes without saying that you should expect it to repeatedly stab you in the face. (Especially if you turn optimization on; If you see suspicious messages pop up in the compiler output, it's worth running it through int2ssl to make sure the compiler hasn't done anything too stupid.)
     
  2. Lexx

    Lexx Background Radiant
    Moderator Modder

    Apr 24, 2005
    What I like very much in FSE is, that you can register a script in the game files (F7 or Script -> Register Script). Thanks to this, you don't have to manually add lots of entries in the game files... FSE also has features like the MSG editor / node editor, etc. but I think that this is rather useless. At least I personally never used it-- I tried it a few times, in the hope, that it will make stuff easier for me, but in the end, I never could really work with it.

    What I also like in FSE are the functions for adding procedures (Script -> Add procedure). After a while you learned all available procedures, but sometimes it's still faster to not write it yourself, but click it together.

    The functions for registering variables (map, local and global) is good as well.

    So... this is something I would consider a kind of "must have" features for a Fallout script editor. :)

    /Edit: Beeing able to compile more than one script at a time would be cool too.

    /Edit #2: The right column in FSE, with that you can jump from procedure to procedure, has always been very good to me. So I would appreciate something like this too. :>
     
  3. Graveworm

    Graveworm It Wandered In From the Wastes

    112
    Mar 28, 2010
    would be good, i think, to add an option to test just wrote script onto conflicts with other installed, if it is possible
     
  4. Timeslip

    Timeslip Water Chip? Been There, Done That
    Modder

    921
    Aug 15, 2007
    Great, there's some good stuff to be getting on with. Some parts will need me to write some sort of syntax parser though.

    I've uploaded a new version with a register script button and bulk compilation options, (with multithreading, for added somethingorotherness,) and also with an edit menu, (ctrl-c/x/p/z/y already worked, but some people like the menus,) and an 'outline' menu option that folds all the procedures down to their definitions. (The best your going to get as a replacement for the procedure window, until I can parse the code well enough to get procedure names out.)

    I've also fixed a couple of bugs in my new sslc, that resulted in hangs while compiling some scripts and crashes while compiling others. It can churn through most of the vanilla scripts folder now even with optimization turned on; they're just a few that fail due to preprocessor errors. (Some scripts give a third argument to the NLowOption, which generates a warning in VS and presumably watcom, but is an error in the preprocessor I used.) It also no longer gives unused procedure warnings for any of the procedures that fallout calls directly.

    And how the heck would you propose to do that?
     
  5. Graveworm

    Graveworm It Wandered In From the Wastes

    112
    Mar 28, 2010
    dunno, just supposed :mrgreen:
     
  6. Darek

    Darek is currently unavailable

    Jan 7, 2008
    Decompiling scripts would be useful. Especially if you can decompile many at the same time. From one folder to another. And a global search function would be nice.
     
  7. .Pixote.

    .Pixote. Carbon Dated and Proud
    Modder

    Sep 14, 2009
    Timeslip what do you do for a living…obviously its programming related…but what. Just curious that’s all, but I must say I’m amazed at the skill/knowledge you possess in regards to these things. :shock:
     
  8. Josan12

    Josan12 Vault Senior Citizen

    Oct 15, 2007
    Timeslip: you are my hero - truly a master of the source! (Did you know you've been immortalized in the RP, BTW??)

    Yes. I'm interested too. Tell us!
     
  9. killap

    killap Bear Dude Moderator Modder

    May 16, 2005
    Very nice Timeslip!

    If your version of a script editor has the following features, then I would be quite happy.

    1. compile/decompile
    2. register script
    3. .msg editor - only because I like to load up a script and its relevant .msg file at the same time
    4. error on compile that actually points to the correct line with a useful error message
    5. doesn't crash after several hours of usage - especially on program exit.

    That's about all I use of FSE.
     
    • [Like] [Like] x 1
  10. Ardent

    Ardent A Smooth-Skin
    Modder

    681
    Jul 24, 2009
    Timeslip, you're a real gem! The new script editor is excellent news!

    I'd like to second the option to have the msg editor, like it works in FSE - as Killap pointed out, it's nice to load a script and its relevant msg file. Also, FSE had a useful option of creating new msg files from the editor (e.g. you had a script called abcdefg.ssl and it would create abcdefg.msg if there wasn't one earlier).

    Other requests:
    * FSE has the option to include Header files (F5), where a window pops up and you can choose the header you want to include.
    * A nice option would be to open several scripts at once, i.e. Shift/Ctrl-click them from the Open window.
    * I'd be grateful to have the possibility of creating script templates and assigning them as default script bases, for critters, items, spatials and maps.
    * The code auto-fill-in options are of course very helpful, especially for noobs like me; Moreover, FSE has the list of commands editable, which is very good too.
    * The option to divide the screen to see the script code on the left, and the relevant msg file on the right.
    * Hotkeys to commenting out selected portions of scripts.
    * A super-duper option would be to have a tooltip which displays the contents of a message string. For example:
    Code:
    NOption(120,node999,4);
    When you hover the mouse over the msg reference (120), a tooltip pops up containing the text from the msg file, or at least a snippet of it.

    I'll post again if I think of anything new.

    EDIT----------

    * The possibility to add procedures in batches. This would be extremely useful for scripting dialogue. You'd type in the name of the procedure and the range, click OK and the tool adds e.g. forty procedures, from Node001 to Node040.

    END OF EDIT------------

    Thank you again for this excellent enterprise, Timeslip!
     
  11. Dude101

    Dude101 Vault Fossil
    Modder

    Aug 3, 2005
  12. Lexx

    Lexx Background Radiant
    Moderator Modder

    Apr 24, 2005
    Oh god, that would be great.

    Or if you could toggle between number and whole msg string / x signs of the msg string. That's really dreaming, but imagine...
     
  13. lisac2k

    lisac2k Vault Senior Citizen
    Modder

    Oct 26, 2004
    Hey, Lexxorz, did you try to contact Jargo about the FSE source code yet? Probably would mean a lot to Mr. Timeslippery, and I bet Jargo would be willing to give it away for such a noble purpose :mrgreen:

    Cubik might contact him as well, but I don't see him around here as often as before (look who's talking :roll: )
     
  14. Jesterka

    Jesterka Water Chip? Been There, Done That

    912
    Mar 16, 2006
    I heard this could considerably reduce our super-heavy scripting problems. Bravissimo, lets continue. :clap:
     
  15. Lexx

    Lexx Background Radiant
    Moderator Modder

    Apr 24, 2005
    I didn't, got no time and was distracted then. Also it was just a idea from me, if I remember correct.
     
  16. Timeslip

    Timeslip Water Chip? Been There, Done That
    Modder

    921
    Aug 15, 2007
    More good ideas. They're coming up faster than I can code here. :P

    The third alpha is up. When you compile you now get a neat list of all the errors and their line numbers, and can double click them to take you straight to the relevant line, opening the required file for you for errors/warnings in the headers. You can decompile by using the normal file|open menu, and just selecting a .int instead of .ssl. (You you can also open .msg's that way too. They highlight properly, but apart from that there's nothing special about them, or linking them to any particular scripts yet. I just treat them as plain text.) There's a new search option that lets you search the currently selected file, all open files, or all files in a directory, (and optionally its subdirectories.) Searches can be plain text or regex, and you can either stop at the first match or build a list of all matches that you can jump around later, in the same way as the errors list. There's also a few other smaller bits and pieces like some syntax highlighting fixes and remembering the window position.

    @Ardent
    You can already ctrl/shift to pick multiple files in the file|open menu. That's been there since the beginning. :P

    Also, for dividing up the screen, for the moment you can do that simply by opening two copies of the editor. Hopefully I'll get something in for next time to make that unnecessary though. :whistle:

    And I'm always amazed at people capable of drawing art. Each to their own. :P

    But to answer the question, I'm not doing anything for a living. I'm still a student, and will be for a few more years yet. (And no, I'm not studying anything IT related.)
     
  17. killap

    killap Bear Dude Moderator Modder

    May 16, 2005
    Very nice update Timeslip! :clap:

    Another feature I would be most appreciative of is an extremely large undo/redo buffer. I do often make use of ctrl+z/ctrl+y dozens of times in a row on many occasions.
     
  18. Timeslip

    Timeslip Water Chip? Been There, Done That
    Modder

    921
    Aug 15, 2007
    Something else that's been there since the start. There's no particular limit to how much you can undo. It can certainly manage a few dozen. :)
     
  19. Ardent

    Ardent A Smooth-Skin
    Modder

    681
    Jul 24, 2009
    A great update. Thanks, Timeslip!

    Just tested it. Maybe it's there but it's certainly NOT working for me. Neither shift, nor ctrl, nor both.
     
  20. Timeslip

    Timeslip Water Chip? Been There, Done That
    Modder

    921
    Aug 15, 2007
    odd, it certainly works here. It's not something I've written; it's just a bog standard windows file open dialog, so there's not any room for it to be going wrong. If you can't get multi select in it, then presumably you can't get multiselect in any windows application whatsoever that uses the standard dialogs either... :?