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-03-2002, 05:12 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
angles

Does anyone know how to get the opposite (dont know how to explain) of an angle?
Like used in pong.
But I need it in sine/cosine form (pi being the 360º angle)
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #2  
Old 02-03-2002, 05:18 AM
Goboom Goboom is offline
Pixel Monkey
Goboom's Avatar
Join Date: Dec 2001
Location: Michigan
Posts: 1,702
Goboom is on a distinguished road
Send a message via ICQ to Goboom Send a message via AIM to Goboom Send a message via MSN to Goboom Send a message via Yahoo to Goboom
did you just ask *Puts lips together makes humming noise and moves finger up and down hundereds of times*?
__________________
Reply With Quote
  #3  
Old 02-03-2002, 05:20 AM
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 Goboom
did you just ask *Puts lips together makes humming noise and moves finger up and down hundereds of times*?
That was stupid.
Reply With Quote
  #4  
Old 02-03-2002, 06:18 AM
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
Opposite angle = angle - pi.
Reply With Quote
  #5  
Old 02-03-2002, 06:43 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Re: Re: angles

Quote:
Originally posted by Kaimetsu


Of course someone knows. What a silly question. Plus I think the word you are looking for is "radian".
I was looking at the radiant system and all that but I could not find a certain formula ..
I think I am not explaining myself well b/c in Pong the angle isnt always the opposite of what it was .. (specially when it hits the player tab thing)

btw whats getangle for?

and Slak I tried that.. not it .. hehe
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #6  
Old 02-03-2002, 08:52 AM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
hmmm I don't really know a formular for this but a way to emulate something like this is able with using vars for vertical and horizontal movement...

something like this for example:

NPC Code:

if(playerenters){
this.vx=1;
this.vy=-1;
timeout=.05;
}

if(timeout){
if(!onwall(x+(width/2)+this.vx+(.025*this.vx),y+height/2)){x+=this.vx;}
else {this.vx=this.vx*(-1);}

if(!onwall(x+(width/2),y+(height/2)+this.vy+(.025*this.vy))){y+=this.vy;}
else {this.vy=this.vy*(-1);}

timeout=.05;
}



it's like the pong ball
__________________
No Webhost at the moment
Reply With Quote
  #7  
Old 02-03-2002, 09:12 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Quote:
Originally posted by TDO2000
hmmm I don't really know a formular for this but a way to emulate something like this is able with using vars for vertical and horizontal movement...

something like this for example:

<code>

it's like the pong ball
yes but the problem is that always goes in a certain angle
i need mine randomized to actually fit the real reflections of the angles ..
ok im confusing myself here..
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #8  
Old 02-03-2002, 10:21 AM
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: angles

Quote:
Originally posted by LiquidIce00
Does anyone know how to get the opposite (dont know how to explain) of an angle?
Like used in pong.
But I need it in sine/cosine form (pi being the 360º angle)
I wish i could help, but I did not pay much attention in Geometry ... but remember (axa)+(bxb)=(cxc) ... I got
my forumals I could post for ya if ya want, they may help
a bit...
Reply With Quote
  #9  
Old 02-03-2002, 10:23 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Re: Re: angles

Quote:
Originally posted by nyghtGT

I wish i could help, but I did not pay much attention in Geometry ... but remember (axa)+(bxb)=(cxc) ... I got
my forumals I could post for ya if ya want, they may help
a bit...
its ok
i wont bother w/ this till I come across this agn and really need it hehe
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #10  
Old 02-03-2002, 10:29 AM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
Well, you could look for a Unit Circle for help. I had to use one last year in my Advanced Algebra/Trigonometry class. It is basically a circle with Radius 1 that has the Degree and Radian coordinates all along the circle. Like, 180 degrees is pi, while 90 degrees is pi/2. If you need to change degrees into radians, use this equation:
(degrees/180)*pi
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
Reply With Quote
  #11  
Old 02-03-2002, 11:05 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
if you would explain a little better, than i could help you, im great at mathmatics
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #12  
Old 02-03-2002, 10:59 PM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Quote:
Originally posted by Kaimetsu
There are a couple of simple ways to do this, but I would suggest that you use dx/dy vars as somebody said, rather than inefficiently storing and manipulating the angle.
what is getangle(dx,dy) for?
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #13  
Old 02-04-2002, 12:18 AM
Wes2000 Wes2000 is offline
Registered User
Join Date: Dec 2001
Posts: 57
Wes2000 is on a distinguished road
Send a message via AIM to Wes2000
Yea, I would like to know what getangle is also

newfeatures:
- new script function getangle(dx,dy)

commands:
getangle( dx,dy ) the angle of vector (dx,dy) to the x coordinate (0...2*3.14)

That really doesnt help to much
__________________
Reply With Quote
  #14  
Old 02-04-2002, 12:29 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
Re: Re: Re: angles

Quote:
Originally posted by LiquidIce00


its ok
i wont bother w/ this till I come across this agn and really need it hehe
well, if you have an angle going / and you want it to suddenly go \ I think you would add/subtract "pi/2"
Reply With Quote
  #15  
Old 02-04-2002, 12:40 AM
Wes2000 Wes2000 is offline
Registered User
Join Date: Dec 2001
Posts: 57
Wes2000 is on a distinguished road
Send a message via AIM to Wes2000
could you possibly post an example? thats the way i usually learn best.
__________________
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 01:22 PM.


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