Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-19-2005, 09:00 PM
Fry Fry is offline
Registered User
Fry's Avatar
Join Date: Sep 2001
Location: Germany
Posts: 384
Fry has a spectacular aura about
Also a suggestion: Array enhancement

Well, I'd like to see simple variables that contain string or numerical values be accessable by variable[0], so instead of returning 0/nothing, it should return the value of the variable. Same goes for things like array.add(obj).
That might easen things when working with variables that are stored in the player and can be edited manually. So the script won't just stop working when you forget a "," at the end of the value.
__________________
Graal Statistics

Top 3 servers at the moment (players):


Reply With Quote
  #2  
Old 05-19-2005, 09:10 PM
Ajira Ajira is offline
Poont.
Join Date: Oct 2004
Location: NY, USA
Posts: 477
Ajira is on a distinguished road
Quote:
Originally Posted by Fry
Well, I'd like to see simple variables that contain string or numerical values be accessable by variable[0], so instead of returning 0/nothing, it should return the value of the variable. Same goes for things like array.add(obj).
That might easen things when working with variables that are stored in the player and can be edited manually. So the script won't just stop working when you forget a "," at the end of the value.
I don't understand what you're trying to say. o_O
__________________
Liek omigosh.

Reply With Quote
  #3  
Old 05-19-2005, 09:18 PM
Fry Fry is offline
Registered User
Fry's Avatar
Join Date: Sep 2001
Location: Germany
Posts: 384
Fry has a spectacular aura about
Quote:
Originally Posted by Ajira
I don't understand what you're trying to say. o_O
Sorry, what I meant is, if I've got, as example, client.foo with the value "bar", I want to be able to do things like client.foo.add("qux"); or client.foo[0] (which should then return "bar"). At the moment this only works when the value got a suffixing ",", meaning it gets recognized as an array.
__________________
Graal Statistics

Top 3 servers at the moment (players):


Reply With Quote
  #4  
Old 05-19-2005, 09:19 PM
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 Fry
Well, I'd like to see simple variables that contain string or numerical values be accessable by variable[0], so instead of returning 0/nothing, it should return the value of the variable. Same goes for things like array.add(obj).
That might easen things when working with variables that are stored in the player and can be edited manually. So the script won't just stop working when you forget a "," at the end of the value.
? i think in gscript2 any variable used like var[0] will return the value of the variable (unless you have commas in there, which it would treat as a seperator between string list items), because it's necessary for compatibility with using string lists like that

edit: I think fry is correct, it will not work like I describe
__________________


Last edited by Evil_Trunks; 05-19-2005 at 09:31 PM..
Reply With Quote
  #5  
Old 05-19-2005, 09:22 PM
Fry Fry is offline
Registered User
Fry's Avatar
Join Date: Sep 2001
Location: Germany
Posts: 384
Fry has a spectacular aura about
Quote:
Originally Posted by Evil_Trunks
? i think in gscript2 any variable used like var[0] will return the value of the variable (unless you have commas in there, which it would treat as a seperator between string list items), because it's necessary for compatibility with using string lists like that
Well, okay, but then there are still functions like add(obj) or index(obj).
EDIT: Well, we just tried it, it doesn't work
__________________
Graal Statistics

Top 3 servers at the moment (players):



Last edited by Fry; 05-19-2005 at 09:43 PM..
Reply With Quote
  #6  
Old 05-19-2005, 10:40 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Let me check that I've understood properly. If an array operation is performed on a non-array variable, it should be treated as a single-element array?
__________________
Reply With Quote
  #7  
Old 05-19-2005, 11:54 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
Yea... I do believe that's what he's saying.
__________________
In a world of change... Who'll you believe?
Reply With Quote
  #8  
Old 05-20-2005, 06:58 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 Kaimetsu
Let me check that I've understood properly. If an array operation is performed on a non-array variable, it should be treated as a single-element array?
yeah, that's how a string list should be
__________________

Reply With Quote
  #9  
Old 05-20-2005, 08:03 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
Why?
Reply With Quote
  #10  
Old 05-22-2005, 01:06 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
For compatibility to old script?
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 07:53 AM.


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