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
1 registered members (TipmyPip), 18,466 guests, and 6 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 1 of 2 1 2
A new way of movement #256926
03/19/09 15:24
03/19/09 15:24
Joined: Mar 2007
Posts: 34
Osasco
xandeck Offline OP
Newbie
xandeck  Offline OP
Newbie

Joined: Mar 2007
Posts: 34
Osasco
Hello all and George,

Please, I made all my moves based on your movements codes from AUM (I took some of them and mixed).

My character can walk, run, attack (sword base), jump, get hit and die.

But I have 2 problems: I created a map where there are some puzzles where player needs to solve. There is a platform (a small block) where it keeps rotating into it pan angle.
If I try to jump from where my player is to the platform (with a hugh hole in my front) my player just go down fast. To temporary solve, I decreased the time of fall during jump.
To understand better, check this screenshot:


So, first question smile :
How can I make a good jump script that I can really jump from one place to other with a hole in front?

Second problem: when my character is above the platform (and the platorm keeps rotating), my character does not rotate with it.
See the screenshot:


For both problems I tried a few scripts, but so far I could not solve. I will keep trying, but a help would be good. smile

I made a search and found nothing about this.

Thanks


XandeCK
Lead Developer
JogadorVIP.com
Re: A new way of movement [Re: xandeck] #257032
03/20/09 07:20
03/20/09 07:20
Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
You've got a nice game concept there smile
1) Do a c_trace instruction below the player (the usual way) but don't set it z according to the result; simply decreases with (let's say) -2 * time_step each frame if there's a distance between its feet and the ground.
2) Use c_trace to detect the texture below player's feet. If its name is "my_rotating_thing" (or so) move it together with the rotating thing. I've got a "walk over moving train" snippet in one of the recent magazines' faq - it might help you.

Re: A new way of movement [Re: George] #257085
03/20/09 12:51
03/20/09 12:51
Joined: Mar 2007
Posts: 34
Osasco
xandeck Offline OP
Newbie
xandeck  Offline OP
Newbie

Joined: Mar 2007
Posts: 34
Osasco
Hey George,
I will keep improving the game level and the design wink

I made some tests, but no good result yet. Here is part of my player script:

FIRST PROBLEM smile

Code:

vec_set(temp.x, my.x);
temp.z -= 5000 * time_step;
ground_distance = c_trace(my.x, temp.x, IGNORE_PASSABLE | IGNORE_SPRITES | SCAN_TEXTURE);
if (hit.texname == "ROCK_03.bmp"){
	set (mypanel, VISIBLE);
} else {
	reset (mypanel, VISIBLE);
}
// JUMPING
if (key_space && jump_key == 0) {
	jump_height = minv(120, jump_height + 12 * time_step);
	if (jump_height == 120){
		jump_height = maxv(120, jump_height - 10 * time_step);
		jump_key = 1;
	}
} else {
	jump_height = maxv(0, jump_height - 10 * time_step);
	if (jump_height == 0 && !key_space){
		jump_key = 0;
	}
}
if (jump_animation < 99 && jump_height > 0){
	jump_animation += 4 * time_step;
	ent_animate(my, "jump", jump_animation, ANM_CYCLE);
} else {
	jump_animation = 0;
}
// NORMAL MOVES
if ((key_w + key_s) && key_shiftl) { //RUNNING
	movement_speed.x = 20 * (key_w - key_s) * time_step;
	movement_speed.y = 0;
	if (jump_height < 1){
		anim_percent += 11 * time_step;
		ent_animate(my, "run", anim_percent, ANM_CYCLE);
		if (step_sound < 1) {
			ent_playsound (my, wav_passo_mato, 300);
			step_sound = 55;
		}
		else {
			step_sound -= 3;
		}	
	}
} else {
	if ((key_w + key_s) || (key_a + key_d)) { //WALKING FRON, BACK, SIDES
		movement_speed.x = 3 * (key_w - key_s) * time_step;
		movement_speed.y = 3 * (key_a - key_d) * time_step;
		if (jump_height < 1) {
			anim_percent += 6.5 * time_step;
			ent_animate(my, "walk", anim_percent, ANM_CYCLE);
			if (step_sound < 1) {
				ent_playsound (my, wav_passo_mato, 300);
				step_sound = 60;
			}
			else {
				step_sound -= 2;
			}	
		}
	} else { //STAND
		movement_speed.x = 0;
		movement_speed.y = 0;
		if (jump_height < 1) {
			anim_percent += 2 * time_step;
			ent_animate(my, "stand", anim_percent, ANM_CYCLE);	
		}
	}
}
movement_speed.z = -(ground_distance - 28) + jump_height;
movement_speed.z = maxv(-25 * time_step, movement_speed.z);
c_move (my, movement_speed.x, nullvector, IGNORE_PASSABLE | GLIDE);


