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 03-04-2002, 05:09 AM
reywas86 reywas86 is offline
Registered User
Join Date: Feb 2002
Posts: 6
reywas86 is on a distinguished road
Send a message via AIM to reywas86
Unhappy I need some help....

I need someone to please tell me how to make a pong type game for graal. I don't know where to start on it....I want it to keep score and when points=10 to declare the winner.....Can someone please help me, I don't know where to start, I'm lost
Reply With Quote
  #2  
Old 03-04-2002, 05:20 AM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
:P

start with learning how to script
__________________
[signature]insert here[/signature]
Reply With Quote
  #3  
Old 03-04-2002, 05:24 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
Hi.

It's not done yet, as you might notice.
Attached Files
File Type: zip pongnotdone.zip (3.4 KB, 135 views)
Reply With Quote
  #4  
Old 03-04-2002, 05:58 AM
reywas86 reywas86 is offline
Registered User
Join Date: Feb 2002
Posts: 6
reywas86 is on a distinguished road
Send a message via AIM to reywas86
:P I didn't ask you to tell me I need more help scripting.
Reply With Quote
  #5  
Old 03-04-2002, 06:32 AM
WHIPENIE4 WHIPENIE4 is offline
I am X-Mann
Join Date: Aug 2001
Location: PA
Posts: 2,715
WHIPENIE4 is on a distinguished road
Send a message via ICQ to WHIPENIE4 Send a message via AIM to WHIPENIE4
..... start by learning the basics... if (playerenters)message Hello;
for example... just learn to do those simple things first then slowly advance... look at scripts on this forum and try finding out what they mean.. look at the npcprogramming.doc in your graal folder... it helps a bit.
__________________
Mind over Matter. If your body dont mind, why does it matter?

- X-Mann (Blessing Graal since 1998) Haha

- Graal 2000 Project (Contact Me to get Apart of this expierience

Windows Vista. Graal. Not a Good Combination.
Reply With Quote
  #6  
Old 03-04-2002, 10:33 PM
reywas86 reywas86 is offline
Registered User
Join Date: Feb 2002
Posts: 6
reywas86 is on a distinguished road
Send a message via AIM to reywas86
lol, I know how to script. I'm just lost on this one!
Reply With Quote
  #7  
Old 03-04-2002, 10:41 PM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
then u shouldn't be trying something like this yet
__________________
[signature]insert here[/signature]
Reply With Quote
  #8  
Old 03-05-2002, 12:03 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
Well I won't go on the assumption that you are not a l33t script0r, so instead I will tell you what I did, your math kind of needs to be strong to do this, and I wish I had a scanner so I could upload me notes, I'll try to overview.
If you think about it, on pong, you have 360 degrees, right? Well you can just cut it in half, to 180 degrees and two modes for x and y, so xmode = (0 || 1); ymode = (0 || 1); and each mode has 180 degrees. So like this, you can, using triginometry (sp?) figure out the direction of any object:
NPC Code:

xincrement = (cos(angle/57.3)*speed)-cos(angle/57.3);
yincrement = (sin(angle/57.3)*speed)-sin(angle/57.3);

Because remember circles are also 360 degrees...
where speed it the amount of space you want it to move each increment.


Than to move the actual object (assuming ox, oy is the object's x and y) you could simply do this:
NPC Code:

if (xmode == 0) ox+=abs(xincrement);
else ox-=abs(xincrement);
if (ymode == 0) oy+=abs(yincrement);
else oy-=abs(yincrement);



Than assuming that mx and my is the max x and y, and lx and ly is the least x and y, we can reverse the mode on hits.
NPC Code:

if (ox>=mx) this.xmode=0;
if (ox<=lx) this.xmode=1;
if (oy>=my) this.ymode=0;
if (oy<=ly) this.ymode=1;


Hope that helps.
__________________

!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
  #9  
Old 03-05-2002, 12:21 AM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
Quote:
Originally posted by Saga2001
Well I won't go on the assumption that you are not a l33t script0r, so instead I will tell you what I did, your math kind of needs to be strong to do this, and I wish I had a scanner so I could upload me notes, I'll try to overview.
If you think about it, on pong, you have 360 degrees, right? Well you can just cut it in half, to 180 degrees and two modes for x and y, so xmode = (0 || 1); ymode = (0 || 1); and each mode has 180 degrees. So like this, you can, using triginometry (sp?) figure out the direction of any object:
NPC Code:

xincrement = (cos(angle/57.3)*speed)-cos(angle/57.3);
yincrement = (sin(angle/57.3)*speed)-sin(angle/57.3);

Because remember circles are also 360 degrees...
where speed it the amount of space you want it to move each increment.


Than to move the actual object (assuming ox, oy is the object's x and y) you could simply do this:
NPC Code:

if (xmode == 0) ox+=abs(xincrement);
else ox-=abs(xincrement);
if (ymode == 0) oy+=abs(yincrement);
else oy-=abs(yincrement);



Than assuming that mx and my is the max x and y, and lx and ly is the least x and y, we can reverse the mode on hits.
NPC Code:

if (ox>=mx) this.xmode=0;
if (ox<=lx) this.xmode=1;
if (oy>=my) this.ymode=0;
if (oy<=ly) this.ymode=1;


Hope that helps.
are you talking to me??
__________________
[signature]insert here[/signature]
Reply With Quote
  #10  
Old 03-05-2002, 03:19 AM
reywas86 reywas86 is offline
Registered User
Join Date: Feb 2002
Posts: 6
reywas86 is on a distinguished road
Send a message via AIM to reywas86
yes thank you, it helped alot!
Reply With Quote
  #11  
Old 03-05-2002, 09:25 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 screen_name


are you talking to me??
Nope, I was talking to reywas86.
__________________

!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
  #12  
Old 03-05-2002, 09:43 AM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
okay, i thought you thought that i wasn't smart
__________________
[signature]insert here[/signature]
Reply With Quote
  #13  
Old 03-05-2002, 09:57 AM
darkriders_p2p darkriders_p2p is offline
Registered User
Join Date: Jan 2002
Location: Canada
Posts: 690
darkriders_p2p is on a distinguished road
Quote:
orignally posted by screen_name
okay, i thought you thought that i wasn't smart
I don't think your smart, lol, j/k your a genious wit 912075376 IQ
__________________
maximus_asinus
Reply With Quote
  #14  
Old 03-05-2002, 02:48 PM
neomaximus2k neomaximus2k is offline
Registered User
Join Date: Feb 2002
Location: UK
Posts: 324
neomaximus2k is on a distinguished road
Send a message via ICQ to neomaximus2k
Quote:
Originally posted by darkriders_p2p


I don't think your smart, lol, j/k your a genious wit 912075376 IQ
Lol yay his ICQ number
[JK]
__________________
Beware of thy Inner self
NPC Code:

_.,.__
((o\\o\))
.-. ` \\``
__( )___.o"".,___
=== ~~~~~~~~
==
= Neo

Reply With Quote
  #15  
Old 03-05-2002, 10: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
Quote:
Originally posted by Kaimetsu


Pff. If your maths is really strong, you'll use vectors instead of angles.
sush, i am getting there.
__________________

!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 04:12 PM.


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