Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-02-2005, 12:01 PM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
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.
__________________
In a world of change... Who'll you believe?
Reply With Quote
  #2  
Old 04-03-2005, 01:23 AM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
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?
__________________
In a world of change... Who'll you believe?

Last edited by Velox Cruentus; 04-03-2005 at 01:34 AM..
Reply With Quote
  #3  
Old 04-03-2005, 01:53 AM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
What is wrong with them / what are you trying to use them for?
Reply With Quote
  #4  
Old 04-04-2005, 12:13 AM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
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)
__________________
In a world of change... Who'll you believe?
Reply With Quote
  #5  
Old 04-04-2005, 01:19 AM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
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.
Reply With Quote
  #6  
Old 04-04-2005, 02:27 AM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
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.
__________________
In a world of change... Who'll you believe?
Reply With Quote
  #7  
Old 04-04-2005, 10:31 PM
Xcessive54321 Xcessive54321 is offline
Zodiac Nub
Xcessive54321's Avatar
Join Date: Mar 2005
Location: In my room
Posts: 289
Xcessive54321 is on a distinguished road
So now we can double post???
__________________
Reply With Quote
  #8  
Old 04-04-2005, 10:34 PM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
Quote:
Originally Posted by Xcessive54321
So now we can double post???
Would you go away?
Reply With Quote
  #9  
Old 04-06-2005, 02:46 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
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.
Reply With Quote
  #10  
Old 04-06-2005, 03:12 AM
Evil_Trunks Evil_Trunks is offline
Evil
Evil_Trunks's Avatar
Join Date: Dec 2004
Posts: 391
Evil_Trunks is on a distinguished road
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
__________________

Reply With Quote
  #11  
Old 04-06-2005, 12:25 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
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.
Reply With Quote
  #12  
Old 04-06-2005, 05:55 PM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
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);
}

Reply With Quote
  #13  
Old 04-06-2005, 10:36 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
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?
Reply With Quote
  #14  
Old 04-06-2005, 10:24 PM
smurfmidgetninja smurfmidgetninja is offline
πr²
Join Date: Sep 2004
Location: Davenport, Iowa, USA
Posts: 463
smurfmidgetninja is on a distinguished road
Send a message via ICQ to smurfmidgetninja Send a message via AIM to smurfmidgetninja Send a message via MSN to smurfmidgetninja Send a message via Yahoo to smurfmidgetninja
Distance Formula? Like in Algebra/Geometry class?



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.
__________________


"Zombies, man. They creep me out." - Kaufman, Land of the Dead
Reply With Quote
  #15  
Old 04-06-2005, 10:43 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by smurfmidgetninja
Distance Formula? Like in Algebra/Geometry class?



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.
Reply With Quote
  #16  
Old 04-07-2005, 05:42 AM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
So long for my little private scratch book of notes.

Yea, I suppose so. (as well as while loops... And do-while loops? As well as switch statements)
__________________
In a world of change... Who'll you believe?
Reply With Quote
  #17  
Old 04-07-2005, 05:51 AM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
Quote:
Originally Posted by Velox Cruentus
[...] As well as switch statements)
to clarify
In a different manner than with that of the loops.
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #18  
Old 04-07-2005, 10:42 AM
Rick Rick is offline
PipBoy Extraordinaire!
Rick's Avatar
Join Date: Jul 2004
Location: Long Beach, California.
Posts: 831
Rick is on a distinguished road
Break halts execution of any loop.
Reply With Quote
  #19  
Old 04-07-2005, 11:02 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Quote:
Originally Posted by Velox Cruentus
onplayerlogout for NPC-Control.
You mean for scripts on serverside?

Quote:
Originally Posted by Velox Cruentus
triggeraction to all players clientside (insecure, but none-the-less, useful. Such as Chat Messages instead of using the server's CPU for that.)
Since you are not doing that too often it shouldn't be a problem, scripts are not really that slow

Quote:
Originally Posted by Velox Cruentus
public variables accessible by other characters:
VChp := findplayer("Velox Cruentus").clientr.hp;
Whats the problem with that? You mean you want to access other peoples clientr variables on clientside?

Quote:
Originally Posted by Velox Cruentus
OTHER:
Stop the crashing when going between servers (with GUI).
Need to debug that more

Quote:
Originally Posted by Velox Cruentus
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.
makevar(Items.(@ number))
It can only resolve the variable name if the dot is not in a string
Reply With Quote
  #20  
Old 04-07-2005, 07:11 PM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
Quote:
Originally Posted by Stefan
You mean for scripts on serverside?
Yes. On Control-NPC, I have this party system that I wish to remove the person from the party when they leave the server. I resolved that by doing a timeout loop. I do not believe that timeout loops are the best technique, provided that I can do it with a onplayerlogout.


Quote:
Originally Posted by Stefan
Since you are not doing that too often it shouldn't be a problem, scripts are not really that slow
It has actually caused quite considerible lag in the past, I do believe (when players use it as a chat room, and there are 30 players actively talking?)

Quote:
Originally Posted by Stefan
Whats the problem with that? You mean you want to access other peoples clientr variables on clientside?
Yea. It would be a lot neater... Such as -- I'd be able to access the other player's health stats, and perhaps make a heat-sensor a lot dimmer when they have low health, or perhaps other stimuli for it.

Quote:
Originally Posted by Stefan
makevar(Items.(@ number))
It can only resolve the variable name if the dot is not in a string
Okay -- That should do... Although, it does work after the Database NPC was updated.
__________________
In a world of change... Who'll you believe?
Reply With Quote
  #21  
Old 04-08-2005, 01:43 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Quote:
Originally Posted by Velox Cruentus
Yes. On Control-NPC, I have this party system that I wish to remove the person from the party when they leave the server. I resolved that by doing a timeout loop. I do not believe that timeout loops are the best technique, provided that I can do it with a onplayerlogout.
Right now onplayerlogout is only working on clientside. On serverside the problem is that the player object needs to be removed physically because the gserver is saving the player object and updates couldn't be sent to the gserver anymore after player logout, also if the player is logging in again there could be problems if the old player object is still existing. So it could be possible to make a onplayerlogout event but just with the account name as parameter, without being able to access the player object directly.

Quote:
Originally Posted by Velox Cruentus
It has actually caused quite considerible lag in the past, I do believe (when players use it as a chat room, and there are 30 players actively talking?)
Shouldn't be a problem, all messages on Graal Kingdoms are sent by script and there are a lot of them. The same on Zone.

Quote:
Originally Posted by Velox Cruentus
Yea. It would be a lot neater... Such as -- I'd be able to access the other player's health stats, and perhaps make a heat-sensor a lot dimmer when they have low health, or perhaps other stimuli for it.
There are a lot of variables for the players, sharing those would mean a lot of traffic. It is better to use a #P(1..30) parameter, in new scripting player.attr[1..30] because those are visible for all clients. On clientside use #P(1..30,playerindex) for accessing them.
Reply With Quote
  #22  
Old 04-08-2005, 09:59 PM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
Quote:
Originally Posted by Stefan
Right now onplayerlogout is only working on clientside. On serverside the problem is that the player object needs to be removed physically because the gserver is saving the player object and updates couldn't be sent to the gserver anymore after player logout, also if the player is logging in again there could be problems if the old player object is still existing. So it could be possible to make a onplayerlogout event but just with the account name as parameter, without being able to access the player object directly.
That would suffice.

As for the attr's, that too would work quite well!

Thanks.
__________________
In a world of change... Who'll you believe?
Reply With Quote
  #23  
Old 04-10-2005, 08:50 AM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
G3:
PMs with only a smilee don't show up at all.
When answering PMs, the client will suddenly crash.
__________________
In a world of change... Who'll you believe?
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:56 AM.


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