Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/19/24 18:45
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
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, kzhao, 7th_zorro), 714 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Correct jumping code : #416068
01/27/13 19:29
01/27/13 19:29
Joined: Apr 2008
Posts: 2,488
ratchet Offline OP
Expert
ratchet  Offline OP
Expert

Joined: Apr 2008
Posts: 2,488
I have a third view camera and player working.
But what i need now is the C_trace part containing some jumping code.
I've copy and past AUM 97 code from the FPS template, but the code is buggy.
I had the player jump to infinity or somtimes do incredible little jumps.

So if someone would have a bit of jumping code that works perfectly i would find that great laugh

Re: Correct jumping code : [Re: ratchet] #416076
01/27/13 21:36
01/27/13 21:36
Joined: Apr 2008
Posts: 2,488
ratchet Offline OP
Expert
ratchet  Offline OP
Expert

Joined: Apr 2008
Posts: 2,488
I found it AUM56 : Ninja Code.
It's a WDL code frown
And it contains so much stuff i don't need in the code ...
I'll have to adapt it.

Argrgrgrhrhrh !!

Last edited by ratchet; 01/27/13 21:52.
Re: Correct jumping code : [Re: ratchet] #416077
01/27/13 21:40
01/27/13 21:40
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
I could give you some tips to make it work, if you need an advices. Can't provide a code, cause I'm too busy this days..


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Correct jumping code : [Re: 3run] #416080
01/27/13 21:53
01/27/13 21:53
Joined: Apr 2008
Posts: 2,488
ratchet Offline OP
Expert
ratchet  Offline OP
Expert

Joined: Apr 2008
Posts: 2,488
I made it in 5 minutes with another 3D engine :

3DGS is not for non programmers, but searching on AUM i think i should get the right code !

Last edited by ratchet; 01/27/13 22:19.
Re: Correct jumping code : [Re: ratchet] #416084
01/27/13 22:27
01/27/13 22:27
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
I could create a very simple movement script just with some minimal stuff, but you'll still have to do adjustments and implement the features that you need.


POTATO-MAN saves the day! - Random
Re: Correct jumping code : [Re: Kartoffel] #416086
01/27/13 23:24
01/27/13 23:24
Joined: Apr 2008
Posts: 2,488
ratchet Offline OP
Expert
ratchet  Offline OP
Expert

Joined: Apr 2008
Posts: 2,488
Thanks, but you have already made so much wonderfull stuff for us, i'll have to search myself or ask someone else laugh

Re: Correct jumping code : [Re: ratchet] #416087
01/27/13 23:46
01/27/13 23:46
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
Here you go!
Save it to a file, include it and adjust the values, tps_controller is your action
WASD + Shift + Space are the controls, mouse to rotate

Code:
var mouse_speed = 4;
var walking_speed = 6;
var running_speed = 10;
var gravity_force = 2;
var jump_strength = 10;
var feet_height = 40;
var anim_walk_speed = 5;
var anim_stand_speed = 5;

action tps_controller()
{
	wait(1);
	c_updatehull(me, 1);
	var gravity = 0;
	var lks = 0;
	while(me)
	{
		my.pan += mouse_speed * mouse_force.x;
		
		VECTOR mov;
		mov.x = key_w - key_s;
		mov.y = key_a - key_d;
		mov.z = 0;
		if(key_shift)
			vec_normalize(mov, running_speed * time_step);
		else
			vec_normalize(mov, walking_speed * time_step);
	
		if(vec_length(mov) > 0)
		{
			ent_animate(me, "walk", total_ticks * anim_walk_speed, ANM_CYCLE);	// Adopt animation speed and name
		}
		else
		{
			ent_animate(me, "stand", total_ticks * anim_stand_speed, ANM_CYCLE);	// Adopt animation speed and name
		}
	
		if(key_space != lks)
		{
			if(key_space)
				gravity = jump_strength;
			lks = key_space;
		}
		gravity -= gravity_force * time_step;
		move_friction = 0;
		c_move(me, mov, vector(0, 0, gravity * time_step), GLIDE | IGNORE_PASSABLE | IGNORE_PASSENTS);
		if(c_trace(my.x, vector(my.x, my.y, my.z - feet_height), IGNORE_ME | IGNORE_PASSABLE | IGNORE_PASSENTS | USE_POLYGON))
		{
			my.z = target.z + feet_height;
			gravity = 0;
		}
		
		vec_set(camera.x, vector(-150, 0, 50));		// Camera offset
		vec_rotate(camera.x, my.pan);
		vec_add(camera.x, my.x);
		camera.pan = my.pan;
		camera.tilt = -15;							// Adjust this
		wait(1);
	}
}



Visit my site: www.masterq32.de
Re: Correct jumping code : [Re: MasterQ32] #416136
01/28/13 08:38
01/28/13 08:38
Joined: Apr 2008
Posts: 2,488
ratchet Offline OP
Expert
ratchet  Offline OP
Expert

Joined: Apr 2008
Posts: 2,488
thanks a lot laugh
It seems to be another new version of code i didn't seen.
I'll try that.

Re: Correct jumping code : [Re: ratchet] #416151
01/28/13 12:02
01/28/13 12:02
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
it was just some fun coding ~20 minutes or so grin


Visit my site: www.masterq32.de

Moderated by  HeelX, rvL_eXile 

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