Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Tech Support (https://forums.graalonline.com/forums/forumdisplay.php?f=7)
-   -   Client strings (https://forums.graalonline.com/forums/showthread.php?t=57820)

Skyld 02-26-2005 07:36 PM

Client strings
 
I have noticed that with the new scripting engine enabled, it is not possible to have a client. or clientr. string that is equal to "0".
For example, "clientr.mp=0" in Attributes will simply remove "clientr.mp" from the list of client strings, making it hard for some GUI scripts to show the correct information.
I think this is probably because the new engine returns a non-existent string as 0.
Could this be fixed?

Ajira 02-26-2005 07:39 PM

Could you do clientr.mp = "0" making the value a character rather than an integer?

Skyld 02-26-2005 07:45 PM

No, that does the same thing. :confused:

Evil_Trunks 02-26-2005 10:22 PM

PLEASE change this

we don't like it either on Classic

right now our gui does something like this

showtext x,y,,,#v(strtofloat(#s(clientr.bombs)));

Admins 02-27-2005 04:21 AM

Yes you need to use strtofloat if you want to make sure it is a number, there is no way to avoid that. It is really needed for compatibility with old Graal script:

set varname; -> translated into varname = true; -> varname = 1;
unset varname; -> translated into varname = false; -> varname = 0; -> var is removed

In old Graal script the if (varname) command is just checking if the variable is existing, not if the value is non-zero. So to make unset work correctly it needs to remove the variable. This is also very nice for removing data that is not needed anymore, just set it to zero or empty string for removing it.


All times are GMT +2. The time now is 06:27 PM.

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