Class variables and working project
by Ricardo Vladimiro · in Torsion · 03/18/2007 (11:13 am) · 3 replies
Hey everyone and Tom who I "met" at Sickhead forums.
I have two questions/issues/"things with pointy ears" that follow me and Torsion, maybe someone can shed a light.
First is a variable inside a class object. If I use any variable inside a class, anywhere on the script, auto-complete never shows it. It does show all the methods, local and global variables, but any %obj.var never appears. This may mean 1 of 3 things: it's as designed and that's ok and not a problem and I'll just shut up. :) It's not as designed and then Tom may have it written somewhere, I'll shut up and wait. :) or there's a solution. From the top of my head and without testing, maybe having defined datablocks for each class would solve it. If so, tell me, I'll just shut up and work on my datablocks.
Second thing is more of a behaviour. I would love to work on each project without having a load of stuff on auto-complete that belongs to another project. Think of it as each project as a closed sandbox. But all my projects get auto-completes from all other projects. Am I doing anything wrong?
By the way guys at Sickhead, keep it up! It's a great tool you have here.
I have two questions/issues/"things with pointy ears" that follow me and Torsion, maybe someone can shed a light.
First is a variable inside a class object. If I use any variable inside a class, anywhere on the script, auto-complete never shows it. It does show all the methods, local and global variables, but any %obj.var never appears. This may mean 1 of 3 things: it's as designed and that's ok and not a problem and I'll just shut up. :) It's not as designed and then Tom may have it written somewhere, I'll shut up and wait. :) or there's a solution. From the top of my head and without testing, maybe having defined datablocks for each class would solve it. If so, tell me, I'll just shut up and work on my datablocks.
Second thing is more of a behaviour. I would love to work on each project without having a load of stuff on auto-complete that belongs to another project. Think of it as each project as a closed sandbox. But all my projects get auto-completes from all other projects. Am I doing anything wrong?
By the way guys at Sickhead, keep it up! It's a great tool you have here.
#2
Thanks for the clarification. Since you are considering further implementation on this, I'll elaborate further. I create all my objects through script, thus initialization of variables is done by factories of objects and creators of objects and by doing so I completely neglect the use of datablocks. As you can see in my first post, I had an idea that the use of datablocks would solve it. Don't ask why, I just considered it time and time again. You wouldn't know the type anyway, but maybe there could be some relation. Just out of my head thoughts.
On my second question: I do get auto-completes from my other projects. Let me check my configurations and I'll get back to you.
EDIT: One thing. I work with 2 monitors and Torsion never assumes the second monitor. Most apps I use do that, meaning, if I move an app to the 2nd monitor it will always start in it. No matter how much I move Torsion to monitor 2, it always assumes monitor 1.
03/19/2007 (1:32 am)
Hey TomThanks for the clarification. Since you are considering further implementation on this, I'll elaborate further. I create all my objects through script, thus initialization of variables is done by factories of objects and creators of objects and by doing so I completely neglect the use of datablocks. As you can see in my first post, I had an idea that the use of datablocks would solve it. Don't ask why, I just considered it time and time again. You wouldn't know the type anyway, but maybe there could be some relation. Just out of my head thoughts.
On my second question: I do get auto-completes from my other projects. Let me check my configurations and I'll get back to you.
EDIT: One thing. I work with 2 monitors and Torsion never assumes the second monitor. Most apps I use do that, meaning, if I move an app to the 2nd monitor it will always start in it. No matter how much I move Torsion to monitor 2, it always assumes monitor 1.
#3
The syntax now used in Codeweaver is much nicer than it used to be:
07/13/2008 (10:05 pm)
Sorry to bring up an old thread, but...Quote:The Codeweaver developer asked me to support a common standard like this, but i was hesitant to do so at the time as i wanted to find a better way to do this. So far i don't have any really great alternatives other than an idea about a two tiered autocomplete step... once for selecting the type, then again to select the member you were looking for.I was just wondering if anything was ever implemented to solve this problem? This one feature is the only reason we currently use CodeWeaver over Torsion (although Torsion is superior in several other areas).
Anyway... i'm gonna get something implemented to solve this soon.
The syntax now used in Codeweaver is much nicer than it used to be:
//# DECLARE %obj as t2dSceneObjectThe syntax used in TorquEdit (which, unfortunately, is too buggy to use) is even nicer:
//# %obj t2dSceneObjectSeeing that this would be a relatively simple feature to implement, I don't see why it hasn't been yet.
Associate Tom Spilman
Sickhead Games
No need to "shut up" in any way... please feel free discuss about anything you feel is missing or broken. I want to address all of it in upcoming releases.
Ok... so your case is something like this i guess.
function MyClass::someFunction( %this, %obj ) { %this.var // this will produce autocomplete info. %obj.var // this will not }The %this works because i can assume the type is of MyClass... i make this assumption only for %this if the function has a namespace. Since i don't know what %obj is i cannot show accurate autocomplete info. I opted to no display it rather than display bad info for 1.0.
Codeweaver started a standard sort of like this...
function MyClass::someFunction( %this, %obj ) { // __declare %obj as MyClass %obj.var // this now works! }The Codeweaver developer asked me to support a common standard like this, but i was hesitant to do so at the time as i wanted to find a better way to do this. So far i don't have any really great alternatives other than an idea about a two tiered autocomplete step... once for selecting the type, then again to select the member you were looking for.
Anyway... i'm gonna get something implemented to solve this soon.
On your secound question... you shouldn't be seeing autocomplete info for different projects unless you mean different mod folders within your project. Like seeing info for starter.fps and starter.racing at the same time. That happens because by default it parses all the mod folders in the project. If you go to your project settings and enter the specific mods you want to include in the "Mods" setting this should go away.
Hope this helps and thanks for the praise.