View unanswered posts | View active topics It is currently Fri Dec 27, 2024 8:11 am



Reply to topic  [ 7 posts ] 
 HELP! Actor Changing + Animation 
Author Message
User avatar

Joined: Mon Apr 13, 2009 12:27 pm
Posts: 813
Location: Yogyakarta, Indonesia. A slice o' paradise.
Reply with quote
Post 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?


Tue Jun 15, 2010 3:30 pm
Profile YIM WWW
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post 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.


Tue Jun 15, 2010 3:46 pm
Profile
User avatar

Joined: Fri Oct 17, 2008 9:46 pm
Posts: 5212
Location: The Grills Locker.
Reply with quote
Post 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.


Tue Jun 15, 2010 4:13 pm
Profile WWW
User avatar

Joined: Mon Apr 13, 2009 12:27 pm
Posts: 813
Location: Yogyakarta, Indonesia. A slice o' paradise.
Reply with quote
Post 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?


Wed Jun 16, 2010 5:59 am
Profile YIM WWW
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post 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.


Wed Jun 16, 2010 5:17 pm
Profile
User avatar

Joined: Mon Apr 13, 2009 12:27 pm
Posts: 813
Location: Yogyakarta, Indonesia. A slice o' paradise.
Reply with quote
Post 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.


Thu Jun 17, 2010 6:57 am
Profile YIM WWW
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post 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.


Thu Jun 17, 2010 6:30 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 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.048s | 13 Queries | GZIP : Off ]