Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   clientr.var inconsistancy (https://forums.graalonline.com/forums/showthread.php?t=134256117)

DustyPorViva 09-17-2009 07:00 PM

clientr.var inconsistancy
 
I set various clientr.vars with my system. For example, I have one that increases a clientr.var whenever I slash a bush, like so:
findplayer(params[1]).clientr.bushstat += params[2];
Which increases appropriately by params[2].

However, I also have clientr.vars that enables/disables certain modes in my system, like so:
findplayer(params[1]).clientr.enablesword = params[2];
Which sets it to true/false.

The first example shows up in my client.vars list in RC. The second does not. The second is recognized by scripts however(as my scripts function fine), but like I said... it doesn't appear in my player attributes on RC. Does this have to do with true/false being used in client.vars or something?

Mark Sir Link 09-17-2009 07:10 PM

Quote:

Originally Posted by DustyPorViva (Post 1523660)
I set various clientr.vars with my system. For example, I have one that increases a clientr.var whenever I slash a bush, like so:
findplayer(params[1]).clientr.bushstat += params[2];
Which increases appropriately by params[2].

However, I also have clientr.vars that enables/disables certain modes in my system, like so:
findplayer(params[1]).clientr.enablesword = params[2];
Which sets it to true/false.

The first example shows up in my client.vars list in RC. The second does not. The second is recognized by scripts however(as my scripts function fine), but like I said... it doesn't appear in my player attributes on RC. Does this have to do with true/false being used in client.vars or something?

if the flag is set to true, it will appear in the list, if it is false, it won't.

If it doesn't exist, it will evaluate to false.

DustyPorViva 09-17-2009 07:26 PM

Quote:

Originally Posted by Mark Sir Link (Post 1523662)
if the flag is set to true, it will appear in the list, if it is false, it won't.

If it doesn't exist, it will evaluate to false.

Hmm... guess I never thought of that, however I can't remember if I encounted the problem even if it was true or not. Ah well!

Mark Sir Link 09-17-2009 07:30 PM

Quote:

Originally Posted by DustyPorViva (Post 1523664)
Hmm... guess I never thought of that, however I can't remember if I encounted the problem even if it was true or not. Ah well!

it seems like it may be functioning similar to how set and unset flags used to work in GS1 (mostly pre-NPC Server) where flags were being used as booleans quite a bit.

Twinny 09-18-2009 02:36 AM

It is annoying and I've been caught out a few times but this but any string with a null value disappears =(

Admins 09-19-2009 12:56 AM

False/null/"" is the default value, if you set a network string (client., clientr, server., serverr.) to such value then it is removed, means less data to send and an easy way to clear variables.


All times are GMT +2. The time now is 04:46 AM.

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