Friday 29 December 2017

Issue Tracking

Reporting Bugs in NPC Engineer

I use Github for version tracking and issue tracking now, so please head over to NPC Engineer's repository there and hit the big green 'New Issue' button on the right. This will open up the issue reporting tab as shown below:

Use this same form for feature requests and enhancements.

Thank you

Maasq



Sunday 24 December 2017

Almost there with a 1.0 release

I have been progressing slowly with the final couple of issues, and took the opportunity to add a couple of features. I thought I'd make a note of what they are just now as a means of motivating myself (and keeping track - it may be a couple of days before I get a chance to sit in front of a computer again).

Cancelling an import now returns you to the previous state as you would expect it to, rather than erasing information or overwriting it. It seems so simple, but this has been plaguing me since I put a GUI on my script. I finally knuckled down and sorted it. Cigars and medals all round!

A new feature is the ability to add terrain types and mythologies to your NPCs, allowing other ways for them to be indexed in Fantasy Grounds. For example, you could tag your NPC as being from the Norse mythology and be found in urban settings. Although this may not be universally useful, it was a requested feature and I liked the cut of its jib.

Another new feature is still being worked on - NPC Engineer will check the latest release at a set frequency (once a fortnight perhaps) and alert you if a newer version exists.

Anyway, if you are reading this on the day it is written - have a wonderful Christmas whether you celebrate it or not. I wish you the true gifts of the season: peace, joy and hope.

Maasq

Sunday 17 December 2017

Writer's block.

I'm staring at the screen with no motivation to do anything. Why is this happening? I've had a week away from coding because life is busy, and I have 3 distinct things to work on to 'finish' NPC Engineer, but I can't get the motivation to start on any of them.

This sort of thing used to happen to me mid-project way back when I used to program. Basically I had the ideas, did all the easy stuff and maybe figured out some of the big meaty bits of the project, but there would be a yawning chasm before I got to the finishing stage. The yawning chasm was too bif, and so many projects got to a half-arsed state and then abandoned.

NPC Engineer has been different... I have kept focused on it through doing it in chunks. I am a finisher-completer (I have been told in work); this part should be the easy part for me. I've done all the difficult stuff. AAaaarrrgh!

Is it just the unrelenting nature of preparing for Xmas as a single parent? Is it the fact I had to pay £120 for a new car battery last night 9 days before Xmas? Stress can be a fun-killer. Or am I just a lazy git? :)

Whatever it is, I need to get my act together and finish this program. Send me some motivation, in the comments or on Discord!

Cheers
Maasq




Wednesday 13 December 2017

Cleaning up

My last post said I was going to clean up some of the little issues that made NPC Engineer lack polish. I've started, but I also realise why these issues exist. I am a lazy b They can be tricky to fix, and they are no fun whatsoever to code.

The stray text issue requires the full backup state, and that's a big task with all the myriad variables that I use. I'm really suffering from not knowing enough to go object programming from the start. The size of the task sucked all the colour from my world and the joy from my heart and sent me scuttling towards the Xbox instead. I'll get on to it soon (TM).

I fixed the issue(s) with file select boxes, though - if you cancel out of one, NPCE will no longer continue to do whatever it likes. It will do exactly as you asked - it will cancel the operation.

Grand. And in the process of this update I wrote a regexreplace command without looking at any sort of documentation; when it worked first time I nearly fell off the seat. It's only now that I feel I can call myself a programmer! It is strange the milestones we set ourselves unconsciously...

Maasq



Sunday 10 December 2017

Polishing

Well, with the program approaching official release status, I'd best get to work on dealing with all the niggly wee issues that plague any project like this. For NPC Engineer, the issues are all around what happens when you don't do what you are meant to.

If you open the import box and add some text, then cancel, you can still find that text floating about in some variables. It is easy enough to work around - just hit 'new NPC' before doing any work - but it is time to sort that. This requires making a full backup state, and this is where I weep at not building the whole program on an object model. Another reason for a version 2.0 one day....

If you cancel out of any file box, it still tries to import or save. This is either a minor annoyance or a royal pain in the arse depending on how often you do it, or how much rogue unnamed files on your hard drive annoy you.

I still need to add spells to the 'description' properly. They were there on the old description box, but that code is incompatible with the new Rich Text box, so I need to do something with it.

So there's my hit list for the run-up to Xmas. Ho ho ho.

I really want to start something else now. I'm getting itchy fingers :)

Maasq



Thursday 7 December 2017

NPC Text format

I have been asked a few times for 'my' format for an NPC. My answer is always that my format is not mine at all - it is the format employed by the Monster Manual and other official documents. It is also the format that Par5e followed. I took the liberty of creating an NPC just to show the format required; note that nothing about this is meant to be game ready, sensible, or even part of 5E. I just typed some whimsical stuff for spell names, for instance.

I have highlighted required wording in red in the first version. Although I use the phrase 'required wording', be aware that some sections can be missed out entirely - this is just the required wording if you include it.

The second version has the sections that are optional highlighted in green.

Please note all punctuation carefully - an errant colon or stray comma can wreck a parse! Don't miss anything out, and don't add anything.

There are a lot of little twists beyond this. I will update this document regularly.

Maasq


Npcname
Medium undead (human), lawful neutral
Armor Class 12 (Natural armor)
Hit Points 26 (4d10 + 4)
Speed 30 ft., fly 35 ft. (hover)
STR DEX CON INT WIS CHA 14 (+2) 17 (+3) 9 (-1) 10 (+0) 10 (+0) 2 (-4)
Saving Throws Str +2, Dex +3
Skills Deception +4, Medicine +1
Damage Vulnerabilities fire; slashing
Damage Resistances cold, poison; piercing from nonmagical weapons
Damage Immunities thunder; bludgeoning from nonmagical weapons that aren't adamantine
Condition Immunities blinded, exhaustion, petrified
Senses darkvision 25 ft., passive Perception 10
Languages The languages it knew in life
Challenge 18 (20,000 XP)
False Appearance. While the npcname remains motionless, it is indistinguishable from a mundane, inanimate object.
Magic Resistance. The npcname has advantage on saving throws against spells and other magical effects.
Innate Spellcasting. The npcname's innate spellcasting ability is Dexterity (spell save DC 5, +2 to hit with spell attacks). It can innately cast the following spells, requiring no material components:
At will: Blast, Haste
4/day each: Grow Beard, Improved Fireball
Spellcasting. The npcname is a 4th-level spellcaster. Its spellcasting ability is Constitution (spell save DC 7, +3 to hit with spell attacks). The npcname has the following Paladin spells prepared:
Cantrips (At will): Hide, Seek, Find
1st level (3 slots): Sparks, Will, Fly
ACTIONS
Multiattack. The NPCname makes 2 attacks with its Cuinnsear.
Cuinnsear. Melee Weapon Attack: +0 to hit, reach 5 ft., one target. Hit: 2 (1d4 + 0) piercing damage. Or Ranged Weapon Attack: +0 to hit, range 20/60 ft., one target. Hit: 2 (1d4 + 0) piercing damage.


