Newbie: Simple window
Hi,
i'd like to start with programming plugins. I'd like to make first a simple window, but i make something wrong: I have a file : window.lua - here a tried many variations. At the moment it starts as follow Code:
import "Turbine"; The I have a file : main.lua Code:
import "Fido.simple.Window" Code:
<?xml version="1.0"?> Code:
...d of the Rings Online\Plugins\Fido\simple\Window.lua:5: attempt to call global 'class' (a nil value) Thanks for help. Fido |
Have you downloaded and installed the Turbine utility files? I believe 'class' is part of them.
|
try
Window = Turbine.UI.Lotro.GoldWindow(); |
|
Thanks for suggestions. I've already installed the Turbine plugins. But it still doesn't work. When I use the call as Fortunis suggested, I get the same error but in the main.lua. All other plugins work perfectly. I suppose the file structure or naming is wrong. My directory looks as follow
Code:
Plugins |
K, just thinkling on it more i remember coming across this when i decided to use multiple LUA files.
I recall there being a problem with calling functions from another lua, with colons ':' . Instead of using- function Window:Constructor() try function Window() and then go from there on tweeking it. |
Your "imports" do not include the path to the Class.lua file. You need to add:
import Turbine.Utils and your original code will work. A word of advice, it is simpler to copy the Turbine sample files that you find yourself using into your own project and import them from there. That way if you ever build something worthy of publishing you won't have to worry about users having the Turbine samples. You also won't have to worry about changes to the Turbine samples breaking your plugin (back in November, Turbine moved the Class.lua file from one folder to another and broke a number of plugins). |
Fortunis, that import was it. Thanks a lot! I created a new project just to understand the structure and dependencies. Generally I agree with you.
Now I can really start :) I suppose it wasn't the last post :) Fido |
All times are GMT -5. The time now is 08:05 PM. |
vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI