ScriptEd 1.50-beta released (1.50-beta Build 3)

Discussion in 'Modding and Scripting Support' started by Dj_Unique, Jul 13, 2008.

Remove all ads!
Support Terra-Arcanum:

GOG.com

PayPal - The safer, easier way to pay online!
  1. Dj_Unique

    Dj_Unique Member

    Messages:
    79
    Likes Received:
    5
    Joined:
    Nov 14, 2001
    Here is the current build of the new ScriptEd I've been working on for a few weeks.

    http://de01.rackglobal.com/~djunique/fi ... -setup.exe
    (Last updated: 25.7.2008 12:35)

    ScriptEd 1.50 is also now hosted on Terra-Arcanum

    Please note that this version is still in heavy development and may not necessarily work as intended so proceed at your own risk.

    --- KNOWN ISSUES --- (These are being fixed)

    - Compressed module support is very limited at the moment. The mes files are loaded but scripts aren't shown in the 'Load Script' window. I'm working on fixing this. It is recommended to use uncompressed modules only at the moment and only compress finished modules for distribution.

    - The main Arcanum data can be loaded but since some of the data resides in a different location (such as scripts and dialogue), support for main module editing is not yet complete. This is also on my to-do list.

    - For an unknown reason, starting up may fail and you get the exception EInOutError (invalid filename). I have yet to find out what causes this.

    For the curious individuals, the source code is included in the installer, just choose 'Full source code (including plugins)' in the installer component selection to install the source files.

    First things first:
    Your Arcanum installation is automatically detected from the registry by ScriptEd at startup. If it's not found, it will use opcode message files supplied with the installation BUT module selecting will be disabled.

    ScriptEd is able to support multiple Arcanum installations. You simply specify the Arcanum installation you wish to use by going to the preferences->General Preferences tab->click on the folder icon below the label that says 'Arcanum install path'. A restart of ScriptEd is recommended to reflect the changes, as the data is not reinitialized currently but this will be changed in an upcoming build.

    To load your module data, choose File->Select Module and choose the module that you wish to edit. This will load the following mes files:

    Note that the list of module files loaded will be expanded later, feel free to suggest which files to add to the module loader list.

    Most of these files have an attached editor in the Module: <module> menu. Currently there are 2 special editors implemented: Quests and Journal Entires. The rest of the files use a generic mes file editor.

    Some usage instructions:

    *** The script parser is currently case sensitive ***

    When writing scripts, you can invoke a list of available commands and focus strings (Player, Attachee etc.) with ctrl+space. Currently there is no parameter wizard so all (obj) and (num) parameter placeholders have to be filled in manually. The other option is to type the complete line by hand.

    When writing a single line, pressing enter will invoke the compiler that will compile the script written so far, so it updates in real time.

    When writing a condition, the compiler won't be invoked until after the THEN statement.

    To create a dialogue file for your script, save it first with a filename, then press Script->Create Dialogue. This function will go through the script and look for dialog / float line / print line commands. Currently only parameters of type 'Number' are supported but more complex assignments will be worked out later.

    In the dialogue editor, there is a button called 'Edit dialogue header'. This will invoke a screen with a memo control that allows you to write some information about the dialogue to be placed at the beginning of the dialogue. There is also a button called 'Insert variable info'. This will scan through the dialogue, checking node actions and player option actions and conditions and build a list of referenced global variables, global flags, rumors/journal entries, quests and inventory items. This information block is inserted only once so if it already exists, it will be selected and replaced with the updated data in case something has changed. More trackable variables will be added later.

    Anything else you need to know, just ask. I didn't have time to write a proper help file yet but that should be coming up in the stable release as well.

    Updates are done to the tool on a fairly regular basis, depending on what needs to be fixed.
     
  2. team a

    team a New Member

    Messages:
    580
    Likes Received:
    0
    Joined:
    May 10, 2007
    Sick! I'll check this out and hopefully post about problems/comments soon.
     
  3. team a

    team a New Member

    Messages:
    580
    Likes Received:
    0
    Joined:
    May 10, 2007
    Re: ScriptEd 1.50-beta released (For volunteering testers on

    I tried to change the Arcanum install path under settings, but it didn't save when I closed and re-opened scripted. I have 2 installs of Arcanum, one for the vanilla version + Drog's patch, and one for my own modding. I do this so I don't have to create my own gamelib .dat file every time I test, rather than just putting files in the Arcanum/data directory. I have had no problems with the old scripted, as I just copied the scripted install directory and everything got saved in the old ScriptEd. I believe this worked because the old scripted put a scripted.ini file in the place wherever it was loaded, and that file had the following entry:
    Can I enter a line in the new ScriptEd to change the Arcanum install directory? I'd rather not change my windows registry if possible, but I will if necessary, as I know it's an early release.
     
  4. team a

    team a New Member

    Messages:
    580
    Likes Received:
    0
    Joined:
    May 10, 2007
    First, I have to say that the new scripted looks awesome. I can tell that you've added some functionality that I would only have dreamed of in the last release, even if it isn't complete yet. Here are some of my comments on the script parsing - hopefully they'll help in creating a finished version. I realize that this is very, very long, and I apologize to everybody for that.

    ---

    0. It seems that script commands can only be written on certain lines. There has to be a line number (? - the small black numbers in leftmost column) that has a blank line before and after it. This can be frustrating, because I'd like to just be able to type a command in, say, on the bottom line, but instead I have to make sure there is an extra line before and after or the line I'm writing will be deleted. Also, it seems that I can't put two lines next to each other, or the second will be deleted - I have to space these too. I know that you might need the lines before and after for compiling purposes, but you could always put this in but not let the user edit them in the first place, because if the lines before and after a command are deleted anyway, it seems that there's nothing useful that could possibly be put in them anyway.

    1. How do I add comments? I can see that putting in two slashes changes the font and makes a comment, but then the parser just tells me that it can't determine the OPcode for the line. I've tried using the rightmost field as well - I assume that this is for comments.

    2. Love the MES editor.

    3. Would it be possible to add headers for MES files? I'm mainly thinking of the ones TROIKA put in, but I sometimes add some as well. Minor issue, though.

    4. Is it possible to disable compiling whenever I hit enter? Sometimes I'll leave out values for lines like "goto line (num)", as I know I need to go to a different part of the script, but haven't written that part yet. However, this is pretty useful to have on some of the time. The more I use the new scripted, the more helpful it is, but it would be nice to turn off, in case I'm laying out the structure of how I want a script to be, without all of the commands I've written being complete yet.

    5. Script compile speed is ridiculous compared to the old scripted. Great work.

    6. Any possibility of an undo command? The new scripted seems even more likely to delete my lines on compilation rather than give me an error message, and it would be a pain to always have to retype them. This would be especially bad if I forget that I have to space every single one of my commands. Using "undo compile" just deleted everything I had. Is this just something where the functionality hasn't been added yet?

    7. On compile, the script gets rid of all scripted line numbers (the little black numbers in leftmost column) except for the ones with commands, and before and after commands. If there are going to continue to be blank lines before and after script lines, it would be helpful to leave two at the bottom, because otherwise I'd have to add another line every single time I compile, then want to add a new command below the bottom one. It might be even better to just get rid of the blank extra lines when scripts are saved and loaded

    8. Is it possible to add opcode macros? I can see that most of my favorites are still there from the old scripted (gf, gv, rets), but some are missing like dn (do nothing). EDIT: seems that dn works, I will try to figure out why it didnt work for me previously. It would still be nice to add some, though.

    9. I like how column widths are remembered for load module / load script. I always wished scripted did this. Would be nice for the settings to be saved for the next time scripted loads, however.

    10. Would it be difficult to add a search function for load script? I am working with around 200 scripts on my mod, and there are many times that for Arcanum. Even when I know which script to load, and try to name important scripts in ways that make them stand out, it can take me awhile to find them. It would be nice to have a search field under every column of the load script window, where I could type the script number and it would scroll down and select it, or start typing the name of the script. A bonus would be searching for keywords, if there are many scripts that start with the same name, but that would be secondary.

    11. If I'm loading a module without one of the necessary files, such as gameflags.mes, it would be nice to get a warning message with the files that couldn't be found and load the module anyway, rather than simply not loading it (EDIT: actually, it seems that it does load it, but forgets to change the text under the Module: <name> menu). Or, the option to either load it anyway or to cancel. Kind of unimportant, though, since worlded creates any missing files that are part of the module template directory.

    12. I like that the description can be changed from the actual text window with the script commands, but when I type a description then compile, it throws some gibberish at the end.

    13. Couldn't load a certain script with dialog. This is the error window:
    It then didn't show the script lines, although if I opened the dialog editor then closed it, it would then show the script lines. It looks like this is due to not using "//" for a comment, although TROIKA did this all the time, as only bracketed values are read by the game engine anyway. I don't have too much of a problem adding slashes, though, but it would be nice if scripted interpreted everything not in brackets as comments, or even if it found data like this, it would just skip over it and function normally.

    14. It would be nice to have buttons below the menu options for things that are used really frequently, like "edit dialog", "compile", "edit global flags"

    15. I would really like to be able to cut and paste - the ctrl+c shortcut for condition might need to be remapped to something else. The same goes for ctrl+a for select all.

    16. Some issue with line overruns across columns in about window

    17. I like what you are doing with script templates. I'd like them even if I didn't realize that I can probably create my own, which is a pretty amazing feature at this point in development. I'd also be willing to help write these.

    18. For the "NPC initiated dialog" script template, I have a few comments. I'd copy and paste, but there's the copy shortcut problem I mentioned above. Instead, I just copied and pasted from npcdialog.dws

    -looks like you need a new variable for the line that this starts on, if this isn't inserted on line 0
    -as this is assumed to be a heartbeat script ("change script attached to Attachee at point 19 to script 0"), you probably don't have to have the script call itself. It's going to keep calling itself at line 0 anyway, so this could be problematic. An HB script like this might also be needed to perform other functions, i.e. initiating dialog AND setting a certain gf if the attachee is dead, and using two HB scripts might be useful. Here's my suggestion, which I created by adding a new line to helperscripts.dws and adding a new dws file:

    19. Dialog Editor node navigation is unbelievable. I really like how new nodes can be inserted, and the list can be rearranged very easily. No more scrolling through notepad for 40 screens!

    20. The edit dialog menu option for scripted shouldn't be available unless the dlg file has already been created with the create dlg file option; otherwise, all of your work will be lost. Also, scripted doesn't seem to always recognize if there's already a dlg file, and the create dlg option is still available regardless, and the remove dialog option unavailable

    21. love the remap function, especially how the dialog and script editing programs work so seamlessly

    22. I really like how a comment is added to the script to indicate when the script was last edited, but I don't know the conditions for adding this, so I haven't been able to recreate it

    23. It would be nice to have the "last edited" data available under the load script menu for a loaded module

    24. The header created for the dlg file is really helpful. I used to try to add a table of where a script file calls a dialog, but I stopped because it was so time-consuming. This is really helpful. It would be nice to have the date and time it was last edited here as well.

    25. I don't know how difficult this would be, but something I really try to keep track of is where a dialog line is called by another script's dialog line. For example, when the player is talking to one person, i.e. Vollinger, then something the player says causes the dialog to resume at someone else's dialog, i.e. Virgil's. I wonder if this could be kept track of with scripted as well. However, I use one script line with "call script attached to clo at point gv1 at line gv2 with triggerer triggerer", where line gv2 on the clo's script is "dialog gv 3", etc... so this might be effectively impossible. It might be helpful for the scripts of sane people, however.

    26. The "use text from male npc line" check box under the dialog editor doesnt work quite right. If I enter something for females, then check the box, it won't use the male line. This is even if I delete the female text then check the box. However, I did notice that typing anything in the male entry field did change the female line, but checking the box alone didn't do what I expected. This might be intuitive for some people, but not for others. I can see why it would be good to actually require typing something further in the male box, because you wouldn't want checking the box by accident to delete everything for the female text. On reflection, what you have is probably the best way to go, so commenting on this in the help file might be the best solution.

    27. Copying and pasting of PC lines in DLG edit: Wow. I really, really love this. I have probably spent something like 5-10 hours total of my modding career just copying and pasting PC lines from node to node, renumbering them, etc. This is probably one of the most useful functions of the new scripted. It would be even more helpful to be able to select and copy multiple lines at the same time.

    28. Editing PC lines in dialog editor: To save time, it would be really helpful to be able to edit the fields directly, spreadsheet style, without using the PC line wizard. THis is a major advantage that notepad currently has over your dialog editor. I imagine that there will still be some use for notepad in conjunction with dialog editor at this point, with dialog editor taking care of the line mapping, remapping, and gathering data, etc. after a document has been created with notepad. Of course, the more functionality and speed of your editor, the better.

    29. PC line comments: it would be helpful to have these in a column to the far right in the place where PC responses are listed. Otherwise, they aren't very accessible, and the user might forget that there's even a comment there, or might spend awhile looking for them.

    30. Minor grammar issues: "actions" not capitalized for the tab above where PC responses are listed. Also, "copy" and "paste" buttons not capitalized

    31. For floats, it's good to see the "starting entry of a float message group" checkbox. I assume that this is for line renumbering. I'd imagine that the box should really be checked for each and every float line, rather than just the first one. It would be nice to have an option to just add a block of floats all at once, where the floats will appear under a single node, and there will just be a bunch of fields for different NPC floats rather than a section with PC response lines. THis would also help reduce the number of node entries in the left side of the editor window.

    32. To be able to look through the node entries, I would really like to be able to categorize them. For instance, you might have a "starting line" check box under a NPC line, to indicate that this dialog line is directly called by the script. The node text in the left panel would then, for instance, change to a larger point font, or become orange, etc. This would really be helpful because there are some parts of a dialog that are just more important than others. Take for example a follower's dialog. The first line of that dialog isn't the menu the PC gets when clicking on the follower; instead, it's usually just the greeting when the PC meets the potential follower for the first time. The actual follower meny might be down in the 400s section. Or, take the dialog for a very important NPC. There might be a section near the top for the first greeting, but there might be a section below for the initial greeting of unintelligent PCs, or unlikable PCs, or sections for when the PC has returned later, or where the NPC starts dialog with something like "I hope you've re-considered my offer" etc. These are the really important lines in a dialog, as they are a logical break from the sections above, but the sections following them flow logically from what the player picks. I usually spend a lot of time trying to separate them in notepad, and spend a lot of time scrolling around trying to find the right section. Having the important nodes in a different color, bold, underlined, or different font size, etc., would be really helpful. There could also be section dividers: as it is, I can see myself creating nodes named "-----" just to try to sort through 100 node names. Having an option to make a node appear important in the left-side menu is something I consider really important.

    33. When remapping, I sometimes get this error message in a window:
    34. When I edit the dialog header, scripted stops putting the useful call dialog lines into the dialog header.

    35. It's really helpful when scripted automatically replaces the opcode macro I just wrote with the actual string, without waiting for me to compile. THat way, I can be sure that I didn't mistype something like "esiv", and if there is ever a conflict between the custom opcode macros and the actual opcodes (I remember scripted used to not be able to do "toggle (obj) open/closed" because it wanted to interprit "clo" as current looped object).

    36. I like the ability to insert variable info into the header. It would be great to eventually be able to link and open a window with it while editing, like clicking (or right clicking) on "Global Variable 1" in the scripted main window and having a new window pop up on the side with the info from the mes file, or have it output in the debug window at the bottom.

    37. I know you said that you are going to eliminate a lot of the debug messages once this program gets closer to a final release, but it would be nice to be able to choose how verbose the logging is in the preferences menu

    38. I have begun to understand why there are blank lines in between commands in the main window - for the subclauses for conditions. It would be helpful if the parser didn't delete everything after a line if a command is an action, or delete lines below the "then" and "else" parts of a condition, and interprit these new lines as seperate commands.

    39. If possible, it would be helpful to have an output to the debug field if scripted deletes a large string of text from the editing window because it isn't interprited as part of a command. While this is unlikely with the automatic compiling with enter, it could still happen that I type 15 lines, and some of them are close together or there is something else wrong, and one gets deleted, screwing up my dialog. As I can make all the lines first and press down instead of enter in between typing lines, this could happen, and sometimes happens regardless, if a line isn't matched with an opcode. I don't know how the parsing works here, so it's just a suggestion.

    40. I like that there are plugins - I can just imagine the useful functions that could be added. I would guess that adding a plugin would also be easier than releasing a new version of scripted to add functionality. I haven't been able to determine exactly what Script Dependency Checker does, though.

    41. The dialog editor evaluates blank lines as floats: For example:
    Rather than 40 and 45 being nodes, it's 40, 42, 43, 44, and 45 that are nodes. While I don't do this personally, there are scripts in Arcanum (and TROIKA mods) that do this. Again, keeping with trying to minimize the list of nodes, or be able to differentiate the many values, you might gray out the names of nodes that are blank, or have the option to delete all of them, or have gray for floats and very light gray for blank floats like the ones above. This is just a suggestion - it's probably worth discussion first.

    42. What does the "line number step on each dialog node" option do under the scripted preferences window? Is this the default falue for "line number increment on each node" in the remap line numbers window? It doesn't seem to have any effect to set it in the scripted preferences menu, then go to the remap line numbers menu.

    43. I sometimes get windows access violation error windows when loading my module. However, it used to load it fine when I tried earlier, and I havent changed anything. Based on not getting error messages when loading others, it looks like the error comes from trying to open gamebook.mes, as the last debug output was "loaded mes file GameRep.mes (1 entries)" and gamebook.mes appears to be next.

    -----

    That's all my comments for now. On the whole, I have to say that this is an amazing tool. I'm surprised by what is already available, and I didn't think any of the problems I had detracted from using ScriptEd, with the exception of not having two actions on adjacent lines, and not being able to change the Arcanum directory, but I could get around even these. Considering that this is an early release, I have to say that I'm really impressed, and I'm looking forward to where this tool is going. Keep up the good work, DJ_U!

    EDIT: Sorry for the triple post. Considering that the posts were made at different times, I hope the admins won't ban me in this case. I probably should have used EDIT instead, but I guess it's too late at this point.
     
  5. Dj_Unique

    Dj_Unique Member

    Messages:
    79
    Likes Received:
    5
    Joined:
    Nov 14, 2001
    Working on these issues at the moment. The script parser is almost fixed, it no longer ignores single lines without line numbers and is able to parse them properly. Some issues still remain though, hopefully I can fix them soon. Specifically lines without numbers mixed with numbered lines are causing trouble.

    A short example script:
    Code:
    0. dialog 1
    do nothing
    
    1. return and SKIP default
    The above example is what I'm currently trying to fix. Right now the "dialog 1" line vanishes into nothingness. This is a bug in the parser but I'm sure I can fix it.

    Auto-compiling has been made toggleable so I suppose I'll be posting up a new installer soon so it'll be a less of a pain to work with the script editor.

    The npc autodialogue template has been replaced with your suggestion for the NPC auto-dialogue. I currently don't have documentation for the DelphiWebScript commands that are available for helper scripts but you can just use the EditorAddLine for each line to add in a template.

    The opcode macros, which are now autocorrection shortcuts, can be found in the file autocorrect.lst
    They are triggered each time you press space or enter after typing one.

    You can add new ones simply by editing this file in notepad, but the changes won't be reflected until you restart ScriptEd. The format is:
    <shortcut>[TAB]<correction>

    Here's a list of the current ones:
    Code:
    rets	return and SKIP default
    retr	return and RUN default
    atc	Attachee
    plr	Player
    trg	Triggerer
    dlg	dialog
    lv	Local
    pc variable	PC Variable
    lp	loop for
    lend	loop end
    lb	loop break
    gv	Global Variable
    gf	Global Flag
    pcv	PC Variable
    pcf	PC Flag
    flt	float line
    abv	above
    goto	goto line
    isn	is named
    dn	do nothing
    clo	Current Looped Object
    eiv	Everyone in Vicinity
    The Script Dependency Checker plugin scans the binary script code currently in memory and looks for any of the 3 call script opcodes. If any of these are found, it should list the script files for each reference.
    I'm going to add a few more opcodes for it to look for, such as 'change script' etc. It doesn't work too well so far so I need to work on it some more. Currently only script data is available to plugins but I will add more data that they can use, such as the dialogue nodes and some common mes file data (global flags and variables for example), which will definitely make more plugin types possible.

    As for what you asked about the 'Float line' and 'STtarting entry of a float message group' checkboxes, it's only used in formatting the dlg file in such a manner that the float messages appear as their own group of single dialogue lines. Therefore this has *NOTHING* to do with line number remapping.

    Well, time to get back to fixing those bugs.
     
  6. team a

    team a New Member

    Messages:
    580
    Likes Received:
    0
    Joined:
    May 10, 2007
    More comments (although hopefully not as many as last time):

    1. MES Quest Editor doesn't actually compare line numbers from gamequestlog.mes/gamequestlogdumb.mes and gamequest.mes. Instead, it takes the line numbers from gamequestlog&gamequestlogdumb, then matches the gamequest.mes entries with them regardless of line number. For example, if I have quest 1000, 1001, 1002, and 1003 in gamequestlog, but only 1000, 1001, and 1003 in gamequest, the data from gamequest.mes' line 1003 will be matched with gamequestlog.mes' line 1002, and the data will be shown as quest 1002 in the MES editor. Selecting 1003 will cause a read access error.

    2. MES editors: clicking on an entry brings up the correct data in the bottom fields, but scrolling up and down using the arrow buttons does not

    3. Until an entry is selected, the comments and text fields have the same data as an entry selected from the previous MES file that was opened

    4. Gameoname.mes - the editor is especially in need of division or separations of sections of this file, as onames for different object types have hard-coded value ranges (I.e. "Scenery ranges from 1800 - 1979" doesn't work very well as a comment for entry 1800)

    5. Journal Entry Editor - I know that some of these editors are placeholders, so the data can be altered for now until further functionality can be implemented. Some suggestions for a more complex journal entry editor: List the nodes by quest number, then have entries at the top by socail class (just the social classes actually being used, not all of them). The bottom, where the data can actually be entered, could really use a "use the same as male to male" type check box for each of the other entries, although it's conceivable that a m2f entry might be better served by using the f2m option rather than m2m, if it isn't already copying the m2m entry. I also have comments for a newspaper editor, but I'll hold back for now because I realize that I've probably already swamped you.
     
  7. Dj_Unique

    Dj_Unique Member

    Messages:
    79
    Likes Received:
    5
    Joined:
    Nov 14, 2001
    The quest editor assumes that all 3 files are kept in sync but I will try to fix this. It doesn't account for non-existent entries in-between. Just needs a few changes to the OnClick code of the quest list. Whenever you add a new quest, each 3 files are updated but if the quest doesn't concern the dumb player or the smart player, you can simply just leave the corresponding text entry empty.

    As for the other suggestions, I will consider these, however I really feel like there's way too much to do as it is so I'll have to reserve more time for implementing them. The journal entry editor suggestion in particular sounded so complex that I don't think I can do that right away. Will be done in the future, though.

    A more specific newspaper editor was what I've had in mind also but I'm not going to do that right now. I feel it's more important to stabilize what's already there than to get swamped with thousands of feature ideas.

    Here's a little changelog of what I've been able to do so far, all in one days work:

    - Fixed Arcanum installation path management so that
    you can specify a folder own your own choice if you have
    multiple copies of Arcanum installed.

    - Added an MRU menu for module scripts. The full path is
    stored so in case you changed the module in between loading
    scripts, they can be accessed again easily.

    - Added a toolbar to the main form. Currently contains four commands - Compile Script, Edit Dialogue, Edit Global Flags and Edit Global Variables. More will be added, of course.

    - In addition to the MRU menu, listview column widths are also
    saved from the module script loader window. This way the
    columns are at the exact width that you had them when
    you last quit ScriptEd. These settings are saved to ScriptEdFormData.ini

    - Added a few more configuration options. Compiling script on
    pressing enter can now be disabled.

    - Implemented default line number step when
    adding new nodes.

    - Fixed issues with some plugin related functions. Modulepath
    should now be returned correctly but sometimes it becomes
    garbled. Just problems with passing data from the EXE to a DLL.

    - Female npc text is now correctly updated when you toggle the
    'use text from male npc line' checkbox on. This is a toggleable option
    if you don't wish to have this kind of a behaviour.

    - Added optional gender specific strings. These are used for
    automatically synchronizing npc text for the female player with
    corresponding words such as 'sir' with 'madam' etc. as you
    type the text in either of the fields. These can be customized in
    the preferences menu.

    - Added a safety check when creating a new dialogue. This
    is due to some reports about the existence of the file
    not being recognized. So now it will confirm whether the user
    wants to proceed in either case to allow
    canceling out of the creation process to prevent data loss.
    I need more info on this issue, unable to reproduce it.

    If it helps anything at all, this is the code to create the dlg filename to check for:

    Code:
    DialogueFileNam := arcanumpath + '\Modules\' + modulefolder + '\dlg\' + changefileext(currentscript.filename, '.dlg');
    Where 'arcanumpath' is the currently set Arcanum installation path and modulefolder is the currently selected module.

    - Finetuned script parser to allow consecutive lines without
    linebreaks in between. More finetuning is still needed but
    it should work a little bit better now.

    - Pressing a key in the MES editor updates the selection correctly.

    - Added helper script commands for selecting data from mes
    files. The following commands are implemented:

    function SelectGlobalFlag : Integer;

    Invokes a window for selecting a global flag. Returns the MES entry index for the global flag.

    function SelectGlobalVar : Integer;

    Invokes a window for selecting a global variable. Returns the MES entry index for the global var.

    function SelectPCFlag : Integer;

    Invokes a window for selecting a PC flag. Returns the mes
    entry index for the selected pc flag.

    function SelectPCVar : Integer;

    Invokes a window for selecting a PC variable. Returns the mes
    entry index for the selected pc variable.

    function SelectQuest : Integer;

    Invokes a window for selecting a quest (from GameQuestLog.mes). Returns the MES entry index
    for the selected quest.

    function SelectRumor : Integer;

    Invokes a window for selecting a rumor or journal entry (from GameRD_NPC_m2m.mes). Returns the
    MES entry index for the selected rumor / journal entry.

    function SelectInternalName : Integer;

    Invokes a window for selecting an internal name. Returns the
    MES entry index for the selected internal name.

    - Added global flag / variable / quest / internal name
    information display when right-clicking on certain script lines or
    'Global Flag'/'Global Variable' keywords. Can also display
    dialogue lines or float messages if they are being called
    as regular numbers. A little popup info window comes up, displaying
    the information text that was triggered at the line.

    Potential future addition: Code to track usage of a global variable can be added later as well, it could go through the dialogue condition and action data and also check if the script contains any assignment commands and then display all possible values for this particular global variable.

    More fixes are to come but I just thought I'd show the current list of fixes.

    The current to do list is so huge that I'm beginning to think whether I'll ever get a stable version out after all. It may be months or even years away at this rate if the list grows any further.
     
  8. team a

    team a New Member

    Messages:
    580
    Likes Received:
    0
    Joined:
    May 10, 2007
    I agree - I just wanted to record the issues I had, because otherwise I'll forget them. I imagine that at this point, my bug reports are much more relevant than suggestions for new features.

    My idea for a text filter was the only suggestion I had that I held back on... can't believe you managed to do all this and more in a day.

    I hope I'm not too much to blame for this... it looks like you've taken care of almost everything I suggested. And, there's always future releases, right? Taking care of the blank line compiling and module path were the only problems that I found difficult, but I've gotten used to circumventing both. The only issue I have right now is that when loading a module, scripted won't load gamebook.mes because many lines don't begin with a bracket. Still, if scripted just skipped the file and moved on to load the module, that would really be good enough for now.
     
  9. Dj_Unique

    Dj_Unique Member

    Messages:
    79
    Likes Received:
    5
    Joined:
    Nov 14, 2001
    Yeah, I think some of the more complex features can be left for future releases. Kinda forgot about this. I'll keep hammering at version 1.50 until it's working without a hitch, I guess after that I can label it as stable.

    The MES parser can currently survive from non-commented output after the curly brackets but when there's junk at the start of the line it will crash and burn, however I just fixed this by adding some error handling to the string parser (the function that gets data between { and }) so it will gracefully cancel out from trying to parse anything.

    These are the lines that cause trouble:
    Code:
    some junk {1000}{Message String}
    These lines work just fine:
    Code:
    {1000}{Message String}some junk
    I don't know what purpose it serves to have lines like this, I guess I'm too used to properly formatted input. It's not too easy to modify the parser to allow this kind of input either since I'm using LL(1) parsers (mostly because generating them saves a lot of time, probably mentioned this before).

    UPDATE on the script parsing issues (15:52am GMT+3):

    Everything is working now nice and smooth, should no longer be any
    problems with script lines. However, if these still occur with the
    new build, copy&paste the script snippet that didn't work properly
    and I'll get on with debugging the parser again.

    I also got the undo feature to work properly. Pressing CTRL+U or selecting the Undo compile option should now restore the script to the state it was before compiling, in case a line was deleted. I'll probably have to implement some sort of undo buffer as well for further undoing.
     
  10. Dj_Unique

    Dj_Unique Member

    Messages:
    79
    Likes Received:
    5
    Joined:
    Nov 14, 2001
    OK, after 1 and half days of coding and debugging and almost going insane, here's the next build... I need a break now :D

    http://de01.rackglobal.com/~djunique/fi ... -setup.exe

    I'm not 100% sure if I missed something so I'm ready to get back to fixing if anything bad happens. The compiler issues should now be
    resolved, I hope. Also module data loading is less likely to fail when erroneous data is encountered in a mes file.

    NOTE: Forgot to mention this... Currently the 'Remove dialogue' button is disabled on purpose. I decided against implementing it yet due to potential data loss. So for now you'll have to handle dlg file deleting manually.

    Full changelog:

    - Better error handling for quest editor. Should no longer crap out on missing quest log entries. NOTE: The missing quest log entry will be unavailable for any kind of editing so a general advice is to keep
    all 3 files in sync even if either of the log entries won't be used.

    - Fixed Arcanum installation path management so that you can specify a folder own your own choice if you have multiple copies of Arcanum installed.

    - Added an MRU menu for module scripts. The full path is stored so in case you changed the module in between loading scripts, they can be accessed again easily. NOTE: The module folder variable will still hold only the currently selected module so strangeness may occur, so to be safe, just use the scripts in the currently selected module, and select a another module in case you wish to edit the data in that module. I will try to work this out better in a future build.

    - Basic colour coding for nodes implemented. Now float messages and empty lines will be coloured differently in the node list.

    - Undo should be working now. Unfortunately it has no buffer yet so only the text that was in the editor before compiling is restored.

    - Multiple player options can now be copied and pasted, as requested.

    - MES entry data is properly cleared from last usage of the generic mes editor.

    - In addition to the MRU menu, listview column widths are also saved from the module script loader window. This way the columns are at the exact width that you had them when you last quit ScriptEd.

    - Added a few more configuration options. Compiling script on pressing enter can now be disabled and a few others.

    - Implemented default line number step when adding new nodes.

    - Female npc text is now correctly updated when you toggle the 'use text from male npc line' checkbox on. This can be toggled on or off from the preferences, whichever way you prefer.

    - Added optional gender specific strings. These are used for automatically synchronizing npc text for the female player with corresponding words such as 'sir' with 'madam' etc.

    - Added a safety check when creating a new dialogue. This is due to some reports about the existence of the file not being recognized. This should allow the user to cancel out of the creation process to prevent data loss. I need more info on this issue, can't reproduce it so far.

    - Finetuned script parser to allow consecutive lines without linebreaks in between. There should no longer be any lost lines, but if there are, send me a snippet of the script that didn't work out and I'll debug it.

    - Added the following helper script commands:

    function SelectGlobalFlag: Integer;

    Invokes a window for selecting a global flag. Returns the
    MES entry index for the global flag.

    function SelectGlobalVar: Integer;

    Invokes a window for selecting a global variable. Returns the
    MES entry index for the global var.

    function SelectPCFlag: Integer;

    Invokes a window for selecting a PC flag. Returns the mes
    entry index for the selected pc flag.

    function SelectPCVar: Integer;

    Invokes a window for selecting a PC variable. Returns the mes
    entry index for the selected pc variable.

    function SelectQuest: Integer;

    Invokes a window for selecting a quest (from GameQuestLog.mes).
    Returns the MES entry index
    for the selected quest.

    function SelectRumor: Integer;

    Invokes a window for selecting a rumor or journal entry
    (from GameRD_NPC_m2m.mes). Returns the MES entry index for the
    selected rumor / journal entry.

    function SelectInternalName: Integer;

    Invokes a window for selecting an internal name. Returns the
    MES entry index for the selected internal name.

    function ChooseScript: integer;

    Shows the module script loader window. If the script filename does
    not contain a script id, -2 is returned. If the window was
    canceled, -1 is returned. Otherwise the script ID part of the
    filename is returned for use within a scripting command that
    is added by a helper script.

    function ChooseFocus : String;

    Invokes a selection window to choose a focus string. The string value of the selected item is returned.

    function ChooseValue : String;

    Invokes a selection window for choosing a value. Default value type is number (3). The selected value is returned as a string. For example 'Counter 0','Global Variable 1', 'Local 0', '25' etc.

    - Added global flag / variable / quest / internal name information display when right-clicking on certain script lines or 'Global Flag'/'Global Variable' keywords. Can also display dialogue lines or float messages if they are being called as regular numbers. Not every possible data type can be viewed yet, going to work on that some more later.
     
  11. team a

    team a New Member

    Messages:
    580
    Likes Received:
    0
    Joined:
    May 10, 2007
    Thanks DJ!

    The script compiling is way better now. Also, thanks for adding the color coding to lines in the dialog editor - it makes it much easier to sort through the nodes. Even though you might not call this a release version, I'm going to start using it for all my scripts. I'd suggest that other advanced users give this a shot, if they haven't already - it's much better than anything else you could possibly be using, especially sock monkey.

    Enjoy your break from programming this - it's well deserved.
     
  12. Dark Elf

    Dark Elf Administrator Staff Member

    Messages:
    10,796
    Media:
    34
    Likes Received:
    164
    Joined:
    Feb 6, 2002
    Wait, I should be hosting this shouldn't I?
     
  13. Dj_Unique

    Dj_Unique Member

    Messages:
    79
    Likes Received:
    5
    Joined:
    Nov 14, 2001
    It's not exactly the final version of 1.50 yet but go right ahead.

    List of things still to do are: documentation (help file), some additional functionality etc but it should be usable so far.

    I'm developing the tool fairly actively so more updates will be on the way and I can be contacted via this forum or e-mail in case anyone has bugs to report or any other questions whatsoever.
     
  14. Dark Elf

    Dark Elf Administrator Staff Member

    Messages:
    10,796
    Media:
    34
    Likes Received:
    164
    Joined:
    Feb 6, 2002
  15. Dj_Unique

    Dj_Unique Member

    Messages:
    79
    Likes Received:
    5
    Joined:
    Nov 14, 2001
    Next update will be coming up soon... Lots of fixes once again and new additions as well. This will be 1.50-beta build 3.

    A few to mention:

    - Improved dat file handling, now it should report the filename it tried to open if error occurs

    - DLG and MES parser will now ignore any input outside the curly braces that is not prepended with //, this improves compatibility with just about any dialogue file.

    - Added helper script manager to preferences screen.

    - Buttons for uncompressing (.dat file) and compressing (module folder) a module. Dat creation functions still need tweaking (path storage issues, apparently Arcanum refuses to open a module dat if folders are stored in incorrect order)

    and more to come.
     
  16. team a

    team a New Member

    Messages:
    580
    Likes Received:
    0
    Joined:
    May 10, 2007
    You made datbuilder, right? I'm not at my personal laptop right now, or I'd check. I know you said you don't have the source for any of the old versions of the utilities, but that one worked perfectly exactly how it was.
     
  17. Dj_Unique

    Dj_Unique Member

    Messages:
    79
    Likes Received:
    5
    Joined:
    Nov 14, 2001
    Yeah, I did make datbuilder and I still actually have the dat handling functions unit intact (but not the GUI source).

    The problem I'm having is that my dat creation functions are not 100% accurate compared to dbmaker. The file entries contain a field which I'm not sure what it is or how it should be calculated but it seems to be a sequential number of some sort. (Shown at the UNKNOWN column in Datbuilder) I don't know if it's relevant in anyway but it would be great to be able to get this value calculated correctly in my functions as well.

    I'm just testing the functions for fun to ensure that modules packed with my routines are working correctly in the game.

    I tried to load a module compressed by ScriptEd in-game and there was a bunch of lines in the debug log:

    Not sure why that happens because the files are there and the folders are stored correctly. When I compress the module using dbmaker, it works fine. So that's the issue I'm trying to resolve. Potentially dats created with DATbuilder may have the same symptoms but for main game databases (arcanum<n>.dat) they should work just fine.

    Extracting the module DAT with dbmaker reveals that the folders become duplicated (such as dlgdlg and other weirdness), even though they are stored exactly in the same manner as files created with dbmaker. The only difference is that I'm setting the UNKNOWN field to 0 on each file entry, mainly because I just have no idea where it's calculated from.
     
  18. team a

    team a New Member

    Messages:
    580
    Likes Received:
    0
    Joined:
    May 10, 2007
    I've been using datbuilder for over a year now, and although I generally use worlded to dat my mod folders, i think I've used datbuilder a few times. I know I used it for my patch at the very least, and that worked. I also run Arcanum with debug, so I think I would have noticed (hopefully). Then agian, I'm not sure I've used a whole module...

    Has anyone else had problems with gamebook.mes? does scripted open the Arcanum mod's copy fine? I'd test, but again, not at my PC
     
  19. Dj_Unique

    Dj_Unique Member

    Messages:
    79
    Likes Received:
    5
    Joined:
    Nov 14, 2001
    No problems with gamebook.mes here, tried with the currently released 1.50-beta build 2 and my development build number 3. I tried both uncompressed and compressed versions of the Arcanum main module, no error messages whatsoever.

    UPDATE: Solved the DAT problem... I didn't realize the filenames in the dat directory tree are supposed to be terminated with a null character (the existing code stored only the length of the filename and nothing more), so I just added one byte to the filename size and now the unpacking problem is gone. The remaining issue was with the paths but now it's official: ScriptEd is able to compress fully compatible dat files. The file system seems very picky about the dat structure. It insists that each folder and subfolder contained in the filename should come before the files or it won't find them. Example: before any entry in the maps folder such as maps\Shopmap\0.sec there is supposed to be both maps and maps\Shopmap folders, otherwise the game gets stuck in a loop and you can't exit it any other way than killing the process.
     
  20. Dj_Unique

    Dj_Unique Member

    Messages:
    79
    Likes Received:
    5
    Joined:
    Nov 14, 2001
    I just can't seem to keep away from working on this program. I've been doing a huge amount of fixes and additions,
    mostly more control over the behaviour of the tool via preferences. Should be done with the new build soon if nothing else comes up.

    Other changes made after my previous post:

    - Fixed incorrect code when loading compressed modules.

    - Added more right-click info tip data types: Script number,
    basic prototype, stat.

    - Script is now recompiled on save to ensure that the script
    is up to date in case the user forgot to compile the script after
    most recent changes.

    - Added folder monitoring for the module list so now when new files
    or folders are added or removed, the list will automatically
    refresh.

    - Fixed crash when pressing OK in module selector without anything
    selected.

    - Added a setting for turning on or off the confirmation of deleting
    a player option

    - The paste button no longers gets disabled if you click outside the player option list on a new node and there are player options in the copy buffer.

    - Various error handling tweaks

    More scripting commands for helper scripts will be coming up in the next release:

    function SelectScriptLine(srcfile : String) : Integer;

    Invokes a window for selecting a script line from a specified script. The selected line is returned, or -1 if the dialog
    was canceled.

    To use this command, you should always include the arcanum path and the module folder, like this:

    line := SelectScriptLine(ArcanumPath+'\Modules\'+modulefolder+'\scr\<filename>.scr');

    function SelectLineFromCurrentScript : Integer;

    Invokes a window for selecting a script line from the script
    being edited. The selected line is returned, or -1 if the
    dialog was canceled.

    function SelectBasicPrototype : Integer;

    Invokes a window for selecting a basic prototype (from arcanum3.dat\mes\description.mes).
    Returns the number of the prototype selected or -1 if the window is canceled.

    procedure InitializeHelperScriptMenu;

    for internal use only - clears the helper script menu and sets helper script count to 0.

    function GetEditorCursorPosition : Integer;

    Returns the current Y position of the cursor in the script editor.
    Can be used in conjuntion with InsertScriptLine like this:
    InsertScriptLine(GetEditorCursorPosition,'dialog 1');

    procedure InsertScriptLine(pos : Integer; line : String);

    Inserts a script line at the given cursor position.
     
Our Host!