Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   New Functions? (https://forums.graalonline.com/forums/showthread.php?t=58394)

Velox Cruentus 04-02-2005 12:01 PM

New Functions?
 
onplayerlogout for NPC-Control.

triggeraction to all players clientside (insecure, but none-the-less, useful. Such as Chat Messages instead of using the server's CPU for that.)

public variables accessible by other characters:
VChp := findplayer("Velox Cruentus").clientr.hp;


OTHER:
Stop the crashing when going between servers (with GUI).
Hrm...
makevar("Items." @ number) works when the Items database NPC was created after the last server reset. If I reset the server, the strings are inaccessible by the top example untill I reset the NPC itself.

Other things useful? I don't know... Put more in here when you find things?

loadlevels(str, int); -- ? That doesn't work serverside, yet it's in Docu.

Velox Cruentus 04-03-2005 01:23 AM

Also... In G3, when you download images, it puts them in catagories under "levels". It is nice and practical, but it's pretty bothersome when working with other things. Think you could put it so it goes like: "levels/webgifs/era/era_x.png"? It would be a lot more tidy.

EDIT:

requestfiledeletion
requestfilerename
requestfilemove

-- Fix those?

Rick 04-03-2005 01:53 AM

What is wrong with them / what are you trying to use them for?

Velox Cruentus 04-04-2005 12:13 AM

Image Rotations would be nice as well.

What's wrong: They don't work at all. They seem to just carry a placeholder, but there is no functions attached.

loadlines doesn't load images... (I was trying to rename some files on the computer)

Rick 04-04-2005 01:19 AM

Quote:

Originally Posted by Velox Cruentus
loadlines doesn't load images... (I was trying to rename some files on the computer)

Why would loadlines load an image file? It's binary data.

Velox Cruentus 04-04-2005 02:27 AM

Because I tried to rename the files clientside ;P
There should be a rename option somewhere! And this thread is kinda my little scratch book for little quirks in my systems.

Xcessive54321 04-04-2005 10:31 PM

So now we can double post???

Rick 04-04-2005 10:34 PM

Quote:

Originally Posted by Xcessive54321
So now we can double post???

Would you go away?

jake13jake 04-06-2005 02:46 AM

What would be the best function Gscript could add, since I hate having to write it out every time, would be the distance formula!

((x1-x2)^2 + (y1-y2)^2)^(1/2)
this can get very ugly. I mean, right now you have all of these parenthesis and powers already, now the trouble comes when the variable names get bigger.
dist(x1,x2,y1,y2) or dist(x1,x2,y1,y2,z1,z2) would be nice... just more organized that way. I mean, there's already getangle and such, why not distance?

What else would be nice?
acceleration, radius (for rotation), and rotational acceleration for the move function.

Evil_Trunks 04-06-2005 03:12 AM

Quote:

Originally Posted by jake13jake
What would be the best function Gscript could add, since I hate having to write it out every time, would be the distance formula!

((x1-x2)^2 + (y1-y2)^2)^(1/2)
this can get very ugly. I mean, right now you have all of these parenthesis and powers already, now the trouble comes when the variable names get bigger.
dist(x1,x2,y1,y2) or dist(x1,x2,y1,y2,z1,z2) would be nice... just more organized that way. I mean, there's already getangle and such, why not distance?

you could just make your own distance function like that

jake13jake 04-06-2005 12:25 PM

Quote:

Originally Posted by Evil_Trunks
you could just make your own distance function like that

Yes, I've heard you can do that in gscript2. I just haven't come across having to use it yet since gscript2 came out.

Rick 04-06-2005 05:55 PM

Quote:

Originally Posted by jake13jake
Yes, I've heard you can do that in gscript2. I just haven't come across having to use it yet since gscript2 came out.

NPC Code:
function dist(x1, y1, x2, y2)
{
return ((x1 - x2) ^ 2 + (y1 - y2) ^ 2) ^ (1 / 2);
}


smurfmidgetninja 04-06-2005 10:24 PM

Distance Formula? Like in Algebra/Geometry class?

http://www.purplemath.com/modules/xyplane/dist07a.gif

Hmm I need to learn to script...I have a basic understanding of mathematics and stuff...I think I will look over the files in my Graal folder to see the scripting stuff.

jake13jake 04-06-2005 10:36 PM

Quote:

Originally Posted by Rick
NPC Code:
function dist(x1, y1, x2, y2)
{
return ((x1 - x2) ^ 2 + (y1 - y2) ^ 2) ^ (1 / 2);
}


Wow, return actually returns now? Sweet Deal!
Wnyway, what I am now wondering: What did scripters who used return before it actually returned a value use it for?

jake13jake 04-06-2005 10:43 PM

Quote:

Originally Posted by smurfmidgetninja
Distance Formula? Like in Algebra/Geometry class?

http://www.purplemath.com/modules/xyplane/dist07a.gif

Hmm I need to learn to script...I have a basic understanding of mathematics and stuff...I think I will look over the files in my Graal folder to see the scripting stuff.

Yes, math can make one amazing scripter! Things that help a lot:
Averages
Distance
Trigonometry
Summations and their Properties (ex. using (-1)^n to alternate +/-, 2n-1 to create an odd number, factorials, etc.). A for loop is often used for summation.
Position -> Velocity -> Acceleration (Physics/Calculus)
Vectors
Relative Position, and lots of other stuff.


All times are GMT +2. The time now is 11:03 PM.

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