It is currently Fri Dec 05, 2008 2:29 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Strange Life value [Coregina RC3]
PostPosted: Tue Jun 05, 2007 8:41 am 
Offline
User avatar

Joined: Sun Feb 05, 2006 1:34 pm
Posts: 58
Location: Italy
A really strange bug (?) happens in our live shard with latest 097 Linux core: sometimes Life and MaxLife of NPCs gets very high without a reason... so high that on next reboot POL can't start saying Life is out of value for that NPC... :?

Running RecalcVitals() on NPC, reset MaxLife to right value.

Here's our GetLifeMaximumValue function:
Code:
exported function GetLifeMaximumValue(who)
   var pf := GetObjProperty(who, "PF");
   if(pf)
      return pf * 100;
   else
      return 10000;         // default: 100
   endif
endfunction


In latest error happening we saw: cprop PF was 4, Life was something about 1.900.000.000 and MaxLife was 79548 :shock:

Even if we can debug our scripts to search for a point where Life could be wrongly set too high, MaxLife cannot be set by script... so I think there's a problem in core... :sad:

Any idea?

P.S.: could this this the cause of our often SaveWorldState error

_________________
Developer Silver
Faerun's Legends scripter
http://www.faerunslegends.it/


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 07, 2007 10:59 am 
Offline

Joined: Sat Feb 04, 2006 1:24 pm
Posts: 8
Location: Vienna, Austria
Hello,

we have a similar function for this and no problems at all.

I would recommend you change your script to:
Code:
var pf := CInt(GetObjProperty(who. "PF"));


The CInt() will ensure that you always have a valid integer, and when the CProp is missing, it will return 0, so the 'if' below will work too.

OWHorus[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 07, 2007 1:19 pm 
Offline
User avatar

Joined: Sun Feb 05, 2006 1:34 pm
Posts: 58
Location: Italy
Mmmmh.. the else case should run if variable is 0 or an error... CInt() is useless... :?

_________________
Developer Silver
Faerun's Legends scripter
http://www.faerunslegends.it/


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

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 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 © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl