Graal Forums  

Go Back   Graal Forums > Private forums > Graal4 Forums > Graal V4 Main Forum
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 09-23-2005, 02:33 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
Global Functions

A nifty addition to the game would be able to establish functions on a global scope (Functions accessible to all npcs).
Maybe have all NPCs automatically run this on creation: "function onCreated() this.join("globalfunc");"

This would be very appreciated, and quite useful.

e.g.:
PHP Code:
CLASS_GlobalFunc
function reportIn()
{
  echo(
"Reporting " this.id " in " this.level "(" this."," this.").");

&
PHP Code:
LOCAL_NPC
function onCreated()
{
  
reportIn();

__________________
In a world of change... Who'll you believe?
  #2  
Old 09-23-2005, 03:04 AM
ForgottenLegacy ForgottenLegacy is offline
-Backtoscripts-
Join Date: Aug 2003
Location: California
Posts: 289
ForgottenLegacy is on a distinguished road
Send a message via AIM to ForgottenLegacy
It would be easier to make a functionlibrary class and have a player.weapons loop, with findweapon, and with a join() function. You can use the function 'isinclass(str)' to check to see if the weapon is already in the class. Have a clientside part of the script run, while watching a checksum of the weapons to see if any changes have been made, and if so, run the serverside loop to join every weapon to the class.

Worth a try.
__________________
"The higher you fly, the harder it is to breathe."

[Kaidenn] Maybe I will somehow take control of Lance's body when he isn't looking, have him log onto Kingdoms, update one script, and leave.
[Kaidenn] And leave him exactly where I found him, unchanged and completely unnaware of what just took place the last two minutes.
[GrowlZ] Lance: You might want to lock your bedroom door tonight
  #3  
Old 09-23-2005, 08:12 PM
ChibiChibiLuc ChibiChibiLuc is offline
Cookie Monster. :3
Join Date: Jan 2005
Location: Nova Scotia, Canada
Posts: 111
ChibiChibiLuc is on a distinguished road
Send a message via AIM to ChibiChibiLuc Send a message via MSN to ChibiChibiLuc
Ooor we could just have a global functions class that's automatically joined.. >_>
But yeah, I'd love to have a globally joined class.


I'd also like to see the ability to join classes with clientside functions to a player, so we can call them without going to the serverside..

PHP Code:
Player-joined class
//#CLIENTSIDE
public function Dist(myx,myy,gotox,gotoy) {
  
distx gotox myx;
  
disty gotoy myy;
  return (
distx^disty^2) ^ .5;

PHP Code:
NPC Weapon
//#CLIENTSIDE
function onWeaponfired() {
  
somex int(random(0,64));
  
somey int(random(0,64));
  
player.chat player.Dist(player.x,player.y,somex,somey);


-Coughs.- Aaanyway..
  #4  
Old 09-25-2005, 04:10 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
How about making it so public functions in the Control-NPC can be called without using ("Control-NPC").function();
__________________
  #5  
Old 09-25-2005, 06:17 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
public function already exists. it has for a while, my friend yaharii has used it many times.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
  #6  
Old 09-25-2005, 08:01 AM
DarkFireXZ3 DarkFireXZ3 is offline
Owner - Kudosai
Join Date: May 2005
Location: Texas
Posts: 84
DarkFireXZ3 is on a distinguished road
Send a message via ICQ to DarkFireXZ3 Send a message via AIM to DarkFireXZ3 Send a message via MSN to DarkFireXZ3 Send a message via Yahoo to DarkFireXZ3
Hmm, I'm gonna mess around with those functions out of boredom and i have no one on my server execpt Idling staff members. =] So for no complaining of what i do, eh?
__________________
Email: [email protected]
Yahoo: [email protected]
Aim: DarkFireXZ3







 


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 02:54 PM.


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