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 05-04-2005, 07:09 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
Functions & Parameters

Functions should be able to handle extra parameters that are undeclared, much like trigger events:

PHP Code:
// EVENT
  
player.trigger("addWeapons","Message","TempPlayer","Login");
// CLOSE EVENT

public function onaddWeapons()
{
  for (
weapparams)
    
this.addWeapon(weap);

To...

PHP Code:
// EVENT
  
player.addWeapons("Message","TempPlayer","Login");
// CLOSE EVENT

public function addWeapons()
{
  for (
weapparams)
    
this.addWeapon(weap);

While I'm at it -- You may as well add a addWeapons() function O,o; It might serve it's purpose... Or let everyone who wants to do that do like me?

Reenable this.destroy() == Deleting the weapon
(client & serverside) and let protectedweapon prevent it from deleting serverside?

Umm... Removing weapons with GUI Control doesn't delete the GUI Control.
__________________
In a world of change... Who'll you believe?
Reply With Quote
  #2  
Old 05-04-2005, 07:35 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by Velox Cruentus
Functions should be able to handle extra parameters that are undeclared
Since when did we declare parameters for functions?
__________________
Reply With Quote
  #3  
Old 05-04-2005, 08:07 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
Since GS2?

function addWeapons(parameter,parameter)?
__________________
In a world of change... Who'll you believe?
Reply With Quote
  #4  
Old 05-04-2005, 08:11 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by Velox Cruentus
function addWeapons(parameter,parameter)?
Huh. I don't remember naming the params, but I suppose I haven't used GS2 in over a year now.

Why don't you just accept an array as one of the parameters?
__________________
Reply With Quote
  #5  
Old 05-04-2005, 05:57 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
Yes you can pass parameters as array, like myfunction(p1,p2,{p3,p4,p5}), then
function myfunction(p1,p2,openparams) {
echo(p1 @ "," @ p2 @ "," @ openparams[0] @ "," @ openparams[1]); // etc.
}
Reply With Quote
  #6  
Old 05-05-2005, 03: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
Thanks -- Although, it's a weird way to do such thing.

This should go in Tech:
fuction x(){ return {list};}

sendtonc(x());
== CRASH!

This should go here, however ('creates new thread')
return should be able to return string lists?

This too:

Instead of saving the strings with """Text""" in a string list, you could do:

{"Test","Other"}

Where everything in the " to the last " aren't shown, and the "'s in text can be worked out with the escape character, such as: \"
Thus:
{"John: And then, bobby said \"Maipas!\","Billy: No?! REALLY!?"}
INSTEAD OF:
"John: And then, bobby said ""Maipas!""","Billy: No Really?!"

If would make the strings a lot more readable, especially in multidimensional arrays:
"Ditto,""prop,prop"",Ditto,""prop,prop""","Ditto," "prop,prop"""",prop""""""","Ditto,""prop,"""
Instead of:
{{"Ditto",{"prop","prop"},"Ditto",{"prop","prop"}} ,{"Ditto",{"prop","prop"}}}

The second form is a lot easier to read then the first one, and we can establish a more direct meaning between the tring being a string, string list, or variable.
__________________
In a world of change... Who'll you believe?
Reply With Quote
  #7  
Old 05-10-2005, 11:58 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
This should go in Tech:
fuction x(){ return {list};}

sendtonc(x());
== CRASH!
It's crashing the npcserver?
Reply With Quote
  #8  
Old 05-11-2005, 12:47 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
... Yea?
__________________
In a world of change... Who'll you believe?
Reply With Quote
  #9  
Old 05-11-2005, 12:58 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
Uhhh, you can already use escape sequences for strings.
Reply With Quote
  #10  
Old 05-11-2005, 01:02 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
I was referring to the string lists... In /open Velox Cruentus list.... O,o;
__________________
In a world of change... Who'll you believe?
Reply With Quote
  #11  
Old 05-15-2005, 12:14 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
I agree with Velox, having string arrays saved as:
string=1,2,"3,32,33",4
istead of something like:
string={1,2,{3,32,33},4}
is annoying.
__________________
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 11:31 AM.


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