I tried editing the first temp.z -=5000, but no succeed. I also tried to change the movement_speed.z... I think this is the problem, in this part of script... but I cant figure out how change... If my player start to jump from beginning of mountain, his jump height will not be too much high, so he starts to fall sudenly. If the jump height is at max, then I can move the jump to forward and then its good (sorry my english).

SECOND PROBLEM smile

I try to use the SCAN_TEXTURE now, buuutt... as you can see in the code above, I did that commands, but it returns an error saying that "Syntax error: CANT CONVERT EQ:POINT:ARRAY:LONG"... what I did wrong? If I let this line "if (hit.texname == "ROCK_03.bmp")" to this "if (hit.texname = "ROCK_03.bmp")" the script runs, but mypanel is always visible, so it is not working as expected.

Thanks again wink

Last edited by xandeck; 03/20/09 12:55.

XandeCK
Lead Developer
JogadorVIP.com
Re: A new way of movement [Re: xandeck] #257170
03/21/09 03:33
03/21/09 03:33
Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
temp.z should be set to a fixed value (use something like 5000 or 10,000 but don't multiply it with time_step). Also, I see that you have 2 lines of code that set movement_speed.z at the bottom; one of them has to go.
Try to use "if ((str_cmpi ("ROCK_03.bmp", hit.texname))" (without the quotes) to compare the texture name. I didn't test it, but it could solve your problem.

Re: A new way of movement [Re: George] #257442
03/23/09 11:39
03/23/09 11:39
Joined: Mar 2007
Posts: 34
Osasco
xandeck Offline OP
Newbie
xandeck  Offline OP
Newbie

Joined: Mar 2007
Posts: 34
Osasco
I will try this week George, thank you.


XandeCK
Lead Developer
JogadorVIP.com
Re: A new way of movement [Re: xandeck] #257788
03/25/09 14:38
03/25/09 14:38
Joined: Mar 2007
Posts: 34
Osasco
xandeck Offline OP
Newbie
xandeck  Offline OP
Newbie

Joined: Mar 2007
Posts: 34
Osasco
Hello again George,

ok, I did lots of tests, none were good use. I'm almost changing my hole move script smile

I cant manage to create a good jump script. If the ground below the player doesnt change at all (about height), the jump works good. But if I try to jump from one mountain to other (with a hole in the middle) the player just go down suddenly (he does not reach all the jump height). I noticed that the problem is with the commands where it computes the distance of the player to the ground, because even if I jump above a rock, my player suddenly raises his jump height. Its like: my player is in pos.z = 50 when I jump my player raises to a height pos.z + 110, resulting in 160 of height. If I jump a rock (lets say it has 30 height), it computes the rock heights with the player height, so it becomes 190 instead of 160.

Is that possible for you to help me create a good jump script that really works. If you dont know what I mean, create a simple level (just a place where player can walk) and put something that player need to jump and try to jump above and to next side of it. You will see that the player suddenly raises its height jump.

I will try to change my jump scrit, but so far tests were no good.

Thanks in advance.

EDIT: look the image below to try understand better what I say




Last edited by xandeck; 03/25/09 14:46.

XandeCK
Lead Developer
JogadorVIP.com
Re: A new way of movement [Re: xandeck] #257831
03/25/09 19:36
03/25/09 19:36
Joined: Mar 2007
Posts: 34
Osasco
xandeck Offline OP
Newbie
xandeck  Offline OP
Newbie

Joined: Mar 2007
Posts: 34
Osasco
Ok, here I am again, this time, I think I got a solution (at last). smile

I changed my script of jumping and I put "IGNORE_MAPS" to it will ignore my map entities that I use to rotate and then the player does not go up suddenly.

And I make some changes to make the jump smoothly (the player raises his height and velocity X+5 and when it is reaching the max height, X*-1*time_step, something like that).


XandeCK
Lead Developer
JogadorVIP.com
Re: A new way of movement [Re: xandeck] #257877
03/26/09 07:47
03/26/09 07:47
Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
Ignoring the maps sound like a good idea (for your game).

Re: A new way of movement [Re: George] #258832
04/02/09 11:39
04/02/09 11:39
Joined: Mar 2007
Posts: 34
Osasco
xandeck Offline OP
Newbie
xandeck  Offline OP
Newbie

Joined: Mar 2007
Posts: 34
Osasco
Hey George, just answering what you said above... that command with str_cmpi did not work, it crashs my application in a function that I did... and I dont have a clue why smile

I'm trying another ways around.


XandeCK
Lead Developer
JogadorVIP.com
Re: A new way of movement [Re: xandeck] #258836
04/02/09 12:03
04/02/09 12:03
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
try if((str_cmpi(_str("ROCK_03.bmp"), hit.texname)) instead.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Page 1 of 2 1 2

Moderated by  George 

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