Npcname
Medium undead (human), lawful neutral
Armor Class 12 (Natural armor)
Hit Points 26 (4d10 + 4)
Speed 30 ft., fly 35 ft. (hover)
STR DEX CON INT WIS CHA 14 (+2) 17 (+3) 9 (-1) 10 (+0) 10 (+0) 2 (-4)
Saving Throws Str +2, Dex +3
Skills Deception +4, Medicine +1
Damage Vulnerabilities fire; slashing
Damage Resistances cold, poison; piercing from nonmagical weapons
Damage Immunities thunder; bludgeoning from nonmagical weapons that aren't adamantine
Condition Immunities blinded, exhaustion, petrified
Senses darkvision 25 ft., passive Perception 10
Languages The languages it knew in life
Challenge 18 (20,000 XP)
False Appearance. While the npcname remains motionless, it is indistinguishable from a mundane, inanimate object.
Magic Resistance. The npcname has advantage on saving throws against spells and other magical effects.
Innate Spellcasting. The npcname's innate spellcasting ability is Dexterity (spell save DC 5, +2 to hit with spell attacks). It can innately cast the following spells, requiring no material components:
At will: Blast, Haste
4/day each: Grow Beard, Improved Fireball
Spellcasting. The npcname is a 4th-level spellcaster. Its spellcasting ability is Constitution (spell save DC 7, +3 to hit with spell attacks). The npcname has the following Paladin spells prepared:
Cantrips (At will): Hide, Seek, Find
1st level (3 slots): Sparks, Will, Fly
ACTIONS
Multiattack. The NPCname makes 2 attacks with its Cuinnsear.
Cuinnsear. Melee Weapon Attack: +0 to hit, reach 5 ft., one target. Hit: 2 (1d4 + 0) piercing damage. Or Ranged Weapon Attack: +0 to hit, range 20/60 ft., one target. Hit: 2 (1d4 + 0) piercing damage.


Wednesday 6 December 2017

Satisfaction!

Ahhh the joy of getting to the point where you want to be with a project!

Version 0.9.9 is out and it is my favourite update yet. The graphical output pane makes the program so much more visual, and a joy to use. Practically it is better too - you can see errors more clearly this way.

This was always my vision for the program, and it feels good getting to this point. I'm off for a cigar (metaphorically speaking) and a rest (physically).

This is not the end though - there are other additions I plan on. Outputting this new graphical wondrousness to Word or Google Docs, templates, terrain type listings for NPCs... yes, there is more to come for sure.

Enjoy it for now, and please let me know if there are bugs.

Maasq



Monday 4 December 2017

Getting close to finishing it. For now.

I've been putting off the 'last piece of the jigsaw' for ages.

Right from the start of this project, I have dreamt of the right hand pane being a proper statblock that updates with live information as you import, load or edit it. There have been lots of roadblocks - my ability, AutoHotKey limitations, the arcane nature of any workarounds to these limitations (and, again, my ability or lack thereof).

Slowly, though, ideas for how to complete this have taken root. I started it last night and have I already mentioned anywhere on this blog about how much I detest RTF? The inventors deserve a right good slap, let me tell you. Anyway, eventually I figured out the code for building tables. Here's a sample just for a giggle:

"\trowd\trgaph100\clcbpat3\clbrdrt\brdrw1\brdrcf3\clbrdrb\brdrw1\brdrcf3\clbrdrl\brdrw1\brdrcf6\clbrdrr\brdrw1\brdrcf6\cellx6200\f1\cf2\fs42\b " NPCName " \b0 \line"


And that's just for ONE FRIGGING CELL! All that just to display the NPC's name. (And this doesn't include the colour table and the font table.... I kid you not, this stuff is mental).

It is taking shape, though. Here's a screenshot of where I am at right now:


It may be that it is all worth it after all. For me it is a game-changer; now my program is attractive enough that I want to use it, and hopefully it will have the same effect on other people.

What do you think? Let me know in the comments below.

Maasq



Saturday 2 December 2017

Discord

I've set up a Discord server for NPC Engineer - and it wasn't hard! I'm really pleased with it though; it makes things look 'official', and more importantly, I think it is my preferred way of dealing with support issues. It allows for instant typed or verbal conversations, for screen-sharing to see exactly what causes an issue, and I can have channels dedicated to pasted NPCs or bugs.

If any of you are using NPC Engineer and Discord, I'd urge you to come along and join me on the NPC Engineer channel: https://discord.gg/uH8NJ4x .

Now if I can just find a way of embedding the Discord invite box somewhere on the site...

Maasq



Friday 1 December 2017

Running out of version numbers :)

I do update a lot, don't I?

