All pastes #343726 Raw Edit

Mine

public text v1 · immutable
·published 2007-02-07 06:49 UTC
rendered paste body
When I had data like that to save - like I tracked total # kills 
<Elrahc> m hm 
<GrinningFool> - I would do it as part of the 'save character record' call 
<GrinningFool> And that would run ~once per two minutes 
<GrinningFool> Or whenever the PC transitioned, whichever came first 
<Elrahc> So what happens when a creature is killed, is it stored on the character locally meanwhile? 
<GrinningFool> Yep 
<GrinningFool> You can store it by resref, or by the value returned from GetCreatureType (I think that's the rigth call) 
<Elrahc> So it's the DB writing, not a local variable writing, that's the killer in lag terms during combat? 
<GrinningFool> though that value might be too general 
<GrinningFool> right 
<Elrahc> Alright, thanks. That helped a lot 
<GrinningFool> If you have a /huge/ number of local variables it will also slow things down 
<Elrahc> Should be the only ones 
<GrinningFool> I like to keep it under a couple dozen; but I've read that folks keep it under a coupe hundred and are OK 
<Elrahc> alright, good thing to know 
<GrinningFool> You can also get tricky in how you store the info.  You don't need one variable per creature type 
<Elrahc> Can't you just add a creature_type variable for each creature, and a number in it, then delete them as they're written to the DB? 
<GrinningFool> Yep could do that 
<Elrahc> Ok 
<GrinningFool> That's a valid point, it's not like you'd have to constantly store counts for every creature type, all the time 
<GrinningFool> on the PC 
<Elrahc> Jea, and with being deleted as soon as it's DB transferred, should keep the variables stored pretty low