Gamestudio Links
Zorro Links
Newest Posts
Z9 getting Error 058
by jcl. 07/22/26 06:42
ZorroGPT
by TipmyPip. 07/21/26 17:54
New Zorro version 3.11
by jcl. 07/21/26 13:42
Lapsa's very own thread
by Lapsa. 07/18/26 13:40
Purchase A8 full licence version
by ukgamer. 07/17/26 05:52
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (TipmyPip, madpower2000), 1,532 guests, and 18 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Ephraim, Student_64151
19223 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 3 of 5 1 2 3 4 5
Re: Problem with Jump/Fall Code [GER/ENG] [Re: ] #379141
07/29/11 18:29
07/29/11 18:29
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
tried.. now the landing function isn´t called anymore

Works now.. again..
But sometimes the cube stucks in the ground.. and the other time it floats in the air a bit..

Last edited by Espér; 07/29/11 18:42.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Problem with Jump/Fall Code [GER/ENG] [Re: Espér] #379144
07/29/11 19:12
07/29/11 19:12

M
Malice
Unregistered
Malice
Unregistered
M



I've looked over it and can't see the problem. Short of having it on my system so I can test it piece by piece there not much more I can say.

I can only think of these possibilities.
1) your movement is being set somewhere else in the code also. Like a gravity function you haven't turned off.
2) your land function is being called more then once.
3) your not ignoring the me entity in the trace for floor distance IGNORE_ME, (but that might be why you use ignore_flags2)

Re: Problem with Jump/Fall Code [GER/ENG] [Re: ] #379145
07/29/11 19:17
07/29/11 19:17
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
current code:
Click to reveal..
Code:
void landing(ENTITY* obj)
{
	obj.fallspeed = obj.fallspeedold;
	
	obj.roofdist = c_trace(obj.x, vector(obj.x, obj.y, obj.z-9000), IGNORE_ME | IGNORE_ME | IGNORE_PASSABLE | IGNORE_FLAG2 | USE_POLYGON);
	while(obj.roofdist > (obj.objekthoehe))
	{
		obj.roofdist = c_trace(obj.x, vector(obj.x, obj.y, obj.z-9000), IGNORE_ME | IGNORE_PASSABLE | IGNORE_FLAG2 | USE_POLYGON);
		c_move(obj, vector(0, 0, -(1*(bulleter/100))*time_step), nullvector, GLIDE | IGNORE_PASSABLE | USE_POLYGON);
		wait(1);
	}
	//obj.z += obj.objekthoehe/2;
	obj.in_jump = 0;
}




void fallgo(ENTITY* obj)
{
	obj.roofdist = c_trace(obj.x, vector(obj.x, obj.y, obj.z-9000), IGNORE_ME | IGNORE_PASSABLE | IGNORE_FLAG2 | USE_POLYGON);
	if(obj.roofdist > (obj.objekthoehe))
	{
		c_move(obj, vector(0, 0, -(obj.fallspeed*(bulleter/100))*time_step), nullvector, IGNORE_FLAG2 | IGNORE_PASSABLE | USE_POLYGON | IGNORE_YOU | GLIDE);
		obj.fallspeed += (obj.gewicht/10.5)*time_step;
		obj.fallspeed = clamp(obj.fallspeed, 0, 100);
	}
	else if(obj.roofdist <= (obj.objekthoehe) && obj.in_jump != 4)
	{
		obj.in_jump = 4;
	}
}




void fallstart(ENTITY* obj)
{
	obj.jumpspeed = obj.jumpspeedold;
	obj.fallspeedold = obj.fallspeed;
	
	obj.roofdist = c_trace(obj.x, vector(obj.x, obj.y, obj.z-9000), IGNORE_ME | IGNORE_PASSABLE | IGNORE_FLAG2 | USE_POLYGON);
	if(obj.roofdist > (obj.objekthoehe) && obj.in_jump != 3)
	{
		c_move(obj, vector(0, 0, -(obj.fallspeed*(bulleter/100))*time_step), nullvector, IGNORE_FLAG2 | IGNORE_PASSABLE | USE_POLYGON | IGNORE_YOU | GLIDE);
		obj.fallspeed += (obj.gewicht/10.5)*time_step;
		obj.jumpkeytrigger = 1;
		obj.in_jump = 3;
	}
}




