lotrointerface.com
Search Downloads


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

Reply
 
Thread Tools Display Modes
  #1  
Unread 09-12-2014, 12:57 PM
Garan's Avatar
Garan Garan is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Oct 2010
Posts: 344
Actors will be in Turbine.Gameplay not Turbine.UI as they are game objects not UI objects. Additionally, the local player is a special case, a couple of years ago Turbine ran into some issues using the Turbine.Gameplay.LocalPlayer reference so they resolved this by making us get an instance of the local player by calling Turbine.Gameplay.LocalPlayer:GetInstance(). So, an Entity with a blue background in the middle of a simple test window would look like this:
Code:
testWindow=Turbine.UI.Lotro.Window()
testWindow:SetSize(400,400)
testWindow:SetVisible(true)

testEntity=Turbine.UI.Lotro.EntityControl()
testEntity:SetParent(testWindow)
testEntity:SetPosition(180,180)
testEntity:SetSize(40,40)
-- just setting the backcolor so we can see where to click
-- you would want to put an icon in the background of the control or stick a label with MouseVisible set false (so clicks pass through to the Entity) in front of it or some other fancy UI display.
testEntity:SetBackColor(Turbine.UI.Color.Blue)
-- this gets an instance of the local player and assigns it to the Entity control
testEntity:SetEntity(Turbine.Gameplay.LocalPlayer.GetInstance());
If you have AltInventory or MoorMap (or most of my plugins) you can access a Debug window - in MoorMap you simply load the plugin then use the chat command "/moormap debug on". Then you can paste the above code (or any code you want to test/execute) in the Command text and click Execute. Note that this code will run in the private MoorMap apartment and will not have access to other plugins' objects or variables (each private Apartment gets it's own Lua environment complete with a private copy of all of Turbine's objects). Even with that limitation it is a quick and easy way to dynamically test Lua code as well as providing the ability to watch variables and explore the environment. Remember to use "/moormap debug off" when you are done or MoorMap will be in debug mode whenever loaded until you do execute "/moormap debug off" (or uncheck the Debug option at the bottom of the MoorMap options window).

I would suggest you check out the thread:
https://www.lotro.com/forums/showthr...gins-for-Noobs

Its gotten buried pretty far down the forum list since I haven't published anything new there lately but it will probably answer a lot of your questions if you are new to using Lua in LotRO.

Last edited by Garan : 09-12-2014 at 01:12 PM.
Reply With Quote
  #2  
Unread 09-12-2014, 01:15 PM
artouiros artouiros is offline
The Undefeated
 
Join Date: Sep 2014
Posts: 6
Quote:
Originally Posted by Garan
Actors will be in Turbine.Gameplay not Turbine.UI as they are game objects not UI objects. Additionally, the local player is a special case, a couple of years ago Turbine ran into some issues using the Turbine.Gameplay.LocalPlayer reference so they resolved this by making us get an instance of the local player by calling Turbine.Gameplay.LocalPlayer:GetInstance(). So, an Entity with a blue background in the middle of a simple test window would look like this:
Code:
testWindow=Turbine.UI.Lotro.Window()
testWindow:SetSize(400,400)
testWindow:SetVisible(true)

testEntity=Turbine.UI.Lotro.EntityControl()
testEntity:SetParent(testWindow)
testEntity:SetPosition(180,180)
testEntity:SetSize(40,40)
-- just setting the backcolor so we can see where to click
-- you would want to put an icon in the background of the control or stick a label with MouseVisible set false (so clicks pass through to the Entity) in front of it or some other fancy UI display.
testEntity:SetBackColor(Turbine.UI.Color.Blue)
-- this gets an instance of the local player and assigns it to the Entity control
testEntity:SetEntity(Turbine.Gameplay.LocalPlayer.GetInstance());
If you have AltInventory or MoorMap (or most of my plugins) you can access a Debug window - in MoorMap you simply load the plugin then use the chat command "/moormap debug on". Then you can paste the above code (or any code you want to test/execute) in the Command text and click Execute. Note that this code will run in the private MoorMap apartment and will not have access to other plugins' objects or variables (each private Apartment gets it's own Lua environment complete with a private copy of all of Turbine's objects). Even with that limitation it is a quick and easy way to dynamically test Lua code as well as providing the ability to watch variables and explore the environment. Remember to use "/moormap debug off" when you are done or MoorMap will be in debug mode whenever loaded until you do execute "/moormap debug off" (or uncheck the Debug option at the bottom of the MoorMap options window).

I would suggest you check out the thread:
https://www.lotro.com/forums/showthr...gins-for-Noobs

Its gotten buried pretty far down the forum list since I haven't published anything new there lately but it will probably answer a lot of your questions if you are new to using Lua in LotRO.
And againg thanks you. I'm really glad, that now I know how this work. I was trying to do the same, but it didin't work because I had some other Controls on top of Entity control. THanks for advice on using SetMouseVisible(false), Solved. Thanks for the link also.

Last edited by artouiros : 09-12-2014 at 01:18 PM.
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
Party / Raid Display Elrigh Interface Requests (L) 0 05-17-2013 04:58 AM
How to access the party info now available? KRc Lua Programming Help (L) 16 10-05-2011 02:17 AM
Horizontal Party bars Greytail Interface Requests (L) 4 03-25-2011 10:51 AM
Getting Party member names Zyriel Interface Help (L) 4 01-20-2011 05:53 PM
Good UIs for Crafting Panel and Fellowship member layout Eoblaed Interface Requests (L) 3 07-07-2010 09:31 PM


All times are GMT -5. The time now is 05:08 AM.


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