lotrointerface.com
Search Downloads


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

Reply
Thread Tools Display Modes
  #1  
Unread 12-01-2010, 08:28 PM
goldbishop goldbishop is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Nov 2010
Posts: 30
Issues with loading plugin

Alright, i have done as much as i can to figure this out but have come up dry.

In game return:
Quote:
...gins\GoldbishopsPlugins\FrameworkReport\__init_ _.lua:1: Failed to import package "GoldbishopsPlugins.FrameworkReport.FrameworkRepor tWindow".
...\Plugins\GoldbishopsPlugins\FrameworkReport\Mai n.lua:2: Failed to import package "GoldbishopsPlugins.FrameworkReport".
Unable to load "frameworkreport".
Code Files
__init__.lua
Quote:
import "GoldbishopsPlugins.FrameworkReport.FrameworkRepor tWindow";
Main.lua
Quote:
import "Turbine";
import "GoldbishopsPlugins.FrameworkReport";

--Setup Framework Report Window
FrameworkReport = FrameworkReportWindow();
FrameworkReport:SetVisible( true );

--FrameworkReport Command
FrameworkReportCommand = Turbine.ShellCommand();

function FrameworkReportCommand:GetHelp()
local h = { query = "used to requery the framework",
help = "returns a list of acceptable commands",
show = "use to show Report Window",
hide = "use to hide Report Window",
toggle = "use to flip visibility of Report Window",
refresh = "use to refresh the Report Window" }
return h;
-- Turbine.Shell.WriteLine
-- for k, v in pairs(h) do
-- help = k .. ": " .. v .. "\n\n"
-- end
end

function FrameworkReportCommand:Execute( command, arguments )
if (arguments == "query") then
--TODO: Add re-querying
-- elseif ( arguments == "help" or arguments == "?" ) then
-- GetCommandHelp;
elseif ( arguments == "show" ) then
FrameworkReport:SetVisible( true );
elseif ( arguments == "hide" ) then
FrameworkReport:SetVisible( false );
elseif ( arguments == "toggle" ) then
FrameworkReport:SetVisible( not FrameworkReport .IsVisible() );
elseif ( arguments == "refresh" ) then
FrameworkReport:Refresh();
end
end

Turbine.Shell.AddCommand( "tob;frameworkreport", FrameworkReportCommand );

--Return the Commands available for the plugin
function GetCommandHelp()

end
Reply With Quote
  #2  
Unread 12-01-2010, 08:31 PM
Digital_Utopia's Avatar
Digital_Utopia Digital_Utopia is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Posts: 207
Send a message via MSN to Digital_Utopia Send a message via Yahoo to Digital_Utopia
Whatever the problem is, it's not in Main, but in your ReportWindow class. When you get that kind of an error message it means basically...

It can't import the package (class) because there's something wrong with it - usually a typographical error as opposed to a logic error.
__________________

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
  #3  
Unread 12-01-2010, 08:35 PM
goldbishop goldbishop is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Nov 2010
Posts: 30
Tried reviewing this file more than a few hours and even rebuilt it several time just in case.

FrameworkReportWindow.lua
Quote:
import "Turbine";
import "Turbine.UI";
import "Turbine.UI.Extensions";
import "Turbine.UI.Lotro";

FrameworkReportWindow = class( Turbine.UI.Extensions.SimpleWindow );

function FrameworkReportWindow:Constructor()
Turbine.UI.Extensions.Window.Constructor( self );

local edgePadding = 25;

self:SetSize( 400, 400 );
self:SetPosition( Turbine.UI.Display.GetWidth() - self:GetWidth() - edgePadding, Turbine.UI.Display.GetHeight() - self:GetHeight() - edgePadding * 1.5 );
self:SetBackColor( Turbine.UI.Color( .5, 0.0, 0.0, 1.0) );
self:SetText( "Framework Report Window" );
self:SetOpacity( 1.0 );
self:SetFadeSpeed( 1.0 );

self:MouseEnter = function( sender, args )
sender:SetOpacity( 1.0 );
end

self:MouseLeave = function( sender, args )
sender:SetOpacity( 0.0 );
end

self.listNamespace = Turbine.UI.ListBox();
self.listNamespace:SetParent( self );
self.listNamespace:SetPosition( 25, 5 );
self.listNamespace:SetSize( 100, 15 );
self.listNamespace:SetVisible( true );

self.listClass = Turbine.UI.ListBox();
self.listClass:SetParent( self );
self.listClass:SetPosition( 150, 5 );
self.listClass:SetSize( 100, 15 );
self.listClass:SetVisible( true );

self.scrollBar = Turbine.UI.Lotro.ScrollBar();
self.scrollBar:SetParent( self );
self.scrollBar:SetOrientation( Turbine.UI.Orientation.Vertical );
self.scrollBar:SetPosition( 375, 0 );
self.scrollBar:SetSize( 25, 400 );
self.scrollBar:SetVisible( true );

