View unanswered posts | View active topics It is currently Sat Dec 28, 2024 4:32 pm



Reply to topic  [ 6 posts ] 
 CopyOf an Actor? 
Author Message
User avatar

Joined: Fri Sep 16, 2011 4:40 pm
Posts: 234
Reply with quote
Post 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.


Sat Oct 22, 2011 12:08 pm
Profile WWW
User avatar

Joined: Sun Jan 28, 2007 10:32 pm
Posts: 1609
Location: UK
Reply with quote
Post 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.


Sat Oct 22, 2011 12:19 pm
Profile YIM
User avatar

Joined: Fri Sep 16, 2011 4:40 pm
Posts: 234
Reply with quote
Post Re: CopyOf an Actor?
That's awesome, thanks.


Sat Oct 22, 2011 12:56 pm
Profile WWW
User avatar

Joined: Mon Apr 13, 2009 12:27 pm
Posts: 813
Location: Yogyakarta, Indonesia. A slice o' paradise.
Reply with quote
Post 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.


Sat Oct 22, 2011 1:18 pm
Profile YIM WWW
User avatar

Joined: Fri Apr 30, 2010 2:12 pm
Posts: 560
Reply with quote
Post 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.


Sat Oct 22, 2011 9:39 pm
Profile
User avatar

Joined: Fri Sep 16, 2011 4:40 pm
Posts: 234
Reply with quote
Post 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.


Sun Oct 23, 2011 6:03 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.031s | 13 Queries | GZIP : Off ]