Monday 29 January 2018

Welcome back, HTML - my old friend.

Have I ever mentioned how much I hate RTF? Really? I'll try not to repeat myself too much then :)

I found a way to make the ActiveX control behave itself. The main reason I had had to use the evil RTF control was that the ActiveX one grabbed focus when clicked and didn't let go. This was a disaster for a program like NPC Engineer. So I made it completely unselectable, and built scroll routines to make up for this. It all works pretty well and I am very happy.

Today was all about fixing the final output to work with HTML, so all the slog with the RTF was binned. Well, that's not totally true - I still use it in the 'import' box. Anyway, I took the opportunity to play with css and HTML, and now the viewport (fancy name for the right hand box) is as pretty as a pretty thing. It has proper triangular section ends, it has wee pictures for 'image' and 'frame chat' tags, the frame chat gets boxed, and spells get listed in a decent looking table.

So after a hellish start, programming wise, this has been a decent week. I've had a couple of requests to rework the 'skills' tab, and this (if I do it now) is definitely the last major work on the NPC module for now. If not, it'll be the first revision after I get some work done on spells.

Cheers for the support


Thursday 25 January 2018

Amazing healing properties of a decent sleep!

So in my last post, I was feeling a bit sorry for myself. Thankfully, I got past that and started chipping away again. There were several things at play, not all of them my coding, and they were building up to a 'perfect shitstorm'. With the stalwart help of Colin, though, I managed to track down what the issues were.

The solution was to start at the beginning, rather than trying to treat the symptoms. I changed the 'settings' dialogue and tightened up control of the starting directories, and the issues in the project data structure just melted away - that programming was fine after all.

The lessons to be learned? Grow up (no tantrums!), back off, have a decent night's sleep, and think about the problem while driving!

To those who offered support - thank you. That definitely helped!


Tuesday 23 January 2018

Sick fed up (again)

it looks like I have backed myself into a corner with the file system and directories. In an effort to please everyone, I offered too much choice and frankly fucked the whole thing up.

I am sick at the thought. I have no idea how to fix it short of telling people to use the directory structure I set as defaults.

It takes teams of many to get these things right at major companies, sometimes after years of trying, and I just feel daft for trying to match that. Nothing makes you feel burst quicker than overreaching your skill level.

I can't even face posting the recent bug fixes just now. Sorry.


Thursday 18 January 2018

The semi-regular 'I'm almost finished now' post!

Yep, it is time to claim I am almost finished with NPC Engineer again. I'm sure someone will hit me with a great suggestion, or find a bug, and I'll be eating humble pie - but the goals for calling it a 1.0.0 release have all been met, and barring bug reports, I really am going to try to start another module next week.

So this update saw me dancing with RTF again. Did I mention that I hate RTF? Anyway, eventually I got to the point where you can add spells to the description (with decent tables even!) and you can format paragraphs as 'frame text' for Fantasy Grounds.

So where next for NPC Engineer? There are still plans for it - BB code output, a 'create-an-NPC' wizard, templates - and it is time to branch out. Spells next, then I think I should try to have a shot at reference manuals.

Thanks for the support, folks - the chat and feedback on Discord keeps me going!

OK - see you in the bug reports :)


Sunday 14 January 2018

Future developments

This is where I see the project going in the near future. Longer term goals are to have all elements of Fantasy Grounds parsing covered, but there is no rush to completion on that front. Some of the items in the list are those suggested by viewers of the AMA on Twitch. If I missed any of the other excellent suggestions, let me know!
Nothing listed here is guaranteed to be written; don't be trying to sue me! It isn't an exhaustive list either, and I am very much open to suggestions - leave comments here or ping me on Discord. The list for NPC Engineer is getting shorter now...

NPC Module:

  • 'Wizard' for NPC creation.
  • Templates

Spells Module:

  • Importing from a variety of sources.
  • Exporting to text and HTML.

Other Modules:

  • Items module
  • Tables module
  • PC module
  • Races module
  • Classes module
  • Reference Manual module


Twitch and an AMA!

Fantasy Grounds College wanted to host an AMA (interview for the internet age) with me for their organisation, as part of being a DM in FG may involve creating or importing NPCs.

This was a new experience for me! After years of being shy and retiring, here I had to do some shameless self-promotion. How would I cope?

Easily, it seems. Inside every introvert there's an extrovert screaming to get out, and 90 minutes of chat and demoing zoomed past in the blink of an eye. The viewers on my Twitch channel (and that makes me laugh - me with a Twitch channel!) were very complimentary about NPC Engineer and about my approach in general, and this validation was the best part of the whole experience. I'd recommend it :)  As a side benefit, my kids treated me like a rock star after it!

Many thanks to Laerun and FGC for setting this up. If you are new to Fantasy Grounds, look them up (link on the 'links' tab) and they will set you right on many aspects of the game.


PS If you want to see the AMA, you can't - like a n00b I forgot to turn on the option to save the chat. Next time!

Friday 5 January 2018

Copy and paste statblocks

I've done it!

After about 6 weeks or so of trying, I have finally managed to crack the clipboard. It is now possible to put that statblock from the right-hand side of the screen into any rtf-aware program, where it can be edited, resized, re-fonted.....

