Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-01-2006, 11:37 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
My "0" DOES exist! >=O

I'm angry at gscript right now.

I want to append a '0' taken as a substring to the end of a string, but gscript just won't let me. It seems to be converting the 0 to nothing, and adding nothing to the end of a string isn't really considered adding.

Basically..
PHP Code:
temp."0123456789";
temp."abc";
temp.@= temp.a.substring(0,1);
temp.@= temp.a.substring(1,1);
temp.@= temp.a.substring(2,1);
echo(
temp.b); 
The echo is 'abc12'
The 0 is converted to a NULL.

Can we get some functionality to read "0" as 0, instead of nothing? Or maybe a workaround?
Reply With Quote
  #2  
Old 12-01-2006, 11:47 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
PHP Code:
temp."abc123";
temp.@= 0;
temp.@= 1;
echo(
temp.a); 
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #3  
Old 12-01-2006, 11:49 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
Yeah, I noticed that I gave a bad example code and editted it to better reflect the problem.
Reply With Quote
  #4  
Old 12-02-2006, 12:09 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by Yen View Post
Yeah, I noticed that I gave a bad example code and editted it to better reflect the problem.
try
temp.b @= (temp.a.substring(0,1) == "-1"? -1: (float(temp.a.substring(0,1) == -1? temp.a.substring(0,1):float(temp.a.substring(0,1)) ));
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #5  
Old 12-07-2006, 01:08 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
It's fine in my version(s), server-side and client-side. The 0 is correctly seen as string and appended as string. So it should probably work with the next npcserver-update and Graal client version.
Reply With Quote
  #6  
Old 12-07-2006, 03:41 PM
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
And when is that going to happen? D=
Me wants new npc server
__________________

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
Reply With Quote
  #7  
Old 12-07-2006, 10:00 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by coreys View Post
And when is that going to happen? D=
Me wants new npc server

When he feels he's fixed enough bugs worth an actual update?
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:02 PM.


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