This is because I am a committed developer, devoted to users of my software. And not at all because I am a slapdash, work-shy bastard that releases dodgy code that's untested. We have this cleared up? Good....

So I think I will keep major version numbers (0, 1, 2.....) for generations, just like most developers. Rewrites, and so on. I am approaching version 1.0, I guess. I'll use decimals for structural changes or major updates (0.8, 0.9......). Revision numbers will be reserved for the addition of features or functionality (1.1.3, 1.1.4......) and minor edits or bug fixes will have a letter, as I am doing now.

All these updates happen for a reason though - there are now a number of people using the program and finding out its flaws, inconsistencies and so on.

If there are issues of any type, please keep letting me know. Email, on this website, on the FG forum, or on Discord. Just let me know what the issue is, and copy-paste the text that caused it.

Thanks for all the help in testing!

Maasq




Wednesday 29 November 2017

Demonstrations & video guides

I got roped into a group chat about NPC Engineer on Discord the other night. It was a pleasant surprise - there are quite a few people using it, it seems, and they were interested in seeing some of the intricacies demonstrated. Five minutes turned into half an hour, and it confirmed that a reference manual is not the only way to teach people about software. So as well as making me feel a little bit important (honesty, eh?) the chat turned me on to the idea of doing video guides for various elements of NPC Engineer.

This won't be a simple undertaking, as I've never done anything of this ilk. So more software to learn, some planning to be done, and some prepping to make sure I don't scare users away - shave, moisturise, learn how to smile without looking like a secure hospital patient, practise not picking my nose/breaking wind/scratching when the camera is on. It's going to be brutal, isn't it? :)

I'll set some time aside during the Xmas holidays to do some video guides, then. Setting up a project, preparing traits & weapons, importing from pdf/web sites, building an NPC from scratch, descriptions, parsing. Anything else? What should come first? Leave me some feedback in the comments below.

Maasq



Sunday 26 November 2017

Still learning

The further I get with this project, the more I learn. I know that's hardly deep educational insight, but I surprise myself with how motivated I have remained throughout this project. It has required some resilience at times, but it has all been worth it. This latest raft of new features and improvements really feels like some polish is being added to the program.

There are only two major features to be added to NPC Engineer now - templates and a more graphical output pane. I'd love to have something that resembles a 5E statblock; watch this space to see if I can make it work. AHK is not an eye-candy language, so it'll take some graft to get anywhere with this!

I think my hack for getting around multi-paragraph traits and actions will need further work too. It is going to get caught out, and there needs to be a way to fix this. More thinking to be done here.

I have been asked for a couple of additions to the GUI and I'm not sure about either of them. Again, more thought is needed. One of them might need me to move about 100 GUI elements, which is reason enough to refuse!

Last, but not least, I need to find a way to incorporate spell lists in the description now that the Rich Text box is there.

So although the finish line truly is in sight, there's enough to keep me going until Christmas and beyond. And then? And then Spells Engineer, I think. Small steps.

Maasq



Thursday 23 November 2017

My first donation!

Wayhay!

Someone gave me a donation via this page, and it feels great! What a lovely gesture, and it's a nice wee boost to my productivity too :)

Thank you!

Maasq



Sunday 19 November 2017

Hwnd, my friend now.

I just spent a whole day trying to do two things, and failing at one. Both seem spectacularly simple at first, but they aren't. Oh, they are not.

Firstly, I tried to program an 'auto complete' function for drop-down boxes, as those provided by AHK don't do it for some reason. Simple enough to work around, I thought - just store the list of entries, compare what you type with those entries, inject back into the control and everybody will be happy. But that isn't the way things work. Selecting something in any way obliterates what you have typed, so there's no option to type two or three letters. Grrrr...

I found some clever code that did pretty much as I wanted, but there was a catch - no obvious way to get the text out of the control (which made it bloody pointless, but I digress). So I could program a hotkey to grab the text when I selected it and then... HOLD ON! I just made this so much more complicated. It wasn't worth the effort.

