Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
M1 Oversampling
by 11honza11. 04/20/24 20:57
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, rki), 395 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Movement code + AutoJumping [Re: tagimbul] #458019
02/13/16 08:16
02/13/16 08:16
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Hi!

I gave you working example of climbing code, that's all I can help you with. I have to time to support this movement code any farther (and it actually has everything for a basic movement that I wanted to provide), and I don't have any time to work on your project too. Climbing example that I gave you moves player (of cause with his bbox) smoothly, to the top of the edge, not as on your video, where you just play climbing animation, and then set player's position (or something like that). This climbing example was taken and converted into lite-c by me (back in 2013) from from old c-script example called zelda movement code as far as I remember. You just need to implement it into the movement code that you currently have.



Greets


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Movement code + AutoJumping [Re: 3run] #458189
02/24/16 15:55
02/24/16 15:55
Joined: Jun 2010
Posts: 212
tagimbul Offline
Member
tagimbul  Offline
Member

Joined: Jun 2010
Posts: 212
i have it <3
https://youtu.be/KatbVupcbYM

grin
work steps:

1. i have merge the level in the MED to my player model
2. i make a climb animation for one height
3. write in all frames, the position of the master bone and then delete the position of the master bone in all frames and set it to the same position (only XYZ, not pan tilt roll).
4.save the model
5. in the SED in the HeroXYCollision i add this

Code:
VECTOR climb1_bones_pos[11];
	vec_set(climb1_bones_pos[0],vector(0,0,0));
	vec_set(climb1_bones_pos[1],vector(0.75,0,2.875));
	vec_set(climb1_bones_pos[2],vector(5.875,0,7.375));
	vec_set(climb1_bones_pos[3],vector(7.25,0,13.87));
	vec_set(climb1_bones_pos[4],vector(10.25,0,14.37));
	vec_set(climb1_bones_pos[5],vector(10.25,0,13.37));
	vec_set(climb1_bones_pos[6],vector(10.25,0,14));
	vec_set(climb1_bones_pos[7],vector(10.37,0,15.5));
	vec_set(climb1_bones_pos[8],vector(11.35,0,22.55));
	vec_set(climb1_bones_pos[9],vector(12.36,0,31.03));
	vec_set(climb1_bones_pos[10],vector(15.62,0,31.87));
	
	VECTOR climb1_to_pos[10];
	var ci;
	for (ci=0; ci<10; ci++) // repeat 10 times
	{
		vec_diff (climb1_to_pos[ci],climb1_bones_pos[ci],climb1_bones_pos[ci+1]);
	}



6.
in the end of the while loop in the same function i add this
Code:
if(key_q)
		{

			if(climb_percent < 10 &&  climb_percent >= 0)
			climb_frame = 0;
			if(climb_percent < 20 &&  climb_percent >= 10)
			climb_frame = 1;
			if(climb_percent < 30 &&  climb_percent >= 20)
			climb_frame = 2;		
			if(climb_percent < 40 &&  climb_percent >= 30)
			climb_frame = 3;		
			if(climb_percent < 50 &&  climb_percent >= 40)
			climb_frame = 4;		
			if(climb_percent < 60 &&  climb_percent >= 50)
			climb_frame = 5;		
			if(climb_percent < 70 &&  climb_percent >= 60)
			climb_frame = 6;		
			if(climb_percent < 80 &&  climb_percent >= 70)
			climb_frame = 7;
			if(climb_percent < 90 &&  climb_percent >= 80)
			climb_frame = 8;		
			if(climb_percent < 100 && climb_percent >= 90)
			climb_frame = 9;		
			
			
			
			
			
			
			//derzeitige position
			
			
			
			
			//ziel position
			
			if(climb_percent == 0 ||climb_percent == 10 ||climb_percent == 20 ||climb_percent == 30 ||climb_percent == 40 ||climb_percent == 50 ||climb_percent == 60 ||climb_percent == 70 ||climb_percent == 80 ||climb_percent == 90)
			{
				vec_set(hero_temp1, my.x);
				vec_set(hero_temp2, my.x);
				vec_set(climb1_to_pos_temp, climb1_to_pos[climb_frame]);
				vec_add(hero_temp2, 	vec_rotate(climb1_to_pos_temp, my.parent.pan));
				lerp_time = 0;
			}
			
			
			if(lerp_time <= 10)
			vec_lerp(hero_climb,hero_temp1,hero_temp2,-lerp_time*0.1);
			lerp_time+=1;
			if(climb_percent < 100)
			vec_set(my.x,vector(hero_climb.x,hero_climb.y,hero_climb.z+0.32));
			
			//		climb_dist = vec_dist(hero_temp1,hero_temp2);
			
			DEBUG_VAR(lerp_time,80);
			
			//wenn var mode auf 0 ist dann ist die animation linear und geht von 0 bis 100 und alles über 100 bleibt stehen
			ent_animate(my.parent,"climp", climb_percent ,0);
			climb_percent += 1;
			TX_Pvec(hero_climb);
			
		}
		else
		{
			climb_percent = 0;
			
		}


