Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
0 registered members (), 631 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Gravity with jumping #310532
02/15/10 10:24
02/15/10 10:24
Joined: May 2009
Posts: 5,367
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,367
Caucasus
I've done a very simple gravity and jump code. But too bugy, flyes away some times... or jumping as a ball, without stoping tongue I need some help with it.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Gravity with jumping [Re: 3run] #310570
02/15/10 17:10
02/15/10 17:10
Joined: Feb 2010
Posts: 886
Random Offline
User
Random  Offline
User

Joined: Feb 2010
Posts: 886
Can I see it? Or how did you made it, c-move? When yes use c-trace.



Re: Gravity with jumping [Re: Random] #310596
02/15/10 20:31
02/15/10 20:31
Joined: May 2009
Posts: 5,367
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,367
Caucasus
I used c_trace to trace under players feet, to get distanse to ground. And used c_move to move him down in z coordinates. But model is not attached to ground when he is moving down on stairs and slopes, he shakes etc.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Gravity with jumping [Re: 3run] #311439
02/19/10 19:29
02/19/10 19:29
Joined: May 2009
Posts: 5,367
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,367
Caucasus
Can some one please help?!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Gravity with jumping [Re: 3run] #311546
02/20/10 14:32
02/20/10 14:32
Joined: Feb 2010
Posts: 457
Norfolk,England
mikaldinho Offline
Senior Member
mikaldinho  Offline
Senior Member

Joined: Feb 2010
Posts: 457
Norfolk,England
if you posta copy of it on here then we can help!

Re: Gravity with jumping [Re: mikaldinho] #311567
02/20/10 17:04
02/20/10 17:04
Joined: May 2009
Posts: 5,367
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,367
Caucasus
Code:
var my_height;
var jump_height = 55;
var jump_target; 
var gravity = 3;


function my_gravity()
{
my_height = c_trace(my.x,vector(my.x,my.y,my.z-10000),USE_BOX|IGNORE_PASSABLE|IGNORE_ME);

   if(my_height > 5)
   {
   	accelerate(player_movement.z,-gravity*time_step,0.1); 
   }    
   else
   {
   	player_movement.z=-(my_height/1.2)+2;
   	if((my_height + player_movement.z) > 5){player_movement.z = - my_height - 5;}
   	if(key_space == 1){jump_target = jump_height;} 
   } 
   if(jump_target > 5)
   {
   	player_movement.z = ( sqrt((jump_target)*gravity) ) * time_step;
   	jump_target -= player_movement.z;
   	
   }
}



Script was made by help of my friend.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Gravity with jumping [Re: 3run] #311589
02/20/10 19:29
02/20/10 19:29
Joined: Feb 2010
Posts: 457
Norfolk,England
mikaldinho Offline
Senior Member
mikaldinho  Offline
Senior Member

Joined: Feb 2010
Posts: 457
Norfolk,England
do you think that lowering the jump height could stop the character flying away?

Re: Gravity with jumping [Re: mikaldinho] #311591
02/20/10 19:47
02/20/10 19:47
Joined: May 2009
Posts: 5,367
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,367
Caucasus
Nope... Can you please make little changes, so he woun't fly away, and will stop jumping as a ball?


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Gravity with jumping [Re: 3run] #311647
02/21/10 10:22
02/21/10 10:22
Joined: May 2009
Posts: 5,367
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,367
Caucasus
Will some one handle this? frown


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Gravity with jumping [Re: 3run] #311653
02/21/10 10:50
02/21/10 10:50
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
try this one:
Code:
function player_jump()
{
	on_space = NULL;
	var force = 10;		//The jumping hight
	while(force > 0)
	{
		player.z += force * time_step;
		force -= 1*time_step;
		wait(1);
	}
	if(key_space)
		player_jump();
	on_space = player_jump;
}

action player_walk()
{
	player = me;
	on_space = player_jump;
	c_setminmax(me);
	while(me)
	{
		//Generate Gravity
		c_move(me,nullvector,vector(0,0,-5*time_step),IGNORE_PASSABLE | USE_BOX);
		
		c_move(me,vector((7 + 5*key_shift)*(key_w-key_s)*time_step,(5 + 3*key_shift)*(key_a-key_d)*time_step,0),nullvector,GLIDE | IGNORE_PASSABLE);
		//Wait one Frame
		wait(1);
	}
}



its very simple, but it works

Last edited by Richi007; 02/21/10 10:52.

Visit my site: www.masterq32.de
Page 1 of 2 1 2

Moderated by  HeelX, Tobias_Runde 

Gamestudio download | chip programmers | 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