Valkenar Beginner
Joined: 12 Aug 2009 Posts: 15
|
Posted: Fri Jun 18, 2010 11:12 pm
[3.20] Variables in class with lua |
My expectation is that if I have a class with the "set as default when executing" box checked, then variables created by aliases in that class should also be inside that class. If that's not true then the rest of this is irrelevant.
Given a class with an alias in that uses the zs.var object to create a variable, like so
Code: |
<class name="Aliastest" setdefault="true" id="30">
<alias name="CreateVariable" language="Lua" id="31">
<value>print("Creating variable")
zs.var.mytestvar = "It exists"</value>
</alias>
</class>
|
If you execute this alias, the variable is created in the package root, rather then inside the "Aliastest" class. Is this expected behavior, or a bug?
If it's expected behavior, what's the recommended method for creating variables inside specific classes? Ideally an answer in lua code would be best, but an answer in zscript would be welcome also. Is it necessary to use makevar for this?
If the answer is makevar, then how do you get to a variable that is two classes deep?
Thanks, and nice work getting 3.20 out. |
|