lua help

Discussion of Lua and LuaWML support, development, and ideas.

Moderators: Forum Moderators, Developers

Post Reply
User avatar
Azeal
Posts: 97
Joined: July 24th, 2012, 8:19 am

lua help

Post by Azeal » October 26th, 2012, 4:55 am

I was wondering if it would be possible to modify the right side unit information panel with lua? specifically would it be possible to list abilities vertically? Any tips or links would be appreciated.

User avatar
Pentarctagon
Forum Administrator
Posts: 4042
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: lua help

Post by Pentarctagon » October 26th, 2012, 5:46 am

Moved to the correct forum.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

User avatar
Elvish_Hunter
Forum Moderator
Posts: 1393
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: lua help

Post by Elvish_Hunter » October 27th, 2012, 1:03 pm

Theoretically you can use the wesnoth.theme_items function to set the value of items like this. But the problem is that the theme itself places the abilities only in one line, so you may need to define your own theme with WML (and I'm not even sure if it'll be enough).
Since I never created a custom theme, I can't be of much help in this situation. :(
Anyway, here there are some useful links:
- an explanation about themes by Darth Fool: http://forums.wesnoth.org/viewtopic.php?p=213708#213708
- our wiki page on ThemeWML: http://wiki.wesnoth.org/ThemeWML
Current maintainer of these add-ons:
1.14: The Sojournings of Grog, A Rough Life, The White Troll (co-author), Wesnoth Lua Pack
1.12: Children of Dragons

User avatar
Azeal
Posts: 97
Joined: July 24th, 2012, 8:19 am

Re: lua help

Post by Azeal » October 29th, 2012, 4:16 am

after going through the predefined themes and examining the wiki it I can easily change the size of the area abilities are displayed in, however the abilities still list horizontally. For the next stage I checked the lua wiki however it only really shows you how to create new unit statuses, so I'm still a bit lost.

Still, thank you for that link, it was helpful for the first part.

Another question: can I use the [change] tag somehow in the era tag to modify the theme at the start of the match, or is it limited to [theme] then [partialresolution], meaning I have to actually create my own theme to modify the size of a panel?

User avatar
Elvish_Hunter
Forum Moderator
Posts: 1393
Joined: September 4th, 2009, 2:39 pm
Location: Lintanir Forest...

Re: lua help

Post by Elvish_Hunter » November 2nd, 2012, 10:12 am

Azeal wrote:after going through the predefined themes and examining the wiki it I can easily change the size of the area abilities are displayed in, however the abilities still list horizontally. For the next stage I checked the lua wiki however it only really shows you how to create new unit statuses, so I'm still a bit lost.
Then I suggest you to take a look at the Quest of Wesnoth add-on: it combines Lua and ThemeWML, so it may be useful for you.
Azeal wrote:Another question: can I use the [change] tag somehow in the era tag to modify the theme at the start of the match, or is it limited to [theme] then [partialresolution], meaning I have to actually create my own theme to modify the size of a panel?
What you can do is changing the theme in the scenario, by adding inside the [scenario] or [multiplayer] tags the theme= key (see http://wiki.wesnoth.org/ScenarioWML ).
If you have more questions about ThemeWML that are not Lua-related, I'd highly suggest you to start a theme topic in the WML Workshop. This way, someone with better theme experience and knowledge than me may be able to help. :)
Current maintainer of these add-ons:
1.14: The Sojournings of Grog, A Rough Life, The White Troll (co-author), Wesnoth Lua Pack
1.12: Children of Dragons

User avatar
Crendgrim
Moderator Emeritus
Posts: 1328
Joined: October 15th, 2010, 10:39 am
Location: Germany

Re: lua help

Post by Crendgrim » November 2nd, 2012, 2:23 pm

Elvish_Hunter wrote:Then I suggest you to take a look at the Quest of Wesnoth add-on: it combines Lua and ThemeWML, so it may be useful for you.
Just looking through this thread, this catched my attention. So, a quick note from that add-on's creator on where you should look. These are the files which might be interesting for you:
/lua/theme.lua
/themes/qow.cfg
The latter is basically a modification of the default theme. You can compare them to find out what I changed. It shouldn't be too much.
If you have questions about these, feel free to ask either here, in the WML workshop or via PM. I'll pay attention to your threads.
UMC Story Images — Story images for your campaign!

User avatar
Azeal
Posts: 97
Joined: July 24th, 2012, 8:19 am

Re: lua help

Post by Azeal » November 3rd, 2012, 2:16 am

thank you both, this looks extremely helpful for defining new display information. However I'm still a bit stumped about how to list vertically rather than horizontally

Post Reply