Data Realms Fan Forums
http://45.55.195.193/

how do you attach actors to each other?
http://45.55.195.193/viewtopic.php?f=1&t=45700
Page 1 of 1

Author:  grave accent [ Thu May 15, 2014 12:25 am ]
Post subject:  how do you attach actors to each other?

basically what the title says, one example would be a turret on a craft

Author:  Sims_Doc [ Thu May 15, 2014 12:35 am ]
Post subject:  Re: how do you attach actors to each other?

Just going to state the obvious here but have you tried looking at another mod? but then again.

Author:  grave accent [ Thu May 15, 2014 1:29 am ]
Post subject:  Re: how do you attach actors to each other?

the only mod i have seen that does such a thing as of now is the wehrmacht but last time i checked, the turrets didn`t follow the team of the owner ( unless they are player 1) and they just randomly appeared in the middle of the map.

Author:  Asklar [ Thu May 15, 2014 1:32 am ]
Post subject:  Re: how do you attach actors to each other?

I'm not sure if you can simply use "AddAttachable = Actor" on the .ini of the actor, but what has been done multiple times is using Lua for it.

A simple script on the main actor, for example,

Code:
function Create(self)
self.Turret = CreateACrab("My OP turret");
self.Turret.Team = self.Team;
self.Turret.Pos = self.Pos + Vector(X,Y); --Set X,Y to the corresponding position you want the turret on
MovableMan:AddActor(self.Turret);
end

function Update(self)

--Make the position of the turret flip if the main actor flips
if self.HFlipped then
    self.flip = -1;
else
    self.flip = 1;
end

if self.Turret.Health > 0 then
    self.Turret.Pos = self.Pos + Vector(X*self.flip,Y);
end
end


This is a very simple script for this. I don't see any reasons of why it shouldn't work, but it definately can be improved to work better.



Also, we have a mod help section to actually help other users, so you should always ask for help if you need some!

Author:  Sims_Doc [ Thu May 15, 2014 1:39 am ]
Post subject:  Re: how do you attach actors to each other?

grave accent wrote:
the only mod i have seen that does such a thing as of now is the wehrmacht but last time i checked, the turrets didn`t follow the team of the owner ( unless they are player 1) and they just randomly appeared in the middle of the map.


that isn't the only one that has dropship turrets, MaximDude Corp it has a fairly impressive gunship but i don't know if its in working order in this version.

Author:  grave accent [ Thu May 15, 2014 1:49 am ]
Post subject:  Re: how do you attach actors to each other?

one more thing, how do i decide which actor is being attached?

Author:  Asklar [ Thu May 15, 2014 2:02 am ]
Post subject:  Re: how do you attach actors to each other?

In the line that says "self.Turret = CreateACrab("My OP turret");", replace the string "My OP turret" for the PresetName of your turret.

Also remember to change the x and y values of the vector to move the turret into the position you want.

Author:  grave accent [ Thu May 15, 2014 2:20 am ]
Post subject:  Re: how do you attach actors to each other?

so i just use the name of an actor from its .ini?

Author:  Asklar [ Thu May 15, 2014 2:40 am ]
Post subject:  Re: how do you attach actors to each other?

Indeed, that's how you generally reference actors.

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