I would like to create a character clone like create a copy and add a script OnDamage to destroy object_Self if he got damaged
Is that possible or is too far?
I would like to create a character clone like create a copy and add a script OnDamage to destroy object_Self if he got damaged
Is that possible or is too far?
Very possible. CopyObject makes an exact copy, including inventory and scripts. You could set a local integer on the clone to cause it to be destroyed OnDamaged. That script will need to be on the original, too, but it will be harmless unless the local flag is set.
You can even clone a PC, as in the following example, in which the clone also attacks the PC:
For an NPC, only the CopyObject line would be necessary, in most cases.
I am here just to say that I'll reply it later. Need to study the script you wrote later and doing my tests.
Yes, I would clone Player Characters and not NPCs
If you are cloning player characters then you will additionally need to provide them with a script set. I believe this can be easily accomplished through an NWNX plugin. However, without a plug-in, the traditional way is to copy the PC, have the PC dominate the copy, make a copy of the copy (the PC dominate script set is an associate script set as well) and destroy the first copy.