Showing posts with label zookeeper. Show all posts
Showing posts with label zookeeper. Show all posts

Friday, April 30, 2010

Why units refuse to lose their abilities

So, if when {CLEAR_VARIABLE unit.abilities}-ed a unit, it didn't always drop their ability. This was very troubling. I had Dwarvish Guardsmen with bucklers that refused to give up steadfast along with Fencers wearing armor who could still skirmish. This totally wasn't the case ever for player characters. This code, inserted into the start event of the tutorial, confirmed it.

Hypothesis #1: It has to do with the fact these NPCs are canrecruit=no.

Nope. Tested it in the Tutorial. It did the same for Konrad (if I made him a Dwarvish Guardsman).

Hypothesis #2: There's a [modification] that needs to be removed.

Nope. Not in the save file.

Hypothesis #3: Abilities of regular-ish units need to be removed via [object]/[effect].

Damn, this one worked, but there's no way to just clear them all like that.

Then I talked to zookeeper who, as always, had brilliant insight. In IRC:

zookeeper: could it be that removal works on abilities which are no inherent to the unit type?
zookeeper: that'd be my first guess; that the game would see something missing and would recalculate it...like if you removed unit.hitpoints then the game would recalculate it (probably means fill them up to max)

Oh, so I just put a dummy [abilities] container in after clearing it and it worked fine. It turns out that PCs never had an inherent ability, so it was never an issue.

I was really scared this would be a roadblock, but it turned out not to be, thanks to good ol' zoo.

Wednesday, January 20, 2010

Gotta do more, gotta be more

The holidays weren't restful or productive. It's always hard for me to work without a set schedule. On the upside, my girlfriend bought me a netbook for Xmas, which means I can code anywhere. I'm back into a schedule and I'm pleased with how much I'm getting done, in all aspects of my life.

So, I cracked open the new Wesnoth v1.7.12. That's the fifth stable candidate, which I think is a lot. Some things in Wesband are being broken with these releases. For one, my Gg^Vo no income village is has the same name as a new Orcish village. The "o" was supposed to stand for zero income. I'll have to see if "0" is an acceptable character to use and then convert everything over to use that.

I noticed movement wasn't getting refreshed on moveto events with no enemies around. I debugged this down to $unit.simple_action not being initialized. It turns out that no new variables or containers may be created in units now, other than expected ones, such as [attack]. I asked zookeeper about it and he thinks it's a bug, but I'm beginning to suspect it's a feature and that the devs want all miscellaneous unit variables to be set within [variables]. On the other hand, there's absolutely no mention of this in the changelog. I made a thread asking about it and will have to act depending on the answer. I think all that would need moving is talentpoints, simple_action and personal_gold, but I might be forgetting something. With the inclusion of Lua, one can actually alter unit variables in higher containers than the base one in debug mode, so it wouldn't be too limiting for debugging purposes. It would, however, make me really wish there was an equivalent to DOSKey in the debug command line.

And, the dungeon tries to create an empty unit upon entry. This one might actually be our fault and not a problem with Wesnoth.

Oh, and Exasperation made a small contribution over the holidays. Go to see he's still thinking of the project.