Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (ozgur, degenerate_762, 7th_zorro), 1,075 guests, and 0 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
vec_to_angle problems #270345
06/07/09 19:53
06/07/09 19:53
Joined: May 2009
Posts: 12
PurePain Offline OP
Newbie
PurePain  Offline OP
Newbie

Joined: May 2009
Posts: 12
Hey, I have a problem while using vec_to_angle.
I'm trying to make an enemy aim at player all the time, but my code has got few bugs, because when player is changing his x and y position, tilt of enemy's bone is changing and when player changes his z, then pan of enemy's bone is changing, so it's kind inverted. grin


Here's my code:

vec_set(temp,player.x);
vec_sub(temp,my.x);
vec_to_angle(my.skill54,temp);
ent_bonerotate(my,"Bip01 R UpperArm",my.skill54);
if (my.skill54 > 45){my.skill54 = 45;}
ent_bonerotate(my,"Bip01 Head",my.skill54);

Re: vec_to_angle problems [Re: PurePain] #270490
06/08/09 14:03
06/08/09 14:03
Joined: May 2009
Posts: 12
PurePain Offline OP
Newbie
PurePain  Offline OP
Newbie

Joined: May 2009
Posts: 12
Sorry for doublepost, but does really nobody knows how to fix it?

Re: vec_to_angle problems [Re: PurePain] #270494
06/08/09 14:21
06/08/09 14:21
Joined: Jul 2008
Posts: 191
M
MDMDFSS Offline
Member
MDMDFSS  Offline
Member
M

Joined: Jul 2008
Posts: 191
Try it like this:

--------------------------------------------------------------------------------
void setLimit(VECTOR* vec1, VECTOR* vec2) {
}

setLimit(vector(0,1,0), vector(0,0,0));

Re: vec_to_angle problems [Re: MDMDFSS] #270585
06/08/09 21:10
06/08/09 21:10
Joined: May 2009
Posts: 12
PurePain Offline OP
Newbie
PurePain  Offline OP
Newbie

Joined: May 2009
Posts: 12
That's not it frown . Maybe I explained my problem not good enough. It looks like pan and tilt of enemy's bone have replaced their places. When my character jumps, an arm of my enemy doesn't go up, but it goes left, and when my character walks around him, enemy's arm doesn't go left and right to follow him, but it goes up (as it should be when character jumps). I hope that You can understand me better now. Could anybody please help me?

Re: vec_to_angle problems [Re: PurePain] #270802
06/10/09 04:42
06/10/09 04:42
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
vec_set(temp, player.x);
vec_sub(temp, my.x);
vec_to_angle(my.pan, temp);
my.tilt = 0;




this goes in enemys while action
then adjust the bones another way

Last edited by DevoN; 06/10/09 04:44.

A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: vec_to_angle problems [Re: DLively] #270806
06/10/09 05:59
06/10/09 05:59
Joined: May 2009
Posts: 12
PurePain Offline OP
Newbie
PurePain  Offline OP
Newbie

Joined: May 2009
Posts: 12
Thanks for reply man smile You brought me a new idea, how to fully solve this. Now my.skill54 = my.z - player.z; and everything goes well. Thanks


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