Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 730 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
moving to a certain point on the map #382517
09/08/11 22:05
09/08/11 22:05
Joined: Aug 2004
Posts: 1,305
New York
PrenceOfDarkness Offline OP
Serious User
PrenceOfDarkness  Offline OP
Serious User

Joined: Aug 2004
Posts: 1,305
New York
I'm trying to make an object move towards the center of the map. However with the method I'm using the object's speed gets slower. Is it possible to do what I want to do with out making the object have to face the center (in other words I don't want to use entity coordinates I want to use world coordinates).

Code:
while(1){
wait(1);
vec_set(tempVec,my.x);
vec_sub(tempVec,vector(0,0,0));
		vec_mul(tempVec,vector(-1*time_step,-1*time_step,-1*time_step));

c_move(me,0,vector(tempVec[0]*0.01,tempVec[1]*0.01,tempVec[2]*0.01),IGNORE_PASSABLE | GLIDE);
}



Last edited by PrenceOfDarkness; 09/08/11 22:08.

"There is no problem that can't be solved with time and determination." -me
prenceofdarkness for instant messages on AIM.

Looking for a model designer
PLEASE, SEND ME A PRIVATE MESSAGE OR EMAIL IF YOU'RE INTERESTED.
Re: moving to a certain point on the map [Re: PrenceOfDarkness] #382519
09/08/11 22:26
09/08/11 22:26
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
vec_diff(temp,nullvector,my.x); // you can copy and invert the vector my.x, too
if(vec_length(temp) > 25)
{
vec_normalize(temp,25*time_step); // 25 is your speed
c_move(me,nullvector,temp,...);
}


"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

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