Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-06-2002, 03:05 AM
Will45 Will45 is offline
Banned
Join Date: Jan 2002
Location: San Diego, California
Posts: 59
Will45 is on a distinguished road
Send a message via AIM to Will45
Circles!

Could someone teach me how to make something move in a circle? Thanks.
Reply With Quote
  #2  
Old 02-06-2002, 04:01 AM
btedji btedji is offline
bryan986
btedji's Avatar
Join Date: Apr 2001
Location: Force 10
Posts: 1,153
btedji is on a distinguished road
Send a message via ICQ to btedji Send a message via AIM to btedji Send a message via Yahoo to btedji
I would never had said that lol, havent had evough schooling yet
Reply With Quote
  #3  
Old 02-06-2002, 04:18 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
Re: Re: Circles!

Quote:
Originally posted by Kaimetsu


Cartesian coords: (centerx+mag*cos(ang),centery+mag*sin(ang))

Increase the angle and watch it spin.
what is mag??
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #4  
Old 02-06-2002, 06:37 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
magnitude.
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #5  
Old 02-06-2002, 07:44 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
magnitude??

like how much it will rotate
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #6  
Old 02-06-2002, 07:48 AM
Faheria_GP2 Faheria_GP2 is offline
Banned
Faheria_GP2's Avatar
Join Date: Oct 2001
Posts: 1,177
Faheria_GP2 is on a distinguished road
Quote:
Originally posted by TDK_RC6
magnitude??

like how much it will rotate
liek, teh radius foo! LEL!
Reply With Quote
  #7  
Old 02-06-2002, 07:59 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
well okay then, that helps more


i've never heard it called magnitude
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #8  
Old 02-06-2002, 09:59 AM
lordhelmut lordhelmut is offline
Registered User
lordhelmut's Avatar
Join Date: Aug 2001
Posts: 710
lordhelmut is on a distinguished road
Send a message via ICQ to lordhelmut Send a message via AIM to lordhelmut Send a message via Yahoo to lordhelmut
i learned a new vocab word =D but how would i incorporate that formula into a NPC?
__________________

Check out the development at:
http://razza.org/lordhelmut/FantasyTales/index
Reply With Quote
  #9  
Old 02-06-2002, 10:51 AM
Faheria_GP2 Faheria_GP2 is offline
Banned
Faheria_GP2's Avatar
Join Date: Oct 2001
Posts: 1,177
Faheria_GP2 is on a distinguished road
NPC Code:

if (playerenters) timeout=.05;
if (timeout) {
this.angle=(this.angle+.1)%6.28;
showimg 0,beer.gif,x+6*sin(this.angle),y+6*cos(this.angle) ;
timeout=.05;
}

Reply With Quote
  #10  
Old 02-06-2002, 11:21 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Quote:
Originally posted by Faheria_GP2
NPC Code:

if (playerenters) timeout=.05;
if (timeout) {
this.angle=(this.angle+.1)%6.28;
showimg 0,beer.gif,x+6*sin(this.angle),y+6*cos(this.angle) ;
timeout=.05;
}

;P
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #11  
Old 02-06-2002, 02:04 PM
joseyisleet joseyisleet is offline
Registered User
Join Date: Aug 2001
Posts: 378
joseyisleet is on a distinguished road
-=Josey=-
Nice formula Kaimetsu. I wouldn't use showimg for that, I do believe showimg is local. So you could use something like this;

if (playerenters){
timeout=.05;
setimg light2.png;
setcoloreffect 0,0.5,1,0.99;
}
if (timeout) {
this.x=30;
this.y=30;
this.angle=(this.angle+.1)%6.28;
x = this.x+6*sin(this.angle);
y = this.y+6*cos(this.angle);
timeout=.05;
}

Just change this.x and this.y to wherever you want the light to be.
__________________
Account used by Josey and Howard.
Ali G: 'Is it cause i Black?'
Reply With Quote
  #12  
Old 02-06-2002, 02:30 PM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT

*wishes she would have had a better Geometry teacher*
Reply With Quote
  #13  
Old 02-06-2002, 02:48 PM
joseyisleet joseyisleet is offline
Registered User
Join Date: Aug 2001
Posts: 378
joseyisleet is on a distinguished road
-=Josey=-
Hey! Everyone makes mistakes. ;P In that formula, the angle = the speed, this.x+6 = the width, this.y+6 = the hieght.
__________________
Account used by Josey and Howard.
Ali G: 'Is it cause i Black?'
Reply With Quote
  #14  
Old 02-06-2002, 03:09 PM
joseyisleet joseyisleet is offline
Registered User
Join Date: Aug 2001
Posts: 378
joseyisleet is on a distinguished road
-=Josey=-
Lol, if you use the code that I provided above, it is.
Say you use this.angle=(this.angle+.7)%6.28;. That will speed up the circular movement. If you use this.x+10 and this.y+10 it will make the radius bigger, making it circle bigger.
__________________
Account used by Josey and Howard.
Ali G: 'Is it cause i Black?'
Reply With Quote
  #15  
Old 02-06-2002, 05:20 PM
Slaktmaster Slaktmaster is offline
man with the mastahplan
Slaktmaster's Avatar
Join Date: Apr 2001
Location: Half-way over the river styx
Posts: 4,422
Slaktmaster is an unknown quantity at this point
Send a message via ICQ to Slaktmaster Send a message via AIM to Slaktmaster
Nice try, Josey.
Reply With Quote
  #16  
Old 02-06-2002, 10:17 PM
joseyisleet joseyisleet is offline
Registered User
Join Date: Aug 2001
Posts: 378
joseyisleet is on a distinguished road
Lol. thisx+6 and this.y+6 = the circumference of the circle.
__________________
Account used by Josey and Howard.
Ali G: 'Is it cause i Black?'
Reply With Quote
  #17  
Old 02-06-2002, 10:25 PM
joseyisleet joseyisleet is offline
Registered User
Join Date: Aug 2001
Posts: 378
joseyisleet is on a distinguished road
- wonders what 6 + 6 is
__________________
Account used by Josey and Howard.
Ali G: 'Is it cause i Black?'
Reply With Quote
  #18  
Old 02-06-2002, 11:44 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Notice when he knows what he is saying is wrong, he starts all of his posts with Lol...thats just something I noticed...humans amaze me...
The curcumference is 2pi*r is it not? Not trying to correct Kaimetsu, I am seriously wondering.
And the area is pi*(r*r)...
and i consider myself bad at math...joseyisnoleet.
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #19  
Old 02-07-2002, 12:01 AM
joseyisleet joseyisleet is offline
Registered User
Join Date: Aug 2001
Posts: 378
joseyisleet is on a distinguished road
-=Josey=-
- Shrugs. I've been up for about 5 days. Tired as heck and my mind isn't working right. ;\ Maybe after I eat breakfast I'll go to bed, doubtfull though. - Beats the hell out of insomnia. ;X
__________________
Account used by Josey and Howard.
Ali G: 'Is it cause i Black?'
Reply With Quote
  #20  
Old 02-07-2002, 07:40 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Re: Re: Circles!

Quote:
Originally posted by Kaimetsu


Cartesian coords: (centerx+mag*cos(ang),centery+mag*sin(ang))

Increase the angle and watch it spin.
what about this instead?
centerx+mag*cos(ang+rotate),centery+mag*sin(ang+ro tate)

it seems when you add to the numbers inside the sin and cos it makes them rotate, which would make sence, but its just a sidenote. look:
NPC Code:

if (playerenters) {
this.dista = 5;
this.distb = 5;
timeout = .05;
}
if (timeout) {
for (i=0;i<10;i+=.1 {
showimg (i*10)+500,@.,30+sin(i)*this.dista,30+cos(i+this.r otate)*this.distb;
}
this.rotate+=.05;
timeout = .05;
}

__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #21  
Old 02-07-2002, 10:56 AM
dragoonvenganc dragoonvenganc is offline
Registered User
Join Date: Jul 2001
Location: USA
Posts: 331
dragoonvenganc is on a distinguished road
Send a message via ICQ to dragoonvenganc Send a message via AIM to dragoonvenganc
to the person that said geometry this is pretty much trig..
i like making stuff move in a sine or cosine wave..
tangent is messed.. up.. any one out there besides kammy know what i mean
__________________
Dragoon Vengance
Owner of Pangea Relics of Time
P2P Rp server
For info or job
Email: [email protected]
aim: dragoonvengnc
Reply With Quote
  #22  
Old 02-07-2002, 12:01 PM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Quote:
Originally posted by Kaimetsu


Once again this is incorrect. The circumference of the circle is pi*12.
yes, the radius is equal to 2*pi*r ...

2*3.14*6=37.68 ...

That is the circufrence ...

the area of the circle is pi*r*r:

3.14*6*6=113.04

...
Reply With Quote
  #23  
Old 02-07-2002, 04:02 PM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Re: Re: Re: Re: Circles!

Quote:
Originally posted by Kaimetsu


Which is the same as 12*pi, except that my answer was more precise.
you get the same answer ...
and it helps him learn where to place the varaibles for his equations ...
Reply With Quote
  #24  
Old 02-08-2002, 12:32 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
What I am saying, is that if you add variables to to the numbers inside sine or cosine like incrementally add .05 to this.rotate and add it to i than it seems to rotate try the script I included when I first posted. Its actually very cool.
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #25  
Old 02-08-2002, 12:55 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Quote:
Originally posted by Kaimetsu


Ah, I understand now. I didn't notice that you were only adding to the sin.
Mmmmmm...l33t
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:00 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.