Osiris/API/CharacterTransform
From Divinity Engine Wiki
Full Definition(s)
- call CharacterTransform(((CHARACTERGUID)_Character, (STRING)_ObjectTemplate, (INTEGER)_ReplaceScripts, (INTEGER)_ReplaceScale, (INTEGER)_ReplaceStats, (INTEGER)_ReplaceEquipment, (INTEGER)_ReplaceSkills, (INTEGER)_UseCustomLooks, (INTEGER)_ReleasePlayerData)
Description
Transforms _Character into the root template _ObjectTemplate. In particular, a.o. the visual and physics resources will be replaced.
Other parameters allow you to customise whether certain properties of _Object should be replaced by the values of the corresponding properties on _ObjectTemplate:
- _ReplaceScripts: indicates whether the assigned behaviour scripts should be replaced.
- _ReplaceScale: indicates whether the current scale of the object should be replaced.
- _ReplaceStats: indicates whether the Stats should be replaced.
- _ReplaceEquipment: indicates whether the equipment set should be replaced. This should only be enabled if _Character is an NPC.
- _ReplaceSkills: indicates whether the assigned skills should be replaced. This should only be enabled if _Character is an NPC.
- _UseCustomLooks: if true, keeps the custom looks of the original character (its visual set indices, or its appearance as selected in character creation).
- _ReleasePlayerData: Once a character has been made a player once, a bunch of extra data gets recorded for them. For example, they have individual equipment slots rather than an equipment set, they can have unspent attribute points when levelling up, custom visuals selected in character creation/magic mirror, etc. This extra data is kept even when a character is turned into an NPC again, to ensure it doesn't get lost between dismissing and re-recruiting a companion. If you pass 1 here, this data will be removed (check NPC/player).
Notes
- Transforming an object more than once is not supported. It may (seem to) work, but the result is undefined.
- Transforming an object will remove the tags that it got from its original root template, and add the tags from the new root template. Tags set by script or from dialogs are unaffected.
- This will not change the voice of the character. See CharacterTransformAppearanceTo for a way to do this.