| 
	| 
		
		FAQ
		 • Search • Login
	 | 
	
    
	
	 
  
	
	
		
			
				 
			 | 
		
			 Page 1 of 1
  | 
			 [ 7 posts ]  | 
			 | 
		
	 
	 
			
	
	 HELP! Actor Changing + Animation   
	
        
        
            | Author | 
            Message | 
         
        
			| 
				
				 carriontrooper 
				
				
					 Joined: Mon Apr 13, 2009 12:27 pm Posts: 813 Location: Yogyakarta, Indonesia. A slice o' paradise.
				 
				 
			 | 
			
				
				  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 | 
			
				
					 
					
					 
				      
			 | 
    	
		 
	
	
		  | 
	 
	
			| 
				
				 CaveCricket48 
				
				
					 Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
				 
				 
			 | 
			
				
				  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 | 
			
				
					 
					
					 
				  
			 | 
    	
		 
	
	
		  | 
	 
	
			| 
				
				 Areku 
				
				
					 Joined: Fri Oct 17, 2008 9:46 pm Posts: 5212 Location: The Grills Locker.
				 
				 
			 | 
			
				
				  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 | 
			
				
					 
					
					 
				    
			 | 
    	
		 
	
	
		  | 
	 
	
			| 
				
				 carriontrooper 
				
				
					 Joined: Mon Apr 13, 2009 12:27 pm Posts: 813 Location: Yogyakarta, Indonesia. A slice o' paradise.
				 
				 
			 | 
			
				
				  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 | 
			
				
					 
					
					 
				      
			 | 
    	
		 
	
	
		  | 
	 
	
			| 
				
				 CaveCricket48 
				
				
					 Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
				 
				 
			 | 
			
				
				  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 | 
			
				
					 
					
					 
				  
			 | 
    	
		 
	
	
		  | 
	 
	
			| 
				
				 carriontrooper 
				
				
					 Joined: Mon Apr 13, 2009 12:27 pm Posts: 813 Location: Yogyakarta, Indonesia. A slice o' paradise.
				 
				 
			 | 
			
				
				  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 | 
			
				
					 
					
					 
				      
			 | 
    	
		 
	
	
		  | 
	 
	
			| 
				
				 CaveCricket48 
				
				
					 Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
				 
				 
			 | 
			
				
				  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 | 
			
				
					 
					
					 
				  
			 | 
    	
		 
	
	
		  | 
	 
	
	
		 | 
	 
	
	 
	
	
	
		
			
				  
			 | 
		
			 Page 1 of 1
  | 
			 [ 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
  | 
 
 
 
	 |