lotrointerface.com
Search Downloads


Go Back   LoTROInterface > LotRO > Developer Discussions > Lua Programming Help (L)

Reply
Thread Tools Display Modes
  #1  
Unread 07-30-2011, 03:05 AM
Fido Fido is offline
The Undefeated
 
Join Date: Jul 2011
Posts: 6
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";
import "Turbine.UI";
import "Turbine.UI.Lotro";

Window = class( Turbine.UI.Lotro.GoldWindow );

function Window:Constructor()
Turbine.UI.Lotro.GoldWindow.Constructor( self );
...
Here I've copied the code from Turbine examples.
The I have a file : main.lua
Code:
import "Fido.simple.Window"
window = Window();
window:SetVisible(true);
and : simpleLotro.plugin
Code:
<?xml version="1.0"?>
<Plugin>
	<Information>
		<Name>simpleLotro</Name>
		<Author>Fido</Author>
		<Version>0.1</Version>
	</Information>
	<Package>Fido.simple.main</Package>
</Plugin>
But in game I get the error:
Code:
...d of the Rings Online\Plugins\Fido\simple\Window.lua:5: attempt to call global 'class' (a nil value)
I've tried with other Windows, but it is always the same error. What is the problem?
Thanks for help.
Fido
Reply With Quote
  #2  
Unread 07-30-2011, 06:11 AM
D.H1cks's Avatar
D.H1cks D.H1cks is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Apr 2007
Posts: 162
Have you downloaded and installed the Turbine utility files? I believe 'class' is part of them.
Reply With Quote
  #3  
Unread 07-30-2011, 07:09 AM
Fortunis's Avatar
Fortunis Fortunis is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Mar 2011
Location: Leeds, UK
Posts: 72
try

Window = Turbine.UI.Lotro.GoldWindow();
__________________
Author of Mouse Cursor Highlighter Advanced
Reply With Quote
  #4  
Unread 07-31-2011, 06:46 AM
Digital_Utopia's Avatar
Digital_Utopia Digital_Utopia is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Posts: 207
Quote:
Originally Posted by D.H1cks
Have you downloaded and installed the Turbine utility files? I believe 'class' is part of them.
^ This.

The utility files are part of the example plugins and can be found here. You will need 7zip to open the archive.
__________________

Lord of the Rings Online
75 Fourohfour | 75 Artemedis | 60 Whiskeytango Foxtrot | 50 Mistah Boombastic | 56 Appetizer | 25 Aggromi
61 Onepointtwentyone Gigawatts


World of Warcraft
90 Downlo 85 Gravetaxi 85 Ümad 85 Artemedis 85 Guthuros
Reply With Quote
  #5  
Unread 07-31-2011, 12:30 PM
Fido Fido is offline
The Undefeated
 
Join Date: Jul 2011
Posts: 6
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
+->Fido
   +-> simple.plugin
   +-> simple (directory)
       +-> __init__.lua (is empty)
       +-> main.lua
       +-> Window.lua
Fido
Reply With Quote
  #6  
Unread 07-31-2011, 01:46 PM
Fortunis's Avatar
Fortunis Fortunis is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Mar 2011
Location: Leeds, UK
Posts: 72
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.
__________________
Author of Mouse Cursor Highlighter Advanced

Last edited by Fortunis : 07-31-2011 at 01:49 PM.
Reply With Quote
  #7  
Unread 07-31-2011, 05:25 PM
Garan's Avatar
Garan Garan is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Oct 2010
Posts: 341
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).

Last edited by Garan : 07-31-2011 at 05:32 PM.
Reply With Quote
  #8  
Unread 08-01-2011, 11:58 AM
Fido Fido is offline
The Undefeated
 
Join Date: Jul 2011
Posts: 6
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
Reply With Quote
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Skirmish window and Item selection window mysticdrew Graphics modification help (L) 3 02-02-2011 08:21 AM
Total newbie help, hopefully a simple question alyssandra General Authoring Discussion (L) 5 12-03-2010 03:47 PM
Newbie Drowning In A Sea Of XML! Emberleaf XML modification help (L) 4 10-24-2010 08:13 PM
Dark and simple Lazer121 Interface Requests (D) 0 04-27-2008 05:49 PM
Newbie help! Zhara Chit Chat 3 08-15-2007 04:15 PM


All times are GMT -5. The time now is 01:17 PM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui