Data Realms Fan Forums
http://45.55.195.193/

CopyOf an Actor?
http://45.55.195.193/viewtopic.php?f=1&t=25944
Page 1 of 1

Author:  Jack Trades [ Sat Oct 22, 2011 12:08 pm ]
Post subject:  CopyOf an Actor?

I've got an actor and I want to make another one, that's exactly the same as the first actor but he should have different helmet, name and description.

Is it possible somehow reference that first actor (CopyOf?) but make changes to him (different head attachable for example) so that when I change stats (Gibs or Health for example) of the first actor they would apply to the second actor too, without me having to manually do changes to several exactly similar actors.

Author:  Arcalane [ Sat Oct 22, 2011 12:19 pm ]
Post subject:  Re: CopyOf an Actor?

Same way you CopyOf anything else. For example, the 40K mod uses lots of CopyOfs - all the Marines are based off a template, then helmets and jetpacks are modified.

ex;

Code:
AddActor = AHuman
   CopyOf = Imperial Guardsman Template
   PresetName = Imperial Guardsman
   Sharpness = 1
   ScriptPath = Base.rte/Actors/AI/HumanAI.lua
   AddToGroup = Imperial Guard
   Buyable = 1
   GoldValue = 125
   Jetpack = AEmitter
      CopyOf = ImperialJump
      ParentOffset = Vector
         X = -6
         Y = 2
      DrawAfterParent = 0


If you want to change anything, just specify the thing that's being changed and it'll overwrite whatever's in the original for the copy.

Author:  Jack Trades [ Sat Oct 22, 2011 12:56 pm ]
Post subject:  Re: CopyOf an Actor?

That's awesome, thanks.

Author:  carriontrooper [ Sat Oct 22, 2011 1:18 pm ]
Post subject:  Re: CopyOf an Actor?

A caveat; the 'template' actor shouldn't have any attachables that would be different in its child. This is because AddAttachable (as well as AddGib) does not overwrite, they add.

So, for example, you want to have different helmets on different heads: make a template head without a helmet first.
So for example you have heads 1, 2, 3 and helmets A, B, C, D. Simply define a template head with the graphics of head 1. Then do the CopyOf, add the helmet A attachable. Repeat until you have 4 CopyOfs of head 1. Then do another CopyOf, this time override the spritefile and offset into that of head 2. Rinse repeat.

Author:  Naxete [ Sat Oct 22, 2011 9:39 pm ]
Post subject:  Re: CopyOf an Actor?

carriontrooper wrote:
A caveat; the 'template' actor shouldn't have any attachables that would be different in its child. This is because AddAttachable (as well as AddGib) does not overwrite, they add.

Well said! same with devices, watch out with "Addinventory"s.

Author:  Jack Trades [ Sun Oct 23, 2011 6:03 pm ]
Post subject:  Re: CopyOf an Actor?

carriontrooper wrote:
A caveat; the 'template' actor shouldn't have any attachables that would be different in its child. This is because AddAttachable (as well as AddGib) does not overwrite, they add.

Thanks for the warning.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/