Lineaxe Posted May 28, 2020 Posted May 28, 2020 lua syntax for using objects such as a zone ,or a SET_GROUP as arguments inside of functions. In c++ you set up pointers in general , so that you don't pass the whole object over.. you could do it that way as well of course , but mostly pointers are the better way to go. So if I want to access global variables (I created for using the moose clasees ) that are zone objects , Group objects , group sets and so on, what is the best syntax for doing this in lua ? heh so many computer languages and they all want to do it a different way!!! :megalol:
Pikey Posted May 28, 2020 Posted May 28, 2020 I don't know of any pointers or equivalent in Lua, I pass the variable. Your question is best served on stack exchange or by looking thorugh the Lua online manual. ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *
Lineaxe Posted May 29, 2020 Author Posted May 29, 2020 oh, well the syntax I experimented with didnt work so I looked through all the lua info I could get and then tried looking for some sample code so I can use that syntax and it will work. the more I looked into functions online last night ,the more I ... ... ...
Lineaxe Posted May 29, 2020 Author Posted May 29, 2020 (edited) sample code please . I am working away on other little areas in my coding but my function calls with zone objects are failing at the moment. Must be in the syntax somewhere. Just tried putting the object in and it says it's nil . Not initialized I imagine. The global of course IS initialized and used in other parts of the code. including inside the function that I want to put it in as a argument. OK : Syntax that was missing is as follows: Place functions at bottom of code that initializes it . That way objects get recognized. Makes sense of course . I finally got a piece of code ,an event handler, which showed this clearly. Oh Well , so many computer languages to program in, just like human languages I guess. Next week I will forget this whole thing... Edited May 30, 2020 by Lineaxe more typing corrections
Recommended Posts