Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,459 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
jumping problem #397891
03/24/12 19:46
03/24/12 19:46
Joined: Dec 2008
Posts: 83
Buenos Aires, Argentina
F
Funeral Offline OP
Junior Member
Funeral  Offline OP
Junior Member
F

Joined: Dec 2008
Posts: 83
Buenos Aires, Argentina
vec_set(temp.x, my.x);
temp.z -= 10000;
floor = c_trace(my.x, temp.x, IGNORE_ME | IGNORE_PASSABLE | USE_BOX | GLIDE); // compute the distance between player's origin and the floor below its feet


if(key_space && floor < 30 && jump == 0 && J == 0)
{
jump = 1;
}
if(jump == 1)
{

c_move(me,vector(0, 0, 20*time_step), nullvector, GLIDE);
J = 1;
}
if(floor > 30)
{
jump = 2;
}
if(floor < 30 && !key_space)
{
jump = 0;
J = 0;
}

i've wrote this code for jumping but i found a problem: when i jump on a plataform and the player is in th air, there seem to be a tracing problem because when there's an obstacle beneath the player the tracing sets to 0 and it keep increasing altitude.

Re: jumping problem [Re: Funeral] #397892
03/24/12 19:55
03/24/12 19:55
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
ah, you need a floor on z < 10000. Otherwise the c_trace cant find a reason to push ur player to the ground. With reason I mean anything the trace could hit.

Re: jumping problem [Re: Ch40zzC0d3r] #397894
03/24/12 20:24
03/24/12 20:24
Joined: Dec 2008
Posts: 83
Buenos Aires, Argentina
F
Funeral Offline OP
Junior Member
Funeral  Offline OP
Junior Member
F

Joined: Dec 2008
Posts: 83
Buenos Aires, Argentina
oh, i dont know where should i put that z < 10000 on my code help please?

Re: jumping problem [Re: Funeral] #397896
03/24/12 20:29
03/24/12 20:29
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Ah man, you need a floor or a ground in your level. The c_trace will not hit anything else if you dont have a ground/floor and you will fly...

Re: jumping problem [Re: Ch40zzC0d3r] #397897
03/24/12 20:32
03/24/12 20:32
Joined: Dec 2008
Posts: 83
Buenos Aires, Argentina
F
Funeral Offline OP
Junior Member
Funeral  Offline OP
Junior Member
F

Joined: Dec 2008
Posts: 83
Buenos Aires, Argentina
but i do have a floor. tee level is a hollow cube with blocks and models as plataforms

Last edited by Funeral; 03/24/12 20:32.
Re: jumping problem [Re: Funeral] #397898
03/24/12 21:45
03/24/12 21:45
Joined: Mar 2012
Posts: 927
cyberspace
W
Wjbender Offline
User
Wjbender  Offline
User
W

Joined: Mar 2012
Posts: 927
cyberspace
Originally Posted By: Funeral
floor = c_trace(my.x, temp.x, IGNORE_ME | IGNORE_PASSABLE | USE_BOX | GLIDE); // compute the distance between player's origin and the floor below its feet


if im correct here glide is not a mode flag for c_trace
each mode flag has a value and your giving a value
that should not be used with c_trace ,it might aswell
have the same value as another mode flag like ignore_world
and then c_trace wont work...(not sure)
if floor<=0 then no polygon's hit!

try: floor = c_trace(my.x, temp.x, IGNORE_ME | IGNORE_PASSABLE | USE_BOX );


Compulsive compiler
Re: jumping problem [Re: Wjbender] #397900
03/24/12 21:52
03/24/12 21:52
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
Germany
Woah didnt see this^^


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

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