Wesnoth Lua Pack: Development Thread
Moderator: Forum Moderators
-
- Posts: 1549
- Joined: June 18th, 2009, 1:45 am
Re: Wesnoth Lua Pack: Development Thread
wlp_tags.lua -> wml_tags.lua
For example.
For example.
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: Wesnoth Lua Pack: Development Thread
Thanks, fixed. This seemed to be the only problem however.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: Wesnoth Lua Pack: Development Thread
@E_H
Using rtf as the documentation file format will possibly not cope well with svn btw if you want to put it into the repository anywhen.
Using rtf as the documentation file format will possibly not cope well with svn btw if you want to put it into the repository anywhen.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
- Elvish_Hunter
- Posts: 1575
- Joined: September 4th, 2009, 2:39 pm
- Location: Lintanir Forest...
Re: Wesnoth Lua Pack: Development Thread
I know. Probably now the WLP needs its own wiki page, so we can drop the RTF, do you agree? If yes, here there is its link (still empty): http://wiki.wesnoth.org/Wesnoth_Lua_Pack
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
- Alarantalara
- Art Contributor
- Posts: 786
- Joined: April 23rd, 2010, 8:17 pm
- Location: Canada
Re: Wesnoth Lua Pack: Development Thread
RTF from a word processor is no worse than generated HTML and works pretty well if you don't use Word to generate it. Take a look at the file I sent you in a text editor that won't style the RTF if you want an example.
- Elvish_Hunter
- Posts: 1575
- Joined: September 4th, 2009, 2:39 pm
- Location: Lintanir Forest...
Re: Wesnoth Lua Pack: Development Thread
I already did, also the page about RTF at Wikipedia explains well the question. The real problems is, do we prefer having an RTF inside the add-on, a wiki page, or both? Perhaps the wiki page will be better (especially if more people contribute Lua stuff in future), as it will allow collaborative editing.
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: Wesnoth Lua Pack: Development Thread
As for a wiki page or even a documentation file alone - I think it's overambitious.
Consider the fact that the wesnoth C++ source is hardly documented at all, there are only few comments (sometimes) in there although there are a lot more developers than here. Consider that there are lots of wiki pages such as the one for ASC which are outdated since people don't have time to care for them.
What we should do is some comments right above the functions, everything else is too much maintenance load.
Collaborative editing is possible as well if rtf works with svn like you say.
Consider the fact that the wesnoth C++ source is hardly documented at all, there are only few comments (sometimes) in there although there are a lot more developers than here. Consider that there are lots of wiki pages such as the one for ASC which are outdated since people don't have time to care for them.
What we should do is some comments right above the functions, everything else is too much maintenance load.
Collaborative editing is possible as well if rtf works with svn like you say.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Re: Wesnoth Lua Pack: Development Thread
I was looking through wml-tags.lua and saw that many of the tags could be streamlined, for example...
Just trying to help, I hope you don't mind....
Example 1
Example 2
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: Wesnoth Lua Pack: Development Thread
This is a rather philosophic issue...
Using more variables makes the code more readable and easier to debug for sure. Also, I wonder whether the lua interpreter is so intelligent to do such conversion automatically. Modern java compilers do that at least I hear.
Using more variables makes the code more readable and easier to debug for sure. Also, I wonder whether the lua interpreter is so intelligent to do such conversion automatically. Modern java compilers do that at least I hear.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Re: Wesnoth Lua Pack: Development Thread
Hm, for me it's the opposite....Anonymissimus wrote:Using more variables makes the code more readable and easier to debug for sure.
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: Wesnoth Lua Pack: Development Thread
Have you been working with a debugger ? In such long calls you cannot hover your mouse over a variable to see what it's value is to hunt down the erroneous position.
Similar if you use debug messages or log domains, you need a variable to put into the message.
Similar if you use debug messages or log domains, you need a variable to put into the message.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Re: Wesnoth Lua Pack: Development Thread
If I need to use the value more than once I'd use a variable, but in those examples each variable was only used once.... Meh. It's not my code, I'll leave.
- Elvish_Hunter
- Posts: 1575
- Joined: September 4th, 2009, 2:39 pm
- Location: Lintanir Forest...
Re: Wesnoth Lua Pack: Development Thread
However, this made me think that I can modify [store_shroud] to have some default values instead of raising errors (untested):Anything against it?
Code: Select all
function wml_actions.store_shroud(cfg)
local team_number = tonumber ( cfg.side ) or 1 -- if missing or wrong, default to side 1
local variable = cfg.variable or "shroud" -- if missing, default to shroud as variable name
local side = wesnoth.get_side(team_number)
local current_shroud = side.__cfg.shroud_data
wesnoth.set_variable(variable, current_shroud)
end
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
Re: Wesnoth Lua Pack: Development Thread
Please read this mailinglist thread before proceeding. There's some discussion about defaults, whether we should have them and what they should be in there. (brought up by the lua-conversion of some tags changing the defaults)
- Elvish_Hunter
- Posts: 1575
- Joined: September 4th, 2009, 2:39 pm
- Location: Lintanir Forest...
Re: Wesnoth Lua Pack: Development Thread
Version 1.2.0 of the WLP is on the 1.9 add-ons server and on UMC-dev on Sourceforge. This release includes two new tags: [animate_path] by Alarantalara and [find_path] by me. It includes also a WLP_VERSION macro by Anonymissimus.
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)