Page 1 of 1

Eden's Guile boot's don't recharge any more

Posted: Fri Jan 07, 2011 7:21 pm
by Postman
They were recharging before, but now in Dreadfell they don't. Burning star recharge ok. Is t a bug or intended behavior?
PS they were stored in Sher Tul before mulfanction

Re: Eden's Guile boot's don't recharge any more

Posted: Sat Jan 08, 2011 1:45 pm
by Postman
Choker of Dread seems doesn't recharge either

Re: Eden's Guile boot's don't recharge any more

Posted: Sun Jan 09, 2011 2:50 pm
by gogis
Had plenty occasional stuff wich not recharge aswell, but it's not specific item related, all my chokers and guiles worked just fine :)

Re: Eden's Guile boot's don't recharge any more

Posted: Sun Jan 09, 2011 3:15 pm
by Postman
The thing is, I suspect guile stopped working after being stored in Sher Tul for a while. Seems all artifacts which I wear without taking off are OK. Artifacts which I remove and put again sometimes(?) stop recharging.

Re: Eden's Guile boot's don't recharge any more

Posted: Mon Jan 10, 2011 1:32 am
by darkgod
I believe I have now fixed it

Re: Eden's Guile boot's don't recharge any more

Posted: Mon Jan 10, 2011 1:01 pm
by deadram
function _M:regenPower() in /game/engines/default/engine/interface/ObjectActivable.lua doesn't seem to be called for the affected items. I seem to be able to reproduce this bug with either the first or second rechargeable I pick up (with a new char) in b18. Usually ends up being a digger, but sometimes it's been the rod of recall XD

Ohh, but because the in-game description lists values for use_power.power, power, power_regen, and power_max these variables don't seem to be the cause.

I'd be interested to know how it was fixed, for curiosity sake :)

Re: Eden's Guile boot's don't recharge any more

Posted: Mon Jan 10, 2011 1:15 pm
by darkgod
Well the only possible cause for this to happen is that the objects are not correctly registered in the Game object.
I added in several places checks to ensure it is so.
That whole subsytem stinks anyway and is slated for rewrite

Re: Eden's Guile boot's don't recharge any more

Posted: Tue Jan 11, 2011 1:05 pm
by deadram
hummm, my search skills are failing me in middle age XD Any chance to get info on acquiring the svn copy? Just the web address will suffice :) Might even put in the effort to make it a wiki page for the tip :)

Re: Eden's Guile boot's don't recharge any more

Posted: Tue Jan 11, 2011 3:22 pm
by greycat
http://forums.te4.org/viewtopic.php?f=36&t=21244

Last thread on the last page of the Development forum. Or, if you look at it another way, the first thread....

Re: Eden's Guile boot's don't recharge any more

Posted: Wed Jan 12, 2011 11:36 am
by deadram
I didn't feel like going over the diff of the svn and b18, so here's my fix. It will restore entities (make items recharge) when you wear, take off, or pick up any item. If you just change the lua file, and load your game, drop and pick-up an item and save, then restore the old file (hurm... now even I'm confused :P)... You'll fix your broken recharging items, and be able to do the profile uploady thing... until an item breaks again XD

Code: Select all

diff -ru t-engine4-src-1.0.0beta18/game/engines/default/engine/interface/ActorInventory.lua t-engine4-src-1.0.0beta18-recharge/game/engines/default/engine/interface/ActorInventory.lua
--- t-engine4-src-1.0.0beta18/game/engines/default/engine/interface/ActorInventory.lua  2010-12-30 19:11:38.000000000 -0500
+++ t-engine4-src-1.0.0beta18-recharge/game/engines/default/engine/interface/ActorInventory.lua 2011-01-12 06:28:17.000000000 -0500
@@ -133,6 +133,7 @@
 
                        local letter = ShowPickupFloor:makeKeyChar(self:itemPosition(self.INVEN_INVEN, o) or 1)
                        if vocal then game.logSeen(self, "%s picks up (%s.): %s.", self.name:capitalize(), letter, o:getName{do_color=true}) end
+                       game.player:inventoryApplyAll(function(inven, item, o) game:addEntity(o) end)
                elseif not prepickup then
                        if vocal then game.logSeen(self, "%s has no room for: %s.", self.name:capitalize(), o:getName{do_color=true}) end
                end
@@ -370,6 +371,7 @@
                        o.wielded[k] = self:addTemporaryValue(k, e)
                end
        end
+       game.player:inventoryApplyAll(function(inven, item, o) game:addEntity(o) end)
 end
 
 --- Call when an object is taken off
@@ -384,6 +386,7 @@
                end
        end
        o.wielded = nil
+       game.player:inventoryApplyAll(function(inven, item, o) game:addEntity(o) end)
 end
 
 --- Re-order inventory, sorting and stacking it