Author Topic: Character Clone  (Read 352 times)

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0
Character Clone
« on: February 03, 2015, 02:02:05 am »


               

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?



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
Character Clone
« Reply #1 on: February 03, 2015, 07:21:07 am »


               

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:


 



   Spoiler
   


 


For an NPC, only the CopyObject line would be necessary, in most cases.



               
               

               
            

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0
Character Clone
« Reply #2 on: February 04, 2015, 03:21:48 am »


               

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



               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Character Clone
« Reply #3 on: February 04, 2015, 03:34:45 am »


               

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.