View Single Post
  #6  
Unread 10-06-2022, 05:21 PM
Garan's Avatar
Garan Garan is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Oct 2010
Posts: 340
Quote:
Originally Posted by Flan
So this is the problem i have ran into!
... Rings Online\Plugins\TurbinePlugins\Vitals\Main.lua:14: attempt to call field 'Entity' (a nil value)

I am completely new to lua programming and definitely plugins so if you could help me more it would be appreciated!

I just want the Its You "name"!!!!! option menu
Oops. My error - I didn't pay attention, the forums added a space in the name of the control and changed the 'C' to lowercase. I hate when forums think they know better... grrrr
Anyway, the control is
Code:
Turbine.UI.Lotro.EntityControl()
I erroneously copied just the Turbine.UI.Lotro.Entity in my example. It should have been:
Code:
myEntity=Turbine.UI.Lotro.EntityControl()
myEntity:SetEntity(Turbine.Gameplay.LocalPlayer:GetInstance())
You need to explicitly include each part of the namespace, so you should have:
Code:
include Turbine
include Turbine.UI
include Turbine.UI.Lotro
usually in your main lua file.

I would recommend that you find an existing plugin that uses an EntityControl and see how it is used in practice. There are tons of other plugins and I am sure at least one uses an EntityControl. I would start by searching plugins with the key word 'Vitals' and download a few and see how the authors implement the controls. Since Lua is a scripting language, the best way to learn about it is to dismantle existing samples.
Reply With Quote