self.textBox = Turbine.UI.Lotro.TextBox();
self.textBox:SetParent( self );
self.textBox:SetMultiline( true );
self.textBox:SetReadOnly( true );
self.textBox:SetPosition( 25, 30 );
self.textBox:SetWidth( 350 );
self.textBox:SetVerticalScrollBar( self.scrollBar )
self.textBox:SetVisible( true );

self:Refresh();
end

function FrameworkReportWindow:Refresh()
self:PerformLayout();
end

function FrameworkReportWindow:PerformLayout()
self:Layout( { } );
end

function FrameworkReportWindow:Layout( args )
local width, height = self:GetSize();
end

Last edited by goldbishop : 12-01-2010 at 08:55 PM. Reason: Left the Window section of the filename off.
Reply With Quote
  #4  
Unread 12-01-2010, 08:59 PM
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 tried changing:
Turbine.UI.Extensions.Window.Constructor( self );

to

Turbine.UI.Extension.SimpleWindow.Constructor(self );

?
Reply With Quote
  #5  
Unread 12-01-2010, 09:21 PM
Digital_Utopia's Avatar
Digital_Utopia Digital_Utopia is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Posts: 207
Send a message via MSN to Digital_Utopia Send a message via Yahoo to Digital_Utopia
Quote:
Originally Posted by goldbishop
Tried reviewing this file more than a few hours and even rebuilt it several time just in case.

FrameworkReportWindow.lua
Most of it looks alright, but the following has got me scratching my head (in yellow)

Code:
function FrameworkReportWindow:Refresh()
self:PerformLayout();
end

function FrameworkReportWindow:PerformLayout()
self:Layout( { } );
end

function FrameworkReportWindow:Layout( args )
local width, height = self:GetSize();
end
When you make functions inside a class, they're generally made like so:

Code:
function self:Refresh()
     self:PerformLayout();
end
__________________

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
  #6  
Unread 12-01-2010, 09:38 PM
goldbishop goldbishop is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Nov 2010
Posts: 30
Quote:
Originally Posted by D.H1cks
have you tried changing:
Turbine.UI.Extensions.Window.Constructor( self );

to

Turbine.UI.Extension.SimpleWindow.Constructor(self );

?
Yep....and even tried using the Core Window class and same result. Im sure im missing something but i just cant put my finger on it.

At first it was a semi-colon but still reported same error.

Problem so far seems to be the MouseEnter and MouseLeave functions being declared with a delta function inside the constructor. Pulled them out into the body of the file and worked just grand.


Side Note:
What is the name of the control that acts like a Drop-Down List box?
Reply With Quote
  #7  
Unread 12-01-2010, 09:41 PM
goldbishop goldbishop is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Nov 2010
Posts: 30
Quote:
Originally Posted by Digital_Utopia
Most of it looks alright, but the following has got me scratching my head (in yellow)

Code:
function FrameworkReportWindow:Refresh()
self:PerformLayout();
end

function FrameworkReportWindow:PerformLayout()
self:Layout( { } );
end

function FrameworkReportWindow:Layout( args )
local width, height = self:GetSize();
end
When you make functions inside a class, they're generally made like so:

Code:
function self:Refresh()
     self:PerformLayout();
end
Think of those as stationary templates....till i get to the point of actually implementation.
Reply With Quote
  #8  
Unread 12-01-2010, 09:43 PM
D.H1cks's Avatar
D.H1cks D.H1cks is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Apr 2007
Posts: 162
Ah, try changing them to self.MouseEnter = function(sender,args) and self.MouseLeave = function(sender,args) ?

This is what I have in my plugin:
Code:
	self.MouseEnter = function(sender, args)
		self:SetBackColor(self.bgColor);
	end

	self.MouseLeave = function(sender, args)
		self:SetBackColor(Turbine.UI.Color(0,0,0,0));
	end

Last edited by D.H1cks : 12-01-2010 at 09:46 PM.
Reply With Quote
  #9  
Unread 12-01-2010, 09:47 PM
goldbishop goldbishop is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Nov 2010
Posts: 30
when doing that signature do i need to have it all on one line or can i split it up across several lines as long as the end tag is there?

I borrowed the code from their Plugis templates provided by the packages. For some reason it didnt like them in my plugin. Thinking im missing some Import or something.
Reply With Quote
  #10  
Unread 12-01-2010, 10:15 PM
D.H1cks's Avatar
D.H1cks D.H1cks is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Apr 2007
Posts: 162
OK, I have to go back a step here and ask. Is there really a space between the r and t in your __init__.lua file? As in
Code:
FrameworkReport.FrameworkRepor tWindow
Reply With Quote
Reply


Thread Tools
Display Modes

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
issues with setting up UI rawdoggie Interface Help (L) 5 11-19-2010 12:38 PM
Loading creates Error Heta Lua Programming Help (L) 0 11-13-2010 09:38 AM
Help with vital issues... Putnal08 Interface Help (L) 10 10-21-2009 05:21 AM
UI not loading correctly Kiryan Interface Help (L) 5 04-01-2009 08:53 PM
Help with loading multiple UIs Crumby Interface Help (L) 0 07-06-2007 06:45 PM


All times are GMT -5. The time now is 03:06 PM.


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