View unanswered posts | View active topics It is currently Thu Mar 28, 2024 5:02 pm



Reply to topic  [ 9 posts ] 
 how do you attach actors to each other? 
Author Message
User avatar

Joined: Wed Apr 16, 2014 8:53 am
Posts: 64
Location: Bunker busting.
Reply with quote
Post how do you attach actors to each other?
basically what the title says, one example would be a turret on a craft


Thu May 15, 2014 12:25 am
Profile
User avatar

Joined: Fri Aug 20, 2010 4:45 am
Posts: 911
Location: No Comment.
Reply with quote
Post 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.


Thu May 15, 2014 12:35 am
Profile
User avatar

Joined: Wed Apr 16, 2014 8:53 am
Posts: 64
Location: Bunker busting.
Reply with quote
Post 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.


Thu May 15, 2014 1:29 am
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post 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!


Thu May 15, 2014 1:32 am
Profile
User avatar

Joined: Fri Aug 20, 2010 4:45 am
Posts: 911
Location: No Comment.
Reply with quote
Post 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.


Thu May 15, 2014 1:39 am
Profile
User avatar

Joined: Wed Apr 16, 2014 8:53 am
Posts: 64
Location: Bunker busting.
Reply with quote
Post Re: how do you attach actors to each other?
one more thing, how do i decide which actor is being attached?


Thu May 15, 2014 1:49 am
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post 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.


Thu May 15, 2014 2:02 am
Profile
User avatar

Joined: Wed Apr 16, 2014 8:53 am
Posts: 64
Location: Bunker busting.
Reply with quote
Post Re: how do you attach actors to each other?
so i just use the name of an actor from its .ini?


Thu May 15, 2014 2:20 am
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post Re: how do you attach actors to each other?
Indeed, that's how you generally reference actors.


Thu May 15, 2014 2:40 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 9 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.144s | 15 Queries | GZIP : Off ]