Page 1 of 1

Module Questions

Posted: Sun Jan 20, 2013 9:44 pm
by BDota
I've noticed that in the Example Module all actors start out with 100 HP regardless of their max life. Is there a way to fix it?

Re: Module Questions

Posted: Mon Jan 21, 2013 9:24 pm
by Orrus
Looks like a bug. The tooltip shows 100 only for the first turn of a new dungeon. After that it updates and properly shows 6, 7, etc.

I'd guess the actor's life init() is being called before the Kobold descriptor gets a chance to run and process the proper life value.

Code: Select all

engine.interface.ActorLife.init(self, t)
Inside ActorLife.init():

Code: Select all

self.max_life = t.max_life or 100
So if no t.max_life value is available, it defaults to 100.

After the first turn the max_life descriptor had a chance to update the enemies real max life, so the tooltip fixes itself.

As for how to fix it? Hmm maybe force an update of the hp values in the tooltip. Or dig around in the engine code. Now I'm curious if this bug occurs in vanilla ToME. But alas, lunch break is over back to work. Good luck.