Difference between revisions of "Talk:CreateFullActorCopy"

Jump to navigation Jump to search
501 bytes added ,  10:41, 6 July 2006
adding script I used
imported>ShadowDancer
(Additional info)
imported>ShadowDancer
(adding script I used)
Line 6: Line 6:


:Additionally, as long as you get a reference variable to the copy, you can pretty much do whatever to the copy without affecting the original from what I found by experimentation with this.  Changing the name doesnt affect the base copy or the original in the game from what I have seen (I created an activator to duplicate an NPC reference though).  Mileage might vary in a spell script since scripts sometimes have odd effects for no apparent reason.  I did a [[SetActorFullName]] and a [[RemoveAllItems]] on the copy with no effects on the original in the same room.  It essentially creates a new reference to the base object minus the dialogue and AI functions from what I can tell.  I still have no idea why it wipes those.
:Additionally, as long as you get a reference variable to the copy, you can pretty much do whatever to the copy without affecting the original from what I found by experimentation with this.  Changing the name doesnt affect the base copy or the original in the game from what I have seen (I created an activator to duplicate an NPC reference though).  Mileage might vary in a spell script since scripts sometimes have odd effects for no apparent reason.  I did a [[SetActorFullName]] and a [[RemoveAllItems]] on the copy with no effects on the original in the same room.  It essentially creates a new reference to the base object minus the dialogue and AI functions from what I can tell.  I still have no idea why it wipes those.
<pre>
ScriptName Duplicate
Ref ActorRef
Ref DoOnce
Float Timer
Begin OnActivate
  If IsActionRef Player == 1
      Set ActorRef to PriorMaborelRef.CreateFullActorCopy  ;Creates actor copy
  EndIf
End
Begin GameMode
  If Timer >= 10 && DoOnce == 0
      ActorRef.RemoveAllItems                    ;Removes items only on copy
      ActorRef.SetActorFullName "Idiot Savant"  ;Changes name only on copy
      Set DoOnce to 1
  Else
      Set Timer to Timer + GetSecondsPassed
  EndIf
End
</pre>
Anonymous user

Navigation menu