View Single Post
  #74  
Old 02-04-2004, 12:36 AM
Duwul Duwul is offline
Registered User
Join Date: Nov 2003
Posts: 105
Duwul is on a distinguished road
Quote:
Originally posted by ZeLpH_MyStiK
Well hope the following helps, im going to go through trigonometry briefly:
In a unit circle (a circle with a radius of one), a point on the circles edge defined my an angle x has the coordinates (cos(x),sin(x)). If a larger circle is wanted, you multiply the coordinates by the number you want the radius to increase. I.E. if you want a circle with a radius of 5, the coordinate on the edge of the circle defined by angle x would be (5cos(x),5sin(x)). So the code should look something like this:
NPC Code:

//#CLIENTSIDE
if (created) {
loop=15; // number of times it circles
size=3; // size of the radius that the vision circles at
drunkeffect();
}
function drunkeffect() {
for(i=0;i<loop;i++) { // for loop that ensures that it circles (loop) times
for(j=0;j<360;j++) { // j=angle and i do believe gscript does not use radians
seteffect playerx+1.5+cos(j)*radius,playery+2+sin(j)*radius;
sleep .05;
}
}
resetfocus;
}

Erm, Gscript DOES use radians. To convert from radians to degrees, I believe its (radians * (180/pi)). And to convert from degrees, it is (degrees * (pi/180)).
__________________
-Ajira
Liek, omigosh.
<3 DoomsDay.
Reply With Quote