Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-28-2002, 12:18 AM
Frolic_RC2 Frolic_RC2 is offline
Banned
Join Date: Jan 2002
Posts: 960
Frolic_RC2 is on a distinguished road
We need some shortcut commands..

Heh, sometimes it gets tiring scripting things like "playernear" and such...

It should be integrated into graal, shortening our scripts and making it easier...

Post what commands should be integrated to make things easier here.

My suggestion is playnear...

playernear(x,y,radius(from x,y));

So you could do...

if (playernear(10,10,2)) {
message Hey;
}else{
message ;
}

If the player is within the radius given, from the point 10,10, the NPC will say Hey. As long as he is in that location, it will continue to say Hey. Once he leaves, it will no longer...

Heh, just post your shortcut commands here anyway
Reply With Quote
  #2  
Old 04-28-2002, 03:51 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
if(((playerx-x)^2)+((playery-y)^2)<(radius^2))

Pythagorean theorem.
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #3  
Old 04-28-2002, 04:44 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
nearestplayer variable is in the next version (player index it returns i thinks)
__________________

subliminal message: 1+1=3
Reply With Quote
  #4  
Old 04-28-2002, 05:45 PM
Spanko Spanko is offline
Squeaker of Soles
Spanko's Avatar
Join Date: Nov 2001
Location: The Netherworl...lands
Posts: 1,366
Spanko is on a distinguished road
Send a message via ICQ to Spanko Send a message via AIM to Spanko Send a message via Yahoo to Spanko
I just wish it'd allow us to create custom functions like that, along with global custom NPC-Server functions.

Like:
NPC Code:
if (created) {
this.dist=GetDist(x,y,playerx,playery);
}
function GetDist(a,b,c,d) {
this.temp=((c-a)^2+(d-b)^2)^0.5;
return this.temp;
}

__________________

ICQ: 125283920
MSN: [email protected]
AIM: Squeax0r
Squeaker seems unable to access the forum using this account.. tis a sad day.
Now with occasional Asuka flavour! Ooops a bit too much...
Asuka should be king of Dustari!

"Y'know, some days even my lucky rocketship underpants don't even help."
Reply With Quote
  #5  
Old 04-28-2002, 11:20 PM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
Stefan said that would be quite imposible. I asked him if we could have function arguments and functions that return values other than void every time. He said Gscript wasn't object oriented or something. *shrugs* don't hink it will happen any time soon. But there is always hope.
__________________

subliminal message: 1+1=3
Reply With Quote
  #6  
Old 04-29-2002, 08:40 PM
Frolic_RC2 Frolic_RC2 is offline
Banned
Join Date: Jan 2002
Posts: 960
Frolic_RC2 is on a distinguished road
Quote:
Originally posted by Tyhm
if(((playerx-x)^2)+((playery-y)^2)<(radius^2))

Pythagorean theorem.
Gah....need shortcuts...
Reply With Quote
  #7  
Old 04-29-2002, 11:17 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 Tyhm
if(((playerx-x)^2)+((playery-y)^2)<(radius^2))

Pythagorean theorem.
<3
__________________

!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
  #8  
Old 04-30-2002, 10:43 AM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
Distance Formula:

((x2-x1)^2 + (y2-y1)^2)^.5

(yes, to the 1/2 power = square rt. )
__________________

subliminal message: 1+1=3
Reply With Quote
  #9  
Old 05-04-2002, 06:19 AM
BBflat BBflat is offline
Registered User
BBflat's Avatar
Join Date: Apr 2002
Location: United States of America
Posts: 573
BBflat is on a distinguished road
Quote:
Originally posted by Falcor
Stefan said that would be quite imposible. I asked him if we could have function arguments and functions that return values other than void every time. He said Gscript wasn't object oriented or something. *shrugs* don't hink it will happen any time soon. But there is always hope.
Graal isn't object oriented? It sure as hell should be. I tried to ask Stefan to let user-defined funtions pass arguments and return values, too, but I could never find him. That would be SO useful in Graal scripting. There should also be different variable-types (int, double, float, string, char, bool, etc...) and user-defined types. Object-oriented programming (OOP) is a programming thing (Graal script is not programming) that lets the user make complex data structures like classes, and allows the user to do a LOT more. Graal NEEDS these things!

I like Fermat's Last Theorem better, but Pythagorus is cool, too.
__________________
I am a .sig virus. Please put me in your .sig so I can continue to replicate.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 10:28 AM.


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