void jumpgo(ENTITY* obj)
{
	obj.roofdist = c_trace(obj.x, vector(obj.x, obj.y, obj.z+9000), IGNORE_ME | IGNORE_PASSABLE | IGNORE_FLAG2 | USE_POLYGON);
	if(obj.roofdist > (obj.objekthoehe) && obj.jumpspeed > 10)
	{
		c_move(obj, vector(0, 0, (obj.jumpspeed*(bulleter/100))*time_step), nullvector, IGNORE_FLAG2 | IGNORE_PASSABLE | USE_POLYGON | IGNORE_YOU | GLIDE);
		obj.jumpspeed -= (obj.gewicht/10.5)*time_step;
	}
	else if(obj.roofdist < (obj.objekthoehe) && obj.in_jump != 2)
	{
		obj.in_jump = 2;
	}
	else if(obj.jumpspeed <= 10 && obj.in_jump != 2)
	{
		obj.in_jump = 2;
	}
	else
	{
		obj.in_jump = 2;
	}
}




void jumpstart(ENTITY* obj)
{
	obj.roofdist = c_trace(obj.x, vector(obj.x, obj.y, obj.z+9000), IGNORE_ME | IGNORE_PASSABLE | IGNORE_FLAG2 | USE_POLYGON);
	if(obj.roofdist > (obj.objekthoehe) && obj.in_jump != 1)
	{
		obj.jumpspeedold = obj.jumpspeed;
		c_move(obj, vector(0, 0, (obj.jumpspeed*(bulleter/100))*time_step), nullvector, IGNORE_FLAG2 | IGNORE_PASSABLE | USE_POLYGON | IGNORE_YOU | GLIDE);
		obj.in_jump = 1;
	}
}


//================================================================================================================================================
//================================================================================================================================================
//================================================================================================================================================

void jump_event(ENTITY* obj, var frames, VECTOR* direct, var fall)
{
	obj.roofdist = c_trace(obj.x, vector(obj.x, obj.y, obj.z+9000), IGNORE_ME | IGNORE_PASSABLE | IGNORE_FLAG2 | USE_POLYGON);
	if(obj.roofdist > obj.objekthoehe/2)
	{
		obj.jumpspeedold = obj.jumpspeed;
		c_move(obj, vector(0, 0, (obj.jumpspeed*(bulleter/100))*time_step), nullvector, IGNORE_FLAG2 | IGNORE_PASSABLE | USE_POLYGON | IGNORE_YOU | GLIDE);
		obj.in_jump = 1;
	}
	while(frames > 0 && obj.in_jump == 1)
	{
		jumpgo(obj);
		c_move(obj, vector((direct.x*(bulleter/100))*time_step, 0, 0), nullvector, GLIDE | IGNORE_PASSABLE | IGNORE_FLAG2);
		
		frames -= 1;
		wait(1);
	}
	
	obj.roofdistframe = c_trace(obj.x, vector(obj.x, obj.y, obj.z-9000), IGNORE_ME | IGNORE_PASSABLE | IGNORE_FLAG2 | USE_POLYGON);
	if(obj.roofdistframe > obj.objekthoehe/2)
	{obj.in_jump = 2;}
	
	if(fall == true)
	{
		while(obj.in_jump != 0 && obj.in_jump != 1)
		{
			if(obj.in_jump == 2)
			{fallstart(obj);}
			else if(obj.in_jump == 3)
			{fallgo(obj);}
			else if(obj.in_jump == 4)
			{landing(obj);}
			
			c_move(obj, vector((direct.y*(bulleter/100))*time_step, 0, 0), nullvector, GLIDE | IGNORE_PASSABLE | IGNORE_FLAG2);
			wait(1);
		}
	}
	
	c_move(obj, vector((direct.z*(bulleter/100))*time_step, 0, 0), nullvector, GLIDE | IGNORE_PASSABLE | IGNORE_FLAG2);
}




