Gamestudio Links
Zorro Links
Newest Posts
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
1 registered members (M_D), 1,430 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
3rd person shooter with bone animations #369336
05/03/11 17:19
05/03/11 17:19
Joined: Dec 2010
Posts: 87
R
romin2011 Offline OP
Junior Member
romin2011  Offline OP
Junior Member
R

Joined: Dec 2010
Posts: 87
Hello every one,
It is first time i am making a 3rd person shooter game and first time working with bone animations. It is actually all about learning rather then completing a game. I had no where to start from as there is no tutorials for making 3rd person shooter or game with bone animations.
All i have at hand is a very small workshop on bone animation. I have alot of problem with 3rd person camera.

Here is what i have done so far, I have some problems with this code.
1. I can't bring the player to the side of the view.
2. when i turn the mouse right the player turn to left and vice versa.
3. Other improvements specially in camera if you suggest please.

Thanks Alot

Code:
action my_action()
{
	VECTOR player_distance;
	var pose_speed = 0;
	var walk_speed = 0; // stores robot's walking animation
	var turn_speed = 0;
	var reload_speed = 0;
	ANGLE bone_angle; // a vector that holds the pan, tilt and roll angles
	player=me;
	var cycle=0;
	var key_pressed=0;
	var a =200;
	var b =200;
	while(1)
	{	
		camera.arc = 70;
		camera.clip_near = 0;
		camera.pan = player.pan; 
		camera.tilt=bone_angle.tilt;
		camera.roll=0;
		camera.x=player.x -55 * cos(player.pan);
		camera.y=player.y -55 * sin(player.pan);
		camera.z=player.z+40;
		
		ent_animate(my, NULL, 0, 0); // reset all the animations
		pose_speed += 2 * time_step; // increase walk_speed, "2" sets the animation speed
		ent_animate(my, "wpose", pose_speed, ANM_CYCLE); // animate the model (use "walk")
		bone_angle.pan = (mouse_pos.x - screen_size.x / 2) / 10; // changes pan from -40 to +40 degrees
		bone_angle.tilt = (screen_size.y / 2 - mouse_pos.y) / 10; // changes tilt from -30 to +30 degrees
		bone_angle.roll = 0; // no need to change the roll angle for this bone
		ent_bonereset(my,"Spine");
		ent_bonerotate(my,"Spine", bone_angle); // rotate the bone named "CA4"
		
		if (key_r && key_pressed==0) // reload
		{
			key_pressed=1;
		}
		if(key_pressed)
		{
			ent_animate(my, NULL, 0, 0); // reset all the animations
			reload_speed += 5 * time_step; // then increase turn_speed
			ent_animate(my, "reload", reload_speed, ANM_ADD); // animate the model (use "turn")
			if(reload_speed>=100)
			{
				key_pressed=0;
				reload_speed=0;
			}
		}

		if(key_a||key_d) //Turn
		{
			my.pan+=5*(key_a-key_d)*time_step;
			//			ent_animate(my, NULL, 0, 0); // reset all the animations
			turn_speed += 5 * time_step; // then increase turn_speed
			ent_animate(my, "walk", turn_speed, ANM_ADD); // animate the model (use "turn")
			if(turn_speed>=100){turn_speed=0;}
		}
		
		if(key_w||key_s) //Move
		{
			player_distance.x = (key_w - key_s) * 5 * time_step; 
			player_distance.y = 0;  
			player_distance.z = 0; 
			c_move (my, player_distance, nullvector, GLIDE | IGNORE_PASSABLE);
			
			//			ent_animate(my, NULL, 0, 0); // reset all the animations
			walk_speed += 10 * time_step; // then increase turn_speed
			ent_animate(my, "walk", walk_speed, ANM_ADD); // animate the model (use "turn")
			if(walk_speed>=100){walk_speed=0;}
		}
		
		wait(1);
	}
}



Re: 3rd person shooter with bone animations [Re: romin2011] #369337
05/03/11 17:35
05/03/11 17:35
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
I've already told you, why are you turning player's bones to mouse position?!
You didn't learn workshop, you just copy/posted it in SED!
No one is able to help you, till you'll at least understand 50 % of script!!!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: 3rd person shooter with bone animations [Re: 3run] #369354
05/03/11 18:53
05/03/11 18:53
Joined: Dec 2010
Posts: 87
R
romin2011 Offline OP
Junior Member
romin2011  Offline OP
Junior Member
R

Joined: Dec 2010
Posts: 87
Originally Posted By: 3run
I've already told you, why are you turning player's bones to mouse position?!

are you kidding me? That is why people use bone animations rather then mesh animations to control player's hands with mouse seperate from other animations.

Originally Posted By: 3run
You didn't learn workshop, you just copy/posted it in SED!

Well i already mentioned that i didn't know anything about bones and i learned from a little workshop which is far behind complete and yeah i copy/peaste from the workshop but changed to suite my needs.
Originally Posted By: 3run
No one is able to help you, till you'll at least understand 50 % of script!!!

I am using 3dgs since A5.
Instead of criticising people's request for help posts use ur eforts to offer solutions or atleast let others to offer.

Last edited by romin2011; 05/03/11 18:58.
Re: 3rd person shooter with bone animations [Re: romin2011] #369356
05/03/11 18:59
05/03/11 18:59
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Buahahahaha grin lol, this last post of yours, just shows how nuts you are...
I wonder, why you don't know anything about bones, if you r using GS since A5? grin
BTW, I didn't ask why u r using bone animations, I asked why u turning bones to mouse_pos.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: 3rd person shooter with bone animations [Re: 3run] #369360
05/03/11 19:13
05/03/11 19:13
Joined: Aug 2009
Posts: 1,438
Spain
painkiller Offline
Serious User
painkiller  Offline
Serious User

Joined: Aug 2009
Posts: 1,438
Spain
you have to turn bones with camera.tilt, not with mose_pos


3D Gamestudio A8 Pro
AMD FX 8350 4.00 Ghz
16GB RAM
Gigabyte GeForce GTX 960 4GB
Re: 3rd person shooter with bone animations [Re: painkiller] #369417
05/04/11 08:38
05/04/11 08:38
Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Nidhogg Offline
Serious User
Nidhogg  Offline
Serious User

Joined: Dec 2006
Posts: 1,086
Queensland - Australia
Hey 3run, how bout you tone it down a bit! In the past you have been practicly
demanding help or code.

Besides as Romin2011 stated, This his first time coding bone animations.
So how bout giving him a break just as others did and do with you.

I wont be replying to this as I know you will have an idiotic reply.


Windows XP SP3
Intel Dual Core CPU: E5200 @ 2.5GHz
4.00GB DDR3 Ram
ASUS P5G41T-M LX
PCIE x16 GeForce GTS 450 1Gb
SB Audigy 4
Spyware Doctor with AntiVirus

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