Closed Eumeta closed 8 months ago
One possibility is that there are fields that Script Extender does not yet provide access to that would need to be filed in for things to work correctly.
I noticed the same thing with passives added this way, or at least the passives within Ext.Entity.Get(character id).PassiveContainer.Passives, wrote a whole piece to detect and add passives the vanilla character has that the spawned character doesn't. While the script works, judging by the spawned character can do extra attacks, it doesn't display the passive Extra Attack on inspection
Ext.Entity.Get(*spawn id*) = deepcopy( Ext.Entity.Get(*vanilla character id*)
This will absolutely not work.
Firstly, Ext.Entity.Get
returns an entity handle, which is an lvalue; assigning to it will not change the properties of the, but rather just assign a different handle to the local.
Secondly, entity handles are not iterable, so you cannot deep copy them.
Thirdly, the deepcopy function you mentioned only performs a copy for type == 'table'
; all values returned from Entity.Get (and its subobjects) are lightcppobject
, not table
.
Either the code you pasted is incomplete, or your the code doesn't really copy anything.
So that explains why i had to add smaller functions below, i really didn;t have a clue doing stuff in Lua Thank you. There's still the issue of the clones maxHP not updating visually in-game, do I close this issue as complete or not planned ? I belatedly realised I could have just assign a local value to Ext.Entity.Get(vanilla character id) then find out fields that can utilise script extender functions like Osi.AddBoosts to do the same work with much shorter writing.
Apologies if this is not the place to post this, I just can't find any site with script advice that's not Cheat Engine related. So my issue is the visual inability of a character spawn by command to update its health bar to match its data:
CreateAt(TemplateId, X, Y, Z, Temporary, PlaySpawn, SpawnFinishEvent)
to spawn a characterExt.Entity.Get(*spawn id*) = deepcopy( Ext.Entity.Get(*vanilla character id*)
, basically copies every field with its subfield recursively (e.g. Health, then Health.Hp, etc)Am I missing a function somewhere to update stats to display ? Also, the deep_copy function is provided by Phind
THank you for making BG3SE, and for supporting its creators