Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (AndrewAMD, Ayumi, NewbieZorro), 14,141 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Script issue [Re: Tman] #309705
02/10/10 19:34
02/10/10 19:34
Joined: Oct 2009
Posts: 60
T
Tman Offline OP
Junior Member
Tman  Offline OP
Junior Member
T

Joined: Oct 2009
Posts: 60
I have progressed my script by alot I just need some help with a jump and the gravity on it here is the script take a look at it and tell me how I could add the jump.
Code:
//default state
		if(my.STATE == 0)
		{
				//rotate player with the left and right keys
			my.pan += (key_cul-key_cur)*5* time_step;
			my.ANIMATION += 2 *time_step;
		   ent_animate(me,"idleSWA",my.ANIMATION,ANM_CYCLE);
			
		}
		//the run state without the sword in hand
		if(my.STATE ==1)
		{
			//rotate player with the left and right keys
			my.pan += (key_cul-key_cur)*5* time_step;

			//move the entity forward
			var distance = 25 *time_step;
			c_move(me,vector(distance,0,0),NULL,GLIDE);
			
			ent_blend("runWS",25,45);
			//animate the player
			my.ANIMATION += 15 * time_step;
			ent_animate(me,"runWS",my.ANIMATION,ANM_CYCLE);
			
			// adjust entity to the ground height, using a downwards trace
			c_trace(my.x,vector(my.x,my.y,my.z-1000),IGNORE_ME | IGNORE_PASSABLE);
			my.z = hit.z - vFeet.z; // always place player's feet on the ground
					
		}
		//pressing the move key to make him run with out the sword
		//changing his state
		if((key_cuu == 1)&& my.STATE == 0)
		{
			my.ANIMATION = 0;
			my.STATE = 1;
		}
		else if((!key_cuu)&& my.STATE == 1)
		{
			my.ANIMATION = 0;
			my.STATE = 0;
		}

	  //take the sword out and put it in the hand.
		if(my.STATE ==2)
		{
			my.ANIMATION += 5 *time_step;
			ent_animate(me,"takeSWO",my.ANIMATION,0);
			//blend the state from taking out the sword 
			//to the idle.
			if(my.ANIMATION > 100)
			{
			ent_blend(my.STATE = 4,0,50);
			}
				
		}
		//run with the sword in his hand
		if(my.STATE == 3)
		{
         //rotate player with the left and right keys
			my.pan += (key_cul-key_cur)*5* time_step;

			//move the entity forward
			var distance = 25 *time_step;
			c_move(me,vector(distance,0,0),NULL,GLIDE);
			
			ent_blend("run",25,45);
			//animate the player
			my.ANIMATION += 15 * time_step;
			ent_animate(me,"run",my.ANIMATION,ANM_CYCLE);
			
			// adjust entity to the ground height, using a downwards trace
			c_trace(my.x,vector(my.x,my.y,my.z-1000),IGNORE_ME | IGNORE_PASSABLE);
			my.z = hit.z - vFeet.z; // always place player's feet on the ground
			
		
		}
		//idle with the sword in hand
		if(my.STATE == 4)
		{
		 //rotate player with the left and right keys
			my.pan += (key_cul-key_cur)*5* time_step;
			my.ANIMATION += 2 *time_step;
		  ent_animate(me,"idleSWI",my.ANIMATION,ANM_CYCLE);
			
		}
		//putting the sword away
		if(my.STATE == 5)
		{
			my.ANIMATION += 5 * time_step;
			ent_animate(me,"putSWA",my.ANIMATION,NULL);
			if(my.ANIMATION > 100)
			{
			 ent_blend(my.STATE = 0,0,50);
			}
			
		}
			//the attack state
		if(my.STATE == 6)
		{
			my.ANIMATION += 4 * time_step;
			ent_animate(me,"attack",my.ANIMATION,NULL);
		}
		//press the key to change states
		//take out the sword if you are in the idle state
		//with the sword in sheath	
		if((key_t == 1)&& my.STATE == 0)
		{
			my.ANIMATION = 1;
			my.STATE = 2;		
		}
		
		//after changing states if you are trying to
		//move with the sword in hand
		if((key_cuu==1)&& my.STATE == 2)
		{
			my.ANIMATION = 1;
			my.STATE = 3;
		}
		//if you have stopped moving
		//play the idle with the sword in the hand 
		else if((key_cuu == 0)&& my.STATE == 3)
		{
			my.ANIMATION = 1;
			my.STATE = 4;
		}
		//run with the sword in hand
		if((my.STATE == 4) && key_cuu == 1)
		{
			my.ANIMATION = 1;
			my.STATE = 3;
		}
		//when your idle is sword in hand 
		//and you want to put it away
		if((key_p == 1) && my.STATE == 4)
		{
			my.ANIMATION = 1;
			my.STATE = 5;
			
		}
		//now you have put the sword away
		//go back to original state and start over again
		if((my.STATE == 5) && key_cuu == 1)
		{
			my.ANIMATION = 1;
			my.STATE = 1;
		}



If anyone knows how to make him jump let me know.
Thanks.

Last edited by Tman; 02/10/10 19:34.
Re: Script issue [Re: Tman] #309896
02/11/10 20:21
02/11/10 20:21
Joined: Oct 2009
Posts: 60
T
Tman Offline OP
Junior Member
Tman  Offline OP
Junior Member
T

Joined: Oct 2009
Posts: 60
So no one could help with this huh? Well if anyone is good at this engine please let me know something.




Thanks.

Page 2 of 2 1 2

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1