Real basic help
Hey there, I've been spending some time digging around the Turbine examples and basically want to learn how to do really simple lua.
If I wanted to learn how to say, make a simple Window, maybe add in a button or two, maybe add a function to a button. Where would I start? I just have some time on my hands and thought I could spend some of it on very basic Lotro LUA stuff. If this is something that time, effort and a learning capacity cant overcome, and school is the only route then be honest :D Thx. |
Lua is an extreamly flexable language which is easy to learn (hurts the head if you are a c-type programmer already) but you can create a window with only a handful of lines, the hard part (for me atleast) was figuring out how to get lotro to "see" the plugin, for that you can create your own directory with the other plugins and "steal" the .plugin file then rename and modify it (with a text editor or IDE if you have one) then just a matter of making another directory (with your plugin's name). after that you create two files (or three if you plan to have an single place to put your imports) your "main.lua" and your "window.lua" files, in your window file you put in basic code like this -
Code:
import "Turbine" Code:
import <your directory name>.Window hope that is a good enough primmer to get you going! |
I found looking at other peoples plugins and working through http://www.lua.org/pil/1.html helped. I still don't understand everything, but learning on-the-job is the best way to learn anything! Well... except brain surgery...
|
Quote:
Thx for the start man. I got the game to 'see' my plugin. "Testwindow" but it wont load :D TestWindow.lua Code:
import "Turbine" Code:
import "Gramps.Window.TestWindow"; Code:
import "Gramps.TestWindow" |
Quote:
I am gonna guess that your .plugin file points to Gramps.TestWindow.main. Which then looks in the Gramps\TestWindow\main.lua file and sees that it needs to load the Gramps.TestWindow folder, which means the _init_.lua file. So that file looks for the following file: Gramps\Window\TestWindow.lua. So this would mean you have the following folder layout: Gramps
At least, that is what I can gather. If you have the TestWindow file in the same folder as the rest, then simply change the line in the _init_.lua file to: import "Gramps.TestWindow.TestWindow"; Hope that makes sense. |
Makes perfect sense thanks man.
Making progress. .d of the Rings Online\Plugins\Gramps\Window\Main.lua:2: Unable to resolve package "Gramps.TestWindow". I'll dig around a bit and see what I can find out. I honesty spent several hrs yesterday looking though author's plugins, turbine examples, editing turbine examples ect. Thx for the help! Problem was in my Window.Plugin (pluginsfile) Changed package to Testwindow from Window. the Rings Online\Plugins\Gramps\TestWindow\main.lua:4: attempt to call global 'Window' (a nil value) Rings Online\Plugins\Gramps\TestWindow\Main.lua:2: Failed to import package "Gramps.TestWindow.main". Two new ones now. I'll continue to dig :D Got it :D Thx man. You really got me motivated to dig into this stuff. |
All times are GMT -5. The time now is 05:30 PM. |
vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI