View unanswered posts | View active topics It is currently Thu Dec 26, 2024 5:16 pm



Reply to topic  [ 10 posts ] 
 AAL Pilot eject, come to own team, how? 
Author Message

Joined: Sat Jan 13, 2007 11:04 pm
Posts: 2932
Reply with quote
Post AAL Pilot eject, come to own team, how?
Today I decided to go nuts with AAL and I did some crazy tweaks to it and tested it out. It got 9000x times better. Now theres this one thing that is porbably possible to fix using Lua.

AAL has this "Escape Pod" that is gibbed when a vehicle is destroyed.
This pod is ment to drop out an actor belong to the team the vehicle was.
How can I make the gibbed pilot to set for either team that was using the vehicle to make the pilot that was using it be on the right side?

If its impossible to make the gibbed actor align to either team, I can change the mechanic somehow, the main point is, that the vehicle/craft must leave an pilot actor after its destroyed.


Fri May 22, 2009 2:29 pm
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post Re: AAL Pilot eject, come to own team, how?
Run a script on the parent vehicle to set the dropship's team and spawn it on destroy according to its own team. (note this will crash the game if someone exits while the MPAM is inside a map, it's #1 on the bugfix tickets)

Then run a script on the droppod to do the exact same thing, only for the actor.

Alternately, you could run a check in the create event of the droppod and pilot for the closest object in a particular groupname, such as MPAM or MPAM Droppod.


Fri May 22, 2009 2:34 pm
Profile
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post Re: AAL Pilot eject, come to own team, how?
Would something vaguely like "spawn ("escape pod" + team.tostring)" work in the destroy bit of the Lua code?


Fri May 22, 2009 2:56 pm
Profile WWW
User avatar

Joined: Fri Jan 26, 2007 3:22 am
Posts: 1451
Reply with quote
Post Re: AAL Pilot eject, come to own team, how?
Grif wrote:
Alternately, you could run a check in the create event of the droppod and pilot for the closest object in a particular groupname, such as MPAM or MPAM Droppod.



The first way is just dumb. There's no point in bothering with it as Data's apparently not planning on releasing a bugfix just for Lua.

The quoted method is best.


Fri May 22, 2009 5:26 pm
Profile

Joined: Sun May 18, 2008 7:49 am
Posts: 23
Reply with quote
Post Re: AAL Pilot eject, come to own team, how?
In your mech or whatever's script add this in the death function:
Code:
local dude = CreateAHuman("Pilot");
local pod = CreateACRocket("Escape pod");
dude.team = self.team;
pod.team = self.team;
pod:AddInventoryItem(dude);
pod.Vel = self.Vel;
pod.Pos = self.Pos;
MovableMan:AddActor(pod);


Fri May 22, 2009 6:59 pm
Profile
User avatar

Joined: Tue Nov 06, 2007 6:58 am
Posts: 2054
Reply with quote
Post Re: AAL Pilot eject, come to own team, how?
Or, while this could cause issues if two die at the same time, have it set a variable on death to the team it's on.

Just explain it off with "Sometimes the force of ejection can damage the pilot's friend or foe system", or something.

And to the guy above, that's what grif said.


Sat May 23, 2009 2:56 am
Profile

Joined: Sat Jan 13, 2007 11:04 pm
Posts: 2932
Reply with quote
Post Re: AAL Pilot eject, come to own team, how?
What is the function to check if the actor is killed? The above code sort of worked, but not entirely. It doesnt pop anything out unless theres an if statement of somesort.

I've also have some code that will instagib the actor when its health reaches 0.
This is because they have regenarating wounds so if this actor dies from wounds, he might stay there forever.

PS, I still dont know Lua too well, so I really need help in writing the code itself
if possible.

Heres the code:

Code:
function Create(self)
   local dude = CreateAHuman("AAL Assault Pilot");
   local pod = CreateACRocket("AAL Escape Pod");

end

function Destroy(self)
   MovableMan:AddActor(pod);
end


function Update(self)
   dude.team = self.team;
   pod.team = self.team;
   pod:AddInventoryItem(dude);
   --pod.Vel = self.Vel;
   pod.Pos = self.Pos;
   if self.Health < 1 then   
      self:GibThis() ;
   end
end


Sat May 23, 2009 9:07 am
Profile

Joined: Sun May 18, 2008 7:49 am
Posts: 23
Reply with quote
Post Re: AAL Pilot eject, come to own team, how?
Try putting all the code I gave you in the destroy function.


Sat May 23, 2009 9:23 am
Profile
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post Re: AAL Pilot eject, come to own team, how?
Code:
function Create(self)
   self.dude = CreateAHuman("AAL Assault Pilot", "AAL.rte");
   self.pod = CreateACRocket("AAL Escape Pod", "AAL.rte");
   self.dude.Team = self.Team;
   self.pod.Team = self.Team;
   self.pod:AddInventoryItem(self.dude);
end

function Destroy(self)
   MovableMan:AddActor(self.pod);
end


function Update(self)
   --self.pod.Vel = self.Vel;
   self.pod.Pos = self.Pos;
   if self.Status > 3 then   --if the actor is dead or dying (not sure if this one will work)
      self:GibThis(); --asplode :)
   end
end

should work, but might not.. if grif and daman are right. get some use caps properly nummy..


Sat May 23, 2009 9:27 am
Profile WWW

Joined: Sat Jan 13, 2007 11:04 pm
Posts: 2932
Reply with quote
Post Re: AAL Pilot eject, come to own team, how?
Alright! It works now, except that the escape pod is so weak it explode immidiatly and the pilot usually gets a nice warm hug from the explosion. :P

Case closed!


Sat May 23, 2009 11:57 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 10 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.058s | 14 Queries | GZIP : Off ]