Difference between revisions of "Talk:OnAttachedToCell - ObjectReference"
Talk:OnAttachedToCell - ObjectReference (edit)
Revision as of 11:58, 9 July 2013
, 11:58, 9 July 2013no edit summary
imported>HawkFest |
imported>HawkFest |
||
Line 35: | Line 35: | ||
::CheckGold function is called from OnDetachedFromCell and OnCellDetach events. When those events happen is a total mystery to me. However, a look at what CheckGold function does unveils a little clue : Balimund's TrainerType property is initialised to 2, which means that he'll end-up with maximum 800 gold when one of those two events happen. If he has less then he'll end up with the same amount. Personally I can't go further down the logic, since in my game I haven't seen this happen : either there's a 2 days merchant reset taking place, which does not leave the merchant with a lesser amount than the "default" one, either we can trade with whatever amount has been traded up until now, which does not remove any gold above some default value as is the case here via MaxGold function variable (set by the TrainerType property). A mystery... Could this be related to training? Or do some specific NPC as Balimund have their gold amount processed this way, related to some "attachment" an actor or location could have with the cell? What constitutes such attachment? This "attachment" thing is so blurred... | ::CheckGold function is called from OnDetachedFromCell and OnCellDetach events. When those events happen is a total mystery to me. However, a look at what CheckGold function does unveils a little clue : Balimund's TrainerType property is initialised to 2, which means that he'll end-up with maximum 800 gold when one of those two events happen. If he has less then he'll end up with the same amount. Personally I can't go further down the logic, since in my game I haven't seen this happen : either there's a 2 days merchant reset taking place, which does not leave the merchant with a lesser amount than the "default" one, either we can trade with whatever amount has been traded up until now, which does not remove any gold above some default value as is the case here via MaxGold function variable (set by the TrainerType property). A mystery... Could this be related to training? Or do some specific NPC as Balimund have their gold amount processed this way, related to some "attachment" an actor or location could have with the cell? What constitutes such attachment? This "attachment" thing is so blurred... | ||
::'''EDIT''' - it looks like this would be more appropriate than using OnLoad event in some cases : the later won't fire up if the object is already loaded in memory. However, OnAttachedToCell would fire up everytime you get into that cell even though its objects are already loaded in memory. | ::'''EDIT''' - it looks like this would be more appropriate than using OnLoad event in some cases : the later won't fire up if the object is already loaded in memory. However, OnAttachedToCell would fire up everytime you get into that cell even though its objects are already loaded in memory. | ||
::'''EDIT 2''' - it seems that '''OnCellAttach would be the way to go for exterior cells : OnAttachdToCell does NOT happen every time the player gets into a cell where however an OnCellAttach event fires up.''' Like the page says, this event fires when the related object is ''moved'' from one other cell to the current one. | |||
::--[[User:HawkFest|HawkFest]] ([[User talk:HawkFest|talk]]) 21:49, 14 December 2012 (EST) | ::--[[User:HawkFest|HawkFest]] ([[User talk:HawkFest|talk]]) 21:49, 14 December 2012 (EST) |