Archive for November, 2007

Skills are on their way!

Friday, November 23rd, 2007

I’ve spent most of this week (when I’m not working or playing DragonFable or MechQuest) working on the menu system. I’ve almost got skill use working, I caught and fixed a couple glitches with items, and I coded a handful of under-the-hood refinements to the menu system that’ll make new menus easier to code in the future. I should have a release ready by tomorrow.

It’ll also contain a minor update to the RPG Script system: Label/Goto label will be working. I would have had this several weeks ago, but a glitch in the PascalScript compiler kept labels from working properly under certain conditions. I reported it to the author, and he says he’s looking into it, along with a handful of other things. But the PascalScript system is published with the source code available (not exactly the same thing as “open source software,” but close enough for many purposes) and another programmer went and created a patch, which I’ve incorporated into RPG Script until an “official” fix comes from the author. (Which may well be simply taking this other guy’s patch and making it official.)


Potion of Death!

Monday, November 12th, 2007

It’s funny how bugs can interact with each other in unexpected ways. Case in point: The Potion of Death I accidentally created last night as I was coding item usage in the menu system.

The RPG Maker item data structure has a list of flags representing which conditions the item cures. But since most items don’t cure any condition, the program saves space in the file by simply skipping the entire list if the whole thing’s set to false. In my code to read the data structure, I accidentally had it set the entire set to true if the list was missing from the file. So an ordinary item, such as a potion, suddenly becomes a cure-all item.

But it gets worse. Characters can be afflicted with various conditions, as defined by the game writer, and one condition that’s hard-coded into the system: “dead”. If a character’s dead, it changes a bunch of the code for his behavior. (For example, he can’t be healed while dead.) In the code to set a character’s condition, I had a check for whether the condition being set was condition #1 (dead), and if it was, to set a couple other things in the hero’s data structure relating to being dead. Unfortunately, this check didn’t look to see whether the “dead” condition was being turned on or off.

You can probably see where this is going. I tested out a potion on a hero, and… he died?!? That confused the heck out of me, of course. Turns out the potion (with the “cure condition” attributes set to all true) had tried to cure the hero of being “dead”–for technical reasons, it’s more efficient to simply set the condition to false than to check whether it’s set and then only set it if it’s already true–and this set off the special code. So instead of getting healed by 50 HP, the hero died. Huzzah for Potions of Death!

Item use, coming up!

Wednesday, November 7th, 2007

As part of my ongoing work to get the menu system running, it’s time to write the code for items.  This is a major part of an RPG, probably as big as the menu system itself.  I’m not sure how much time I’ll have to work on it this week, but when I get this release done, you’ll have a working menu system and be able to select and use out-of-battle items from it.  Hooray!