Data Realms Fan Forums
http://45.55.195.193/

HELP! Actor Changing + Animation
http://45.55.195.193/viewtopic.php?f=73&t=18987
Page 1 of 1

Author:  carriontrooper [ Tue Jun 15, 2010 3:30 pm ]
Post subject:  HELP! Actor Changing + Animation

So, I tried to make an actor-changing script, and so far, it doesn't work. Any ideas on why?

Code:
function Create(self)

end

function Update(self)
   if self:IsPlayerControlled() and UInputMan:KeyPressed(3) then
   local new = CreateAHuman("Bomb Puppet");
   new.Pos = self.Pos;
   new.Vel = self.Vel;
   new.Team = self.Team;
   new.RotAngle = self.RotAngle;
   new.AIMode = Actor.AIMODE_SENTRY;
   if self.HFlipped == true then
      new.HFlipped = true
      MovableMan:AddActor(new);
   else
      MovableMan:AddActor(new);
   end
   self.ToDelete = true;
   CurrentF = ActivityMan:GetActivity():GetTeamFunds(self.Teamset);
   ActivityMan:GetActivity():SetTeamFunds(CurrentF - 40, self.Teamset);
   end
   end
end


I also wanted to make this with an animated sequence of the actor transforming into another actor, any idea on how?

Author:  CaveCricket48 [ Tue Jun 15, 2010 3:46 pm ]
Post subject:  Re: HELP! Actor Changing + Animation

I don't see the variable "self.Teamset" defined anywhere. Also try changing "self:IsPlayerControlled()" to "self:IsPlayer Controlled == true", makeing sure you have the right actor defined, and that you're pressing the right key. Oh, and check for Lua console errors.

Author:  Areku [ Tue Jun 15, 2010 4:13 pm ]
Post subject:  Re: HELP! Actor Changing + Animation

Question: Do you want the actor to be able to change only once, or iterate between two shapes when the key is pressed? If it's the second option, I have a script that might do just that.

Author:  carriontrooper [ Wed Jun 16, 2010 5:59 am ]
Post subject:  Re: HELP! Actor Changing + Animation

@CC48: D'oh, the Teamset was from that other script, easy to fix... I'll try to put self:IsPlayerControlled == true. I'll see what console errors I get.

@Areku: Just once, it transforms into another actor.

And can anyone help me on adding animation into the transform business? I already have the frames, but don't know how to implement them yet. Should I put it on a transitionary ACrab?

Author:  CaveCricket48 [ Wed Jun 16, 2010 5:17 pm ]
Post subject:  Re: HELP! Actor Changing + Animation

I usually use MOSRotatings for animations with the frames being Lua controlled. So, spawn an MOSRotating that has the animation sprites and change the frames per X milliseconds for an animation.

Author:  carriontrooper [ Thu Jun 17, 2010 6:57 am ]
Post subject:  Re: HELP! Actor Changing + Animation

Hmmm.... that means this faction can't be included in missions because it has no brains yet, and thus if said lone actor transforms into a MOSR, said hypothetical mission would fail immediately...
But might be fun for skirmish modes.
I'll update this post with WIP script later.

Author:  CaveCricket48 [ Thu Jun 17, 2010 6:30 pm ]
Post subject:  Re: HELP! Actor Changing + Animation

You don't have to delete/gib the actor untill the animation is done. Just turn all of the actor parts to Scale 0.

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