TStaticVar()
so i think i get it, but i'm not sure and looking for some outside output. Anyone want to explain TStaticVar() to me? It's usage.. downsides of using it. anything really. thanks in advance for any help
|
It's useful for when you want to create an object to pass to another function or script. It also provides a clean object slate that doesn't have all the predefined Graal variables.
PHP Code:
3 5 no x or y detected 3 5 |
Noobject. Liking the term.
|
thanks, i think i understand it a lot better now. So last things i can think of to ask is, I've seen code with the same format. but they looked different. does it act the same? being a blank object and everything? And could I actually use this to say.. pass a GUI through a function? (just brainstorming possibilities)
I was looking for another sample, but i'll just post the one that i do have: PHP Code:
the second one i remember was completely different. same format but customized name. thanks |
Hmm, I know I have used this before. But I think I lacked some understanding. Is there anyone that can explain any differences between using a TStaticVar() vs something like savevarstoarray() and loadvarsfromarray() ? In the past I have used both of them to preserve variables such as temp.obj.var.
|
Quote:
e.g. triggers PHP Code:
|
Quote:
Sorry if it sounds like a noob question just the overwhelming lack of documentation for GScript2 makes understanding somewhat difficult at times. Also, thanks FP4 for the reply. Ans also not trying to hijack the thread. It's still relevant to discussion of the TStaticVar. |
Quote:
This won't work going across serverside/clientside, of course -- you'll need to serialize in this case. Also iirc savevarstoarray on a non-TStaticVar will include the random built-in object properties (stuff like initialized, joinedclasses, timeout, ...) in at least some cases. But I can't remember if that's true or not. |
Quote:
|
Interesting however I am a little confused. So TStaticVar includes object properties... but from where? Does this mean like the player properties if the TStaticVar is a player object, or if I create an object that has properties and then create a TStaticVar of the object?
|
Quote:
e.g. PHP Code:
|
All times are GMT +2. The time now is 07:27 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.