ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Sun Jul 22, 2018 12:49 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Starting life
PostPosted: Wed Jul 17, 2013 3:47 am 
Offline
Thalore

Joined: Mon Mar 25, 2013 10:09 pm
Posts: 153
I've noticed that creatures in my fledgling module are created with 100 life, presumably because engine.interface.ActorLife defaults max_life and life to 100 before the player's birth descriptors or NPCs' initialization code correctly set max_life.

I found that I can fix this by just adding an additional "life = " line to the birth descriptors and NPC definitions, and I saw where Startide uses a resolvers.life (presumably to fix this same problem), but is there a cleaner way of handling this? I couldn't see how ToME itself addresses it.

_________________
Qi Daozei (QDZ) - an Oriental-themed fantasy game for T-Engine. ToME Tips - auto-generated spoilers for ToME.


Top
 Profile  
 
 Post subject: Re: Starting life
PostPosted: Wed Jul 17, 2013 5:53 pm 
Offline
Master of Eyal

Joined: Wed Jul 24, 2002 9:26 pm
Posts: 10228
Location: Angolwen
In your actor init fucntion you can simply set self.life = self.max_life

_________________
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)


Top
 Profile  
 
 Post subject: Re: Starting life
PostPosted: Fri Jul 19, 2013 1:49 am 
Offline
Thalore

Joined: Mon Mar 25, 2013 10:09 pm
Posts: 153
It looks like Actor's init is called before resolving and birth descriptors take place, so max_life doesn't yet have its final value.

I finally saw where ToME defines a resetToMax function that's called (indirectly) by resolveLevel, so I'm taking a similar approach.

Thanks.

_________________
Qi Daozei (QDZ) - an Oriental-themed fantasy game for T-Engine. ToME Tips - auto-generated spoilers for ToME.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group