View unanswered posts | View active topics It is currently Wed Dec 25, 2024 6:17 pm



Reply to topic  [ 8 posts ] 
 Pilot Ejection 
Author Message

Joined: Tue Oct 15, 2013 8:13 am
Posts: 93
Reply with quote
Post Pilot Ejection
After I made a new, huge amount updates for the ACTA mod, such as a actors and weapons, and the ejecting pods for the AC Crafts....

I made this eject pods like this:




if without a Team = 1 for the actor(s), they'll be as a neutral team though, it stills remain a Red team even I plays as a other team. Is there any lua for this?


Sat Dec 20, 2014 2:40 pm
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: Pilot Ejection
There are many ways to do this. The only problem I see is that with Lua, detecting the pilot and his escape craft would be somewhat complicated since they are all gibs, so if you attach the script to the DropShip and make it trigger on it's destruction, it won't be able to change the team of the pilot.

I'm not really sure of why the craft gib into a MOSRotating that then gibs into the ACDropShip instead of gibbing the craft into the ACDropShip right away. In case this doesn't really matter, the "easy" option would be directly creating all the things with Lua:

Code:
function Create(self)
   self.eject = CreateACDropShip("Pilot Release");
   self.eject.Team = self.Team;
   self.pilot = CreateAHuman("R-FP 44-1C");
   self.pilot.Team = self.Team;
   self.pilot:AddInventoryItem(CreateHDFirearm("PL2-Kl"));
   self.eject:AddInventoryItem(self.pilot);
end

function Destroy(self)
   self.eject.Pos = self.Pos;
   self.eject.Vel = self.Vel; --to give it an inertia-like movement when spawned
   MovableMan:AddActor(self.eject);
end


Something like that would be enough.


Sat Dec 20, 2014 9:31 pm
Profile

Joined: Tue Oct 15, 2013 8:13 am
Posts: 93
Reply with quote
Post Re: Pilot Ejection
thanks, does it have eject more at once?


Sun Dec 21, 2014 8:27 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: Pilot Ejection
I didn't get your question, you mean if it can eject more than one pilot/escpae pod at once? Yeah, you can.


Mon Dec 22, 2014 2:18 am
Profile

Joined: Tue Oct 15, 2013 8:13 am
Posts: 93
Reply with quote
Post Re: Pilot Ejection
but how?


Mon Dec 22, 2014 9:08 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: Pilot Ejection
Simply defining more ejects and pilots, though you'd have to be careful to place the ejection things in such way that they won't overlap with each other, since that would cause them to explode or something.

For example,

Code:
function Create(self)
   self.eject = CreateACDropShip("Pilot Release");
   self.eject.Team = self.Team;
   self.pilot = CreateAHuman("R-FP 44-1C");
   self.pilot.Team = self.Team;
   self.pilot:AddInventoryItem(CreateHDFirearm("PL2-Kl"));
   self.eject:AddInventoryItem(self.pilot);

   self.eject2 = CreateACDropShip("Pilot Release");
   self.eject2.Team = self.Team;
   self.pilot2 = CreateAHuman("R-FP 44-1C");
   self.pilot2.Team = self.Team;
   self.pilot2:AddInventoryItem(CreateHDFirearm("PL2-Kl"));
   self.eject2:AddInventoryItem(self.pilot2);
end

function Destroy(self)
   self.eject.Pos = self.Pos + Vector(-30,0); -- this (-30,0) vector is just a place holder, replace it for a better value later
   self.eject.Vel = self.Vel;

   self.eject2.Pos = self.Pos + Vector(30,0);
   self.eject2.Vel = self.Vel;

   MovableMan:AddActor(self.eject);
   MovableMan:AddActor(self.eject2);
end


That would allow you to bring out more escape pods. If you'd like to add more, you simply have to copy and paste the obviously copy/pasted chunk and rename the variables (adding a number at the end).


Mon Dec 22, 2014 8:44 pm
Profile

Joined: Tue Oct 15, 2013 8:13 am
Posts: 93
Reply with quote
Post Re: Pilot Ejection
Ok, I made this, but when the dropships left in the orbit, it left a pod instead along with it. It must've been only deleting AC.


Tue Dec 23, 2014 2:51 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: Pilot Ejection
I'm not sure if a health check would be enough because instant gibbing might not set the health of the craft to 0. Maybe a height check?

Code:
function Create(self)
   self.eject = CreateACDropShip("Pilot Release");
   self.eject.Team = self.Team;
   self.pilot = CreateAHuman("R-FP 44-1C");
   self.pilot.Team = self.Team;
   self.pilot:AddInventoryItem(CreateHDFirearm("PL2-Kl"));
   self.eject:AddInventoryItem(self.pilot);

   self.eject2 = CreateACDropShip("Pilot Release");
   self.eject2.Team = self.Team;
   self.pilot2 = CreateAHuman("R-FP 44-1C");
   self.pilot2.Team = self.Team;
   self.pilot2:AddInventoryItem(CreateHDFirearm("PL2-Kl"));
   self.eject2:AddInventoryItem(self.pilot2);
end

function Destroy(self)
   if self.Pos.Y > 0 then
      self.eject.Pos = self.Pos + Vector(-30,0); -- this (-30,0) vector is just a place holder, replace it for a better value later
      self.eject.Vel = self.Vel;

      self.eject2.Pos = self.Pos + Vector(30,0);
      self.eject2.Vel = self.Vel;

      MovableMan:AddActor(self.eject);
      MovableMan:AddActor(self.eject2);
   end
end


Tue Dec 23, 2014 3:55 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 8 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.084s | 13 Queries | GZIP : Off ]