7. and by this line

Code:
my.z = heroEnt.z + Z_BBOX_SIZE - 8;



i change to this
Code:
if(!key_q)
my.z = heroEnt.z + Z_BBOX_SIZE - 8;




later i change key_q to a variable =)

Last edited by tagimbul; 03/21/16 16:42.

meine website mit 3dgs sachen =) //noch nicht ganz umgebaut ^^"
http://flashbreaker.com/home.html
und mein YT channel mit diversen game entwicklungs videos, vor allem shader zeugs
https://www.youtube.com/user/tagimbul/videos
Re: Movement code + AutoJumping [Re: tagimbul] #458567
03/21/16 05:41
03/21/16 05:41
Joined: Jun 2010
Posts: 212
tagimbul Offline
Member
tagimbul  Offline
Member

Joined: Jun 2010
Posts: 212
i have make a path interpolation code vor vec array's =)

Code:
function vec_arr_pfad_interpolation(VECTOR* v_out, VECTOR* v_arr, var v_arr_length,var zeit, var faktor)
{
	var aktives_segement;
	var integer_aktives_segement;
	aktives_segement = (faktor/zeit)*(v_arr_length -1);
	integer_aktives_segement = integer(aktives_segement);
	vec_lerp(v_out, v_arr[integer_aktives_segement],v_arr[integer_aktives_segement+1], fraction(aktives_segement));
}



i have make more animations for climbing
and this code make my player action smarter wink

Last edited by tagimbul; 03/21/16 16:38.

meine website mit 3dgs sachen =) //noch nicht ganz umgebaut ^^"
http://flashbreaker.com/home.html
und mein YT channel mit diversen game entwicklungs videos, vor allem shader zeugs
https://www.youtube.com/user/tagimbul/videos
Re: Movement code + AutoJumping [Re: tagimbul] #458573
03/21/16 10:05
03/21/16 10:05
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Great to hear that you are making a nice progress with this code!
Use code tags next time, that way it will be easier to read your code.
[code]YOUR CODE HERE![*/code] - without *

Best regards


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Movement code + AutoJumping [Re: 3run] #458588
03/21/16 16:39
03/21/16 16:39
Joined: Jun 2010
Posts: 212
tagimbul Offline
Member
tagimbul  Offline
Member

Joined: Jun 2010
Posts: 212
i have edit it =)


meine website mit 3dgs sachen =) //noch nicht ganz umgebaut ^^"
http://flashbreaker.com/home.html
und mein YT channel mit diversen game entwicklungs videos, vor allem shader zeugs
https://www.youtube.com/user/tagimbul/videos
Re: Movement code + AutoJumping [Re: tagimbul] #458589
03/21/16 16:47
03/21/16 16:47
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline OP
Senior Expert
3run  Offline OP
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Now it looks way much better, but you left some other posts on the first page tongue

Best regards!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Movement code + AutoJumping [Re: 3run] #458590
03/21/16 16:53
03/21/16 16:53
Joined: Jun 2010
Posts: 212
tagimbul Offline
Member
tagimbul  Offline
Member

Joined: Jun 2010
Posts: 212
ok i have edit ^^


meine website mit 3dgs sachen =) //noch nicht ganz umgebaut ^^"
http://flashbreaker.com/home.html
und mein YT channel mit diversen game entwicklungs videos, vor allem shader zeugs
https://www.youtube.com/user/tagimbul/videos
Re: Movement code + AutoJumping [Re: tagimbul] #458703
03/25/16 16:57
03/25/16 16:57
Joined: Jun 2010
Posts: 212
tagimbul Offline
Member
tagimbul  Offline
Member

Joined: Jun 2010
Posts: 212
Code:
function vec_arr_pfad_interpolation(VECTOR* v_out, VECTOR* v_arr, var v_arr_length,var zeit, var faktor)
{
	float aktives_segement;
	var integer_aktives_segement;
	aktives_segement = (faktor/zeit)*(v_arr_length -1);
	integer_aktives_segement = integer(aktives_segement);
	vec_lerp(v_out, v_arr[integer_aktives_segement],v_arr[integer_aktives_segement+1], fraction(aktives_segement));
}



its better with a float...
now its possible to use arrays with a size of 1000+
^^
then floats have a deeper decimal place its important for the fraction by big vector arrays

Last edited by tagimbul; 03/25/16 17:05.

meine website mit 3dgs sachen =) //noch nicht ganz umgebaut ^^"
http://flashbreaker.com/home.html
und mein YT channel mit diversen game entwicklungs videos, vor allem shader zeugs
https://www.youtube.com/user/tagimbul/videos
Page 2 of 2 1 2

Moderated by  adoado, checkbutton, mk_1, Perro 

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