Basically, NPC Engineer can now give you a lovely statblock for both the Fantasy Grounds version and the pdf version of your masterpiece. This was a long-standing goal of mine, and it feels great to be making progress. Things aren't perfect yet; it may be a few days before this version gets released. For a start, it turns out the statblock is too wide for a standard page (well, it sits at more than 50% of the page width). I'll fix this, and with a bit of effort I should even be able to allow you to scale the width to whatever you want.

So right now, OpenOffice and WordPad work perfectly with my function. Word 2016 throws a tantrum and doesn't display it perfectly. Google Docs doesn't want to know, and it isn't my fault - it just won't let you paste RTF. There's a workaround if you HAVE to work in Google Docs; it's clunky as hell and I'll let you search for it (so that you don't shout at me for it!)

So I have plenty to work on here - make it work with 2016 (I think I can do this), make it narrower (I know I can do this) use variable widths to allow users to set the width in cm (I should be able to do this) or inches (only if I receive death threats or a thick pile of used and unmarked notes; I hate imperial measurements!)

What I CAN'T do without a tonne of work that isn't (a) fun or (b) related to the core function of NPC Engineer is make one of the 2-column statblocks. Sorry!

If anyone wants a test version to play about with, contact me on Discord. I can always use beta testers!


Thursday 4 January 2018

Consolidating your files in the standard directories

The most recent updates have employed an installer, and this in turn forced me to consider using standard directories for NPC Engineer. You can, of course, change from these standards to any other directory, including your desktop should you wish. However if you want to use the standard directories to simplify working with the various modules of NPC Engineer as they get written, this article will help you centralise everything.

Firstly, the default directories:

Installation directory
   C:\Program Files (x86)\NPC Engineer (you are unlikely to need this)
NPC Engineer data directory
   C:\Users\xxxxxxx\AppData\Roaming\NPC Engineer
Saved Project files
   C:\Users\xxxxxxx\AppData\Roaming\NPC Engineer\Saved Project Files
Saved NPC files
   C:\Users\xxxxxxx\AppData\Roaming\NPC Engineer\Saved NPC Files

    All of these directories are available within NPC Engineer's 'Explorer' menu to save you having to remember or type them.

    It should be noted that 'xxxxxxx' is your logon name for Windows, and that the directory structure might look slightly different depending on Windows version. NPC Engineer knows where everything is, though, and using the links in the Explorer menu will be the easiest way to get to where you want to go. From here on in, I will refer to the root of these as {appdata} (so {appdata}/NPC Engineer for example).

    You can change the main NPC Engineer data directory and the Saved NPC files directory in the 'settings' dialogue, as shown to the right.

    The default is also to rename then copy image and token files to your NPC directory so that all the pertinent files for the NPC are kept together.

    If you want to move NPC files to a new directory, set the directory here first. Exit NPC Engineer. Copy the files to the new directory rather than move them, then re-open NPC Engineer.

    Once you have done this it should be safe to go back and delete the original folder of NPCs to tidy up your hard drive.

    Use the same method to consolidate your NPC Engineer.ini and json files - copy them from your old installation directory to your {appdata}\NPC Engineer directory. Once you have pointed to the new directory in NPC Engineer you can delete the originals.

    Moving projects into the 'Saved Projects Files' directory is a little more fragile. It follows the same method, though.

    Firstly, copy the whole project directory to {appdata}\NPC Engineer\Saved Project Files\.
    Next, copy the project's .ini file to {appdata\NPC Engineer\.
    Now open NPC Engineer and open the project management window:

    Change the path for your module to where you want it to be ({appdata}\NPC Engineer\Saved Project Files\).

    Do this for each project. You should be safe to delete the original folders at this point. If NPC Engineer fails to launch, put the files back and contact me on Discord.


    Tuesday 2 January 2018

    Happy New Year and Happy New Version!

    Happy New Year!

    I hope 2018 is good for you, and good for me too. No point in being totally altruistic; I want good things as well!

    A new version has been released, and I am really pleased with the changes. Mainly it is all about the installer, and how it forced me to tighten up on my directory control, but the new icon has made me happy too.

    Enjoy, and I hope it all works beautifully first time!

    *Edit.... It didn't. A new version with bug fixes (hopefully) is available. :(


    Monday 1 January 2018

    Making things look and feel good.

    For the past couple of days I have been struggling to make the whole package more professional looking. First up was an installation package - primarily because I wanted the font installed automatically and the package ready to use with a couple of clicks. Not everyone likes zip files.

    Great idea, but it exposed an issue - installing into the 'Program Files' directory made NPC Engineer fail at the first hurdle. It couldn't even copy its own default files to the main directory. A bit of experimentation showed that this was due to the directory - I could install to any other directory and things ran beautifully. It would also work if you ran NPC Engineer as an administrator, but of course this would involve right-clicking each time, and the nice Start menu entry or desktop icon (if installed) would be pointless.

    Grinding my teeth and Googling like a boss, I eventually discovered something useful - applications should not write to their install directories; only installers should do that. It is a security thing. Instead, the application should write to the user's 'appdata' area.

    This, of course, was news to me and requires rewriting of all the disc access stuff to take account of it. I'm trying to make it so that the user can select whichever directory they wish as well. Look out for the updates!

    The next thing I thought of was updating my application icon. There were anti-aliasing issues with the original that showed up when the icon was on a desktop. Small things bother me, so I set to work getting a better, more indicative icon. Here it is:

    I love it. Frankly, I don't want the application to actually DO anything any more; I'm going to reprogram it to just bounce the icon around your desktop until you love it too. :)

    Look out for the next version as an installer and with a new icon.