Script animations Player

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
Vertex
Posts: 108
Joined: Fri May 22, 2015 1:01 am
Location: Colombia
Contact:

Script animations Player

Post by Vertex » Thu May 28, 2015 12:05 am

Hello, would you like help , I do not quite understand commands animations.

I need my character not having the W and S keys this into an animation of rest and presoinar the W and S keys to run the animation is run.

Any suggestions?

Image

Code: Select all

if( IsKeyDown(Key_W))
{
  Animate(RUN);
}

Code: Select all

{
// File Script Player

tecla_W			[15] 	// Tecla W.	
	tecla_S			[27]  	// Tecla S.
    tecla_DR        [73]
	
	IDLE			[Idle]
	animIdle		[false]
	
	Inicio [()
	{
	    
		self.yaw_speed  =2000; // Velocidad de Giro.
		self.ideal_yaw = 180;
		Console(true);
		
		BoxWidth(15);
	    
	
		
		LowLevel("Init");
		
        RestartOrder();		
	 
	}]
	
	
	Init[()
	{
		
		
		
		
		PositionToPawn("Camara",0,0,0,false,true);
		PlayerToPosition(0, 0, 0);	
		tecla = self.key_pressed;
	    debug(tecla);
	
		AnimationSpeed(1.5);
		AnimateHold(IDLE);        		
		 
		

		
		// Teclas movimiento.
		if (( tecla = tecla_W))
		{
		
			
			if ( IsKeyDown(tecla_DR)=false)
			{			
				self.ideal_yaw = Camara.current_yaw;
				ChangeYaw();	
			}
		
			
			
		}
	
		if ( tecla = tecla_S )
		{
			
			if ( IsKeyDown(tecla_DR)=false)
			{
				self.ideal_yaw = Camara.current_yaw-ConvertDegrees(180);
				ChangeYaw();
			}
			
		}	
			
	
		
		return 0;

		
	}]
	
	



	
}
http://www.iris3dgames.com Reality Factory Spanish :wink:

User avatar
Vertex
Posts: 108
Joined: Fri May 22, 2015 1:01 am
Location: Colombia
Contact:

Re: Script animations Player

Post by Vertex » Thu May 28, 2015 5:32 pm

No achievement animations run .

Please Help .

Code: Select all

{
	Start[ ()
	{
		Console(true);
		debug("Hola Mundo");
		
		AnimationSpeed(1);
		LowLevel("Mensaje");
		
	}]
	
	
	Mensaje[ ()
	{
		debug("Orden de alto nivel");
		debug(Yue.animate_at_end);
		if ( IsKeyDown(Yue.tecla_W)=true)
		{
			self.think = "Test";
			return 0;
		}

		if ( IsKeyDown(Yue.tecla_W)=false)
		{
			self.think = "Test2";
			return 0;
		}
	}]
	
	
	Test[ ()
	{
		if(Yue.animate_at_end=false)
		{
			self.ThinkTime = 0;	
			Yue.Animate("Run");
		}
		
		self.think = "Mensaje";
	}]
	
	Test2[ ()
	{
		self.ThinkTime = 0;
		if(Yue.animate_at_end=false)
		{
			Yue.Animate("Idle");
		}

		self.think = "Mensaje";
	}]
}
If you increase the value self.ThinkTime animations are delayed .
http://www.iris3dgames.com Reality Factory Spanish :wink:

Post Reply