Gamestudio Links
Zorro Links
Newest Posts
FXCM => AVA Trade Plugin???
by Grant. 11/23/26 14:22
No connection to MT4
by Martin_HH. 11/23/26 06:38
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
contractUpdate() is filtering if >2 rows
by mistery. 11/09/26 12:06
New Zorro version 3.15
by jcl. 11/09/26 09:24
Removing outliers from files
by jcl. 11/04/26 10:30
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
4 registered members (JeyKey II, AndrewAMD, Grant, rht), 21,893 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Question about angle functions #442502
06/23/14 22:13
06/23/14 22:13
Joined: Jun 2010
Posts: 71
L
LawnmowerMan Offline OP
Junior Member
LawnmowerMan  Offline OP
Junior Member
L

Joined: Jun 2010
Posts: 71
Hi guys I need help.
I want to create an ball (with ent_create function) from vector A position. Then I want move this ball to the vector B. My question is, how can I tell that the ball it move toward to the vector B?

Re: Question about angle functions [Re: LawnmowerMan] #442503
06/23/14 22:22
06/23/14 22:22
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Easy way:
Change pan as follows
vec_diff(temp, B, A);
vec_to_angle(ball.pan,temp);
and then c_move using the first speed parameter.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Question about angle functions [Re: Superku] #442506
06/23/14 23:02
06/23/14 23:02
Joined: Jun 2010
Posts: 71
L
LawnmowerMan Offline OP
Junior Member
LawnmowerMan  Offline OP
Junior Member
L

Joined: Jun 2010
Posts: 71
Thanks for answer. I do not know where I wrong, but my ball fly in wrong way

Code:
action cannon_ball(){
	set(my,PASSABLE);
	my.speed_x = 8;
	VECTOR temp2;
	while(1){
	        vec_for_vertex(temp2,cannon,43);
	        vec_diff(temp, player.x, temp2);
		vec_to_angle(my.pan,temp);
		c_move(my,temp2,my.speed_x,IGNORE_PASSABLE);
		wait(1);	
	}
}


Re: Question about angle functions [Re: LawnmowerMan] #442508
06/23/14 23:07
06/23/14 23:07
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
c_move(my,temp2,my.speed_x,IGNORE_PASSABLE);
This does not make much sense to me. Check the manual reference for c_move, you are giving a world position (temp2) as the relative speed vector.
Try sth as follows:

Code:
action cannon_ball(){
	set(my,PASSABLE);
	my.speed_x = 8;
	vec_for_vertex(my.x,cannon,43);
	vec_diff(temp, player.x, my.x);
	vec_to_angle(my.pan,temp);
	while(1){
		c_move(my,vector(my.speed_x*time_step,0,0),nullvector,IGNORE_PASSABLE);
		wait(1);	
	}
}



"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Question about angle functions [Re: Superku] #442509
06/23/14 23:27
06/23/14 23:27
Joined: Jun 2010
Posts: 71
L
LawnmowerMan Offline OP
Junior Member
LawnmowerMan  Offline OP
Junior Member
L

Joined: Jun 2010
Posts: 71
Ah, now I understand. Thank you man!


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