Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (TipmyPip, AndrewAMD, dBc, clonman), 18,621 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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 | 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