Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Quad, M_D), 1,217 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
How i can make to a entity turn to face player #105483
01/05/07 17:41
01/05/07 17:41
Joined: Jan 2006
Posts: 53
L
LWD Offline OP
Junior Member
LWD  Offline OP
Junior Member
L

Joined: Jan 2006
Posts: 53
Hi!
I am trying to make this, but without success... How i can make to a entity turn to face player?
I“m using A6 Template.
Thanks!

Re: How i can make to a entity turn to face player [Re: LWD] #105484
01/05/07 17:50
01/05/07 17:50
Joined: Nov 2006
Posts: 169
Sachsen-Anhalt, Germany
JackTheRipper Offline
Member
JackTheRipper  Offline
Member

Joined: Nov 2006
Posts: 169
Sachsen-Anhalt, Germany
Hi!

You can put :
Code:
  
vec_set(temp, player.x);
vec_sub(temp, my.x);
vec_to_angle(my.pan, temp);



into your action!
but make sure your player is the player entity!

if the player isent the player put :
Code:
 
entity* player;

action ...
{
...
player = me;
...
}



into the player action!

ok... hope this helps!

-jack

Last edited by JackTheRipper; 01/05/07 17:52.

Cheers
Jack Out!


Bandiera rossa la trionferą
Evviva il socialismo e la libertą.
Re: How i can make to a entity turn to face player [Re: JackTheRipper] #105485
01/05/07 18:14
01/05/07 18:14
Joined: Jan 2006
Posts: 53
L
LWD Offline OP
Junior Member
LWD  Offline OP
Junior Member
L

Joined: Jan 2006
Posts: 53
thanks! This work, but the entity just turn to face player one time, and after he stay at the same position, how i can make to the entity turn to face player all time?
Thanks!

Re: How i can make to a entity turn to face player [Re: LWD] #105486
01/05/07 18:43
01/05/07 18:43
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline

Expert
aztec  Offline

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
put it in a while loop


Visit:
schwenkschuster-design.de
Re: How i can make to a entity turn to face player [Re: aztec] #105487
01/05/07 18:45
01/05/07 18:45
Joined: Nov 2006
Posts: 169
Sachsen-Anhalt, Germany
JackTheRipper Offline
Member
JackTheRipper  Offline
Member

Joined: Nov 2006
Posts: 169
Sachsen-Anhalt, Germany
yeah i forgot it in a while-loop!

while(1)
{
vec_set(temp, player.x);
vec_sub(temp, my.x);
vec_to_angle(my.pan, temp);
wait(1);
}

thx aztec!

-jack


Cheers
Jack Out!


Bandiera rossa la trionferą
Evviva il socialismo e la libertą.
Re: How i can make to a entity turn to face player [Re: JackTheRipper] #105488
01/05/07 18:50
01/05/07 18:50
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline

Expert
aztec  Offline

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
never mind


Visit:
schwenkschuster-design.de
Re: How i can make to a entity turn to face player [Re: aztec] #105489
01/05/07 18:51
01/05/07 18:51
Joined: Jan 2006
Posts: 53
L
LWD Offline OP
Junior Member
LWD  Offline OP
Junior Member
L

Joined: Jan 2006
Posts: 53
Thanks!
I make than the entity turn to face the player when he press the key_enter, but the entity turn very fast, how i can make to the entity turn slow?
Thanks a lot!

Re: How i can make to a entity turn to face player [Re: JackTheRipper] #105490
01/05/07 18:58
01/05/07 18:58
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline

Expert
aztec  Offline

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
Code:
if (vec_dist (player.x, my.x) < 100) // the player has come clos
{
if (key_e == on)
{
while(1)
{
vec_set(temp, player.x);
vec_sub(temp, my.x);
vec_to_angle(my.pan, temp);
wait(1);
}
}
}



now he turns if the player presses e just change e to enter


Visit:
schwenkschuster-design.de
Re: How i can make to a entity turn to face player [Re: aztec] #105491
01/05/07 19:14
01/05/07 19:14
Joined: Jan 2006
Posts: 53
L
LWD Offline OP
Junior Member
LWD  Offline OP
Junior Member
L

Joined: Jan 2006
Posts: 53
Thanks! But this code dont work :/, but if i remove the line if (key_e == on)the code works, but the entity turns without i press any key...
Thanks!

Last edited by LWD; 01/05/07 19:15.
Re: How i can make to a entity turn to face player [Re: LWD] #105492
01/05/07 19:20
01/05/07 19:20
Joined: Nov 2006
Posts: 169
Sachsen-Anhalt, Germany
JackTheRipper Offline
Member
JackTheRipper  Offline
Member

Joined: Nov 2006
Posts: 169
Sachsen-Anhalt, Germany
you must set all in a while-loop and it should work fine!
hope this helps!

-jack


Cheers
Jack Out!


Bandiera rossa la trionferą
Evviva il socialismo e la libertą.
Page 1 of 3 1 2 3

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