void jump_player(ENTITY* obj)
{
	if(key_space == 1 && obj.jumpkeytrigger == 0)
	{
		if(obj.in_jump <= 0)
		{jumpstart(obj);}
		else if(obj.in_jump == 1)
		{jumpgo(obj);}
	}
	else if(key_space == 0 && obj.in_jump == 1)
	{obj.in_jump = 2;}
	else if(key_space == 0 && obj.jumpkeytrigger == 1)
	{obj.jumpkeytrigger = 0;}
	
	
	obj.roofdistframe = c_trace(obj.x, vector(obj.x, obj.y, obj.z-9000), IGNORE_ME | IGNORE_PASSABLE | IGNORE_FLAG2 | USE_POLYGON);
	if(obj.in_jump == 2)
	{fallstart(obj);}
	else if(obj.in_jump == 3)
	{fallgo(obj);}
	else if(obj.in_jump == 4)
	{landing(obj);}
	else if(obj.roofdistframe > (obj.objekthoehe) && obj.in_jump != 2 && obj.in_jump != 1)
	{obj.in_jump = 2;}
}



Last edited by Espér; 07/29/11 19:18.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Problem with Jump/Fall Code [GER/ENG] [Re: Espér] #379151
07/29/11 19:33
07/29/11 19:33

M
Malice
Unregistered
Malice
Unregistered
M



I'm trying to test your code but got an unknown error for "bulleter" what is it and what should I replace it with?

unknown also gewichtung;

Last edited by Malice; 07/29/11 19:36.
Re: Problem with Jump/Fall Code [GER/ENG] [Re: ] #379153
07/29/11 19:36
07/29/11 19:36
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
var bulleter = 100;

this is a variable, wich slows down EVERYTHING, wehn you decrease it.
Bullet Time.


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Problem with Jump/Fall Code [GER/ENG] [Re: Espér] #379154
07/29/11 19:37
07/29/11 19:37

M
Malice
Unregistered
Malice
Unregistered
M



and "gewichtung"

Re: Problem with Jump/Fall Code [GER/ENG] [Re: ] #379155
07/29/11 19:40
07/29/11 19:40
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
gewichtung is the weight of an object in kilos.

f.e.

viewdummy = obj_create(NULL, vector(0,0,-40), nullvector, 80, NULL);

create a CUBE_MDL Object at given position with nullvector as rotation, a weight of 80kg and default jumpspeed (50)

viewdummy = obj_create(NULL, vector(0,0,-40), nullvector, 80, 70);

Same, but sets jumpspeed to 70.


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Problem with Jump/Fall Code [GER/ENG] [Re: Espér] #379158
07/29/11 20:05
07/29/11 20:05

M
Malice
Unregistered
Malice
Unregistered
M



Sorry I'm not going to be any help...! I can't even get this code to make the model jump. And I don't know why. Short of getting a clear idea of what you want ant then rewriting it myself I can't help. Sorry but I tried.

Re: Problem with Jump/Fall Code [GER/ENG] [Re: ] #379160
07/29/11 20:07
07/29/11 20:07
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline OP
Expert
Espér  Offline OP
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
i can upload the project for you xD


A&D Jump Copy: >> click me <<

Last edited by Espér; 07/29/11 20:14.

Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Problem with Jump/Fall Code [GER/ENG] [Re: Espér] #379161
07/29/11 20:24
07/29/11 20:24

M
Malice
Unregistered
Malice
Unregistered
M



I tested your code. and this is whats happening. The land function is entered very late and the while loop in that function is never executed. I'll look to see if I can track it back to the source.

I can't get it to work. The problem I think is in "fallgo" the trace seems not to detect the level and you fall through it. Or gets switch to land late. It's like it's tracing through the ground. I tried replacing the level with a wmb and the level load command, but like with my attempts before it doesn't jump any more once I do that. I'm not sure what the problem is, could it be c_trace???

Last edited by Malice; 07/29/11 21:35.
Page 3 of 5 1 2 3 4 5

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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