About 4 hours after I started, I found out that typing a letter or two then hitting the down arrow auto-selected the first match in the list. I'd like to say "I could have wept", but by this time the whole shebang had eaten my soul and I was an empty, lifeless husk wishing it was acceptable to get hammered drunk on a Sunday afternoon and go and shout at random people in the street.

I had a spot of lunch instead. How grown up of me :)

Later in the day I was trying to get a ctrl-J hotkey working as I wanted - to select, manipulate and replace text in whichever control was active. I wasted a lot of time building this to operate on the control under the mouse pointer before realising that I was an idiot. Elegant solution, but the wrong solution. Eventually I got to grips with finding a control's Hwnd and using it, and the whole thing fell into place.

The moral to this story? I wish I'd taken up knitting or something.
Ach well, there's always tomorrow. I'll write more stuff than I did today...

Maasq



A difficult decision

Several areas in NPC Engineer could benefit from a dropdown menu of choices, in the same style as selecting weapon attacks. Unfortunately, in all of these places the creature's name/gender/uniqueness becomes an issue:

"Nimble escape: The goblin can take the Disengage or Hide action as a bonus action on each of its turns."

"The drow is a 10th-level spellcaster. Her spellcasting ability is....." 

Now that's ok in a programming sense - I have routines in place to deal with this in the spellcasting sections. However, for users to set up generic reusable actions/reactions/traits, they would have to input codes to replace names and pronouns:

"Nimble escape: <NAME> can take the Disengage or Hide action as a bonus action on each of <GU3> turns."

The name part will probably work ok, but the generic pronouns won't because there are 4 different ones depending on the situation (he/she/it, him/her/it, his/her/its, himself/herself/itself). Forcing someone to learn this is (a) open to all sorts of 'hilarious' screw-ups that will be blamed on the program and (b) enough to put people off. It negates the ease of use it is trying to inject.

A 3rd option is a far less attractive option, both for user and programmer. Whatever is typed is dumped into the action box as is, and the user then edits it. Again, this will look like a programming fault, when in fact I am trying to be helpful.

So what do we think, folks?


  • Option 1: Don't allow dropdown selections
  • Option 2: Allow dropdown selection, but generic text is added that will need to be edited
  • Option 3: Fully cusomisable, but users need to learn the difference between pronouns 1, 2, 3, & 4, and understand the codes used to achieve them?


Let me know in the comments, please.

Maasq

Friday 17 November 2017

Go on, subscribe!

Hit the 'subscribe' button at the side. I'm not going to spam you - I don't know how. You'll only get an email when I update something here, which is either a new release or a self-indulgent blog post.

Go on. :)

Maasq

Releasing code.

The joys of releasing your work to the public. The baby that you have hand-crafted, pouring over a hundred hours of your life and countless swear words into, exposed like an infant with a cut in a tiger pit. And like tigers, the public pounce mercilessly and tear their prey to shreds!

Actually, no they don’t. I might just be lucky in my target audience, but every comment that has come back to me has been respectful, encouraging and helpful. Everything so far has made me want to continue and to improve. It’s a weird feeling getting feedback - it is exhilarating finding ways to improve the program, but there’s a mix of teeth-grinding frustration and embarrassment when people point out bugs or easier ways to do something.


So this week I have been adding options, fixing bugs, improving user input areas and having a couple of further ideas for improvements based on all the feedback, and generally having a great old time doing so. As ever, there’s the horror of nothing working before you realise that you've just misspelled a variable name, but that just makes it feel even better when it runs perfectly. I offer up heartfelt thanks to everyone who has given suggestions for improvements over the past week (particularly Colin, who went above and beyond the call of duty).

I really don't like coding GUIs though. They're the worst. Apart from RTF, which I am sure is an anagram for 'complete and utter bastard' - it reared its head again with seemingly random language codes inserted to trip up some people (but not all). I wish I was good enough to code my own RTF control from scratch, but that's not happening in this lifetime.

Well, another release tonight. I wonder how many new bugs I've introduced :) As a programmer acquaintance said the other night when I proclaimed NPC Engineer complete....

"Finished. LOL!"

I was so naive back then, so fresh faced and innocent.

Maasq

Sunday 12 November 2017

You want PAID?!?!

In short; no.


However, a couple of people on the forums have said that they'd like to donate something for my hard work, and it seems rude to refuse such kind offers, doesn't it?

There is no charge of any kind for NPC Engineer, nor will there ever be. I wanted to give something back to the community at Fantasy Grounds, and if the truth be told the whole project was really an excuse to start programming again. It has been a great journey, one that has got my kids interested in both D&D and programming as well as given me a deeply fulfilling hobby. It is rewarding enough to get some positive feedback, and to know people are finding my work useful.

Mind you, Jack Daniels doesn't buy itself, so if you want to donate I'll not refuse. Pragmatic, that's me!

Maasq


NPC Engineer Documentation

The latest documentation for the NPC Engineer suite contains full information on how to use all aspects of the software, along with extensive screenshots. You can download it in pdf format below. Please refer to the manual in the first instance if you have any difficulty operating NPC Engineer.





Tuesday 7 November 2017

The blog begins...

Six months into a project that started as a quick script to help me parse some NPCs, it isn't so much the program that has development creep as my brain. So far in this journey I have had to learn a programming language, learn about objects, learn how little I understood of all of this at first, learn XML, learn Fantasy Grounds' language, and most recently struggle with RTF. RTF can GTF frankly... I have no idea how anyone came up with this as a good idea, or how their workmates at Microsoft never slapped them. No doubt I'll rant about RTF more as the project progresses.

Anyway, 6 months in I decide a website would be a great idea. Thankfully I manage to avoid the "it can't be that hard; let's try doing it myself" route and instead went for the Blogger platform I had already used and enjoyed. It'll be easy, I said to myself. You can use the design you have already for another blog, I said to myself. Yeah, right - that never works.

So now I have taken a break from programming to design a website to host my programming. I'm empire building. This would all feel like less of a timesink if I was going to make my first million out of it, but I keep pretending to myself that I'm learning valuable skills I may be able to leverage in the future. Then I go back to the programming Discord and see what guys half my age are doing whilst watching Anime and I realise that I'm not going to be a rich software engineer!

Still, people are using NPC Engineer and enjoying it. My main goal - something usable for myself - was met long ago, and in the process I found a hobby (or set of hobbies) that I absolutely love. I might even be inspiring my own children to attempt some coding - that's more valuable than financial riches (I keep telling myself).

RTF is still a pain in the arse, though.

Maasq


Wednesday 1 November 2017


Welcome to the NPC Engineer website, and thank you for your interest. This site will contain all the updates to the full (planned) suite of programs along with all documentation. There is also a development blog - more a space for swearing as I discover a comma that should have been a period has been wrecking my code for the best part of 6 hours (yes.... it did happen).
Please look around, download what you want to try, and leave me a comment if the urge takes you. A little bit of encouragement goes a long way!
NPC Engineer main screen
NPC Engineer Project Management

Links


Fantasy Grounds

Fantasy Grounds is a virtual tabletop application that contains a set of tools to assist players of tabletop role-playing games playing either in person or remotely. This website is not affiliated with Fantasy Grounds in any way, nor should anything on this website be taken as speaking for the Fantasy Grounds team.




AutoHotKey

AutoHotkey is a free, open-source scripting language for Windows. This is the language I created NPC Engineer in - it is easy to pick up and powerful. It goes way beyond the hotkey and automation scripts people associate with it.



Picture
FG College

Fantasy Grounds College (FGC) is a group of experienced and highly-motivated individuals who volunteer their time to teach others how to use Fantasy Grounds and how to play various rulesets. We strive to give our students the tools they need to become a better FG-user, player and DM/GM.