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
1 registered members (TipmyPip), 18,633 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
Page 1 of 2 1 2
Surrounding problem #174486
12/23/07 08:19
12/23/07 08:19
Joined: Apr 2005
Posts: 33
Afghanistan
A
Art_Of_Fun Offline OP
Newbie
Art_Of_Fun  Offline OP
Newbie
A

Joined: Apr 2005
Posts: 33
Afghanistan
Hi everybody!
how are you all i hope you are fine and enjoying.
I have been here after a very long time but with a probelm i hope you folks will solve it for me.
here is the problem...

it is easy but i am poor in maths so i can't do it. i want an entity to rotate around another enitity like a circle in 360 degrees.
i am very confused please solve it.
Thanx for help!

Re: Surrounding problem [Re: Art_Of_Fun] #174487
12/24/07 06:23
12/24/07 06:23
Joined: Apr 2005
Posts: 33
Afghanistan
A
Art_Of_Fun Offline OP
Newbie
Art_Of_Fun  Offline OP
Newbie
A

Joined: Apr 2005
Posts: 33
Afghanistan
nobody want to help?
it was a simple question how to make a model rotate around another model?

Re: Surrounding problem [Re: Art_Of_Fun] #174488
12/24/07 11:50
12/24/07 11:50
Joined: Jul 2004
Posts: 1,205
Greece
LarryLaffer Offline
Serious User
LarryLaffer  Offline
Serious User

Joined: Jul 2004
Posts: 1,205
Greece
maybe it's because you've posted it here, and not a lot of people look at this forum yet. but here you go:

Code:

function GetPosVecByRadious(var* SourcePos,angle,distance,var* ReturnedPos)
{
ReturnedPos[0]=distance*cos(angle)+SourcePos[0];
ReturnedPos[1]=distance*sin(angle)+SourcePos[1];
ReturnedPos[2]=SourcePos[2];
}
..
..
..

//my rotates around you
var MyAngle=0;
var MyDistance=100;
while (1)
{
GetPosVecByRadious(you.x,MyAngle,MyDistance,my.x);
MyAngle+=1;
wait(1);
}




this is for lite-c and rotates around the XY-plane, but you should be able to convert it easily if it doesn't suit your needs


INTENSE AI: Use the Best AI around for your games!
Join our Forums now! | Get Intense Pathfinding 3 Free!
Re: Surrounding problem [Re: LarryLaffer] #174489
12/24/07 12:41
12/24/07 12:41
Joined: Apr 2005
Posts: 33
Afghanistan
A
Art_Of_Fun Offline OP
Newbie
Art_Of_Fun  Offline OP
Newbie
A

Joined: Apr 2005
Posts: 33
Afghanistan
Sorry i couldn't understand .

Re: Surrounding problem [Re: Art_Of_Fun] #174490
12/24/07 12:49
12/24/07 12:49
Joined: May 2003
Posts: 567
Spain, Canary Islands
Felixsg Offline
User
Felixsg  Offline
User

Joined: May 2003
Posts: 567
Spain, Canary Islands
Quote:

Sorry i couldn't understand .




Whats you not understand?

Re: Surrounding problem [Re: Felixsg] #174491
12/25/07 06:57
12/25/07 06:57
Joined: Apr 2005
Posts: 33
Afghanistan
A
Art_Of_Fun Offline OP
Newbie
Art_Of_Fun  Offline OP
Newbie
A

Joined: Apr 2005
Posts: 33
Afghanistan
Sorry i don't know what happend to me but i can't get it to work yeah maybe i am crazy. But can someone please give me an example level Please?.
BTW my GS version is 6.20 pro
Thanx

Re: Surrounding problem [Re: Art_Of_Fun] #174492
12/26/07 10:49
12/26/07 10:49
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
You need to convert it to C-Script to make it work with A6.2 as the code above is, as Larry said, Lite-C.

Re: Surrounding problem [Re: Xarthor] #174493
12/26/07 12:19
12/26/07 12:19
Joined: Apr 2005
Posts: 33
Afghanistan
A
Art_Of_Fun Offline OP
Newbie
Art_Of_Fun  Offline OP
Newbie
A

Joined: Apr 2005
Posts: 33
Afghanistan
I got it but i am wondering how to make him stop when he reach behind the model?
here is the code...

entity* stand_ent;
entity* rotate_ent;
var move_speed;

action model_stand
{
stand_ent = me;
}

action rotate_model
{
rotate_ent = me;
while(1)
{


if(stand_ent != 0)
{
vec_set(temp, stand_ent.x);
vec_sub(temp, my.x);
vec_to_angle(my.pan, temp);
my.tilt = 0;
my.roll = 0;
move_speed.x = 0;
move_speed.y = 2*time;
c_move(my,move_speed,nullvector,ignore_me + glide);
}
wait(1);
}
}

Re: Surrounding problem [Re: Art_Of_Fun] #174494
12/26/07 17:23
12/26/07 17:23
Joined: Mar 2005
Posts: 969
ch
Loopix Offline
User
Loopix  Offline
User

Joined: Mar 2005
Posts: 969
ch
Quote:

BTW my GS version is 6.20 pro



Making games, having fun and getting help from the forums doesen't work with this version...any other version will work but not this one (standart or extra will work too!). Even if you don't have much money...it's worth saving a small amount of money and maybe buy A7 Extra. Using 6.20 pro might suddenly get very expensiv for you.

Re: Surrounding problem [Re: Loopix] #174495
12/27/07 07:30
12/27/07 07:30
Joined: Jul 2006
Posts: 503
Australia
A
adoado Offline

User
adoado  Offline

User
A

Joined: Jul 2006
Posts: 503
Australia
Just out of curiosity, why do you use such an old version? You can update to the latest A6 version (A6 6.6) right here: ^^

http://server.conitec.net/gsa6/update660.exe

Thanks,
Adoado


Visit our development blog: http://yellloh.com
Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

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