questions about Wesnoth-Lua
Moderator: Forum Moderators
questions about Wesnoth-Lua
Hello,
About
When a unit is blocked on its path toward a goal, by an ally standing on its "virtual halt" tile, how to determine the 2 neighbour tiles +/- leading forwards? I have found:
but the fact that it expects an "angle" in range 1...6 makes me doubt about its functionality.
Thank you!
About
cfg
& __cfg
& __literal
:
- Maybe it's just an issue of funny naming:Wwhy is
cfg
called that way? Why notinput
orparams
? Can I safely assume that it is always, and only, params/input stored in a table? (or userdata) - What is __cfg?
- What is, clearly and factually, __literal? And why is it called that way?
- I think I remember that the mysterious
Wesnoth
module is in fact cpp code: correct? But where is it? And can we find some documentation about it? The short lists provided in the LuaWML wiki page's subpages (or LuaAPI), open more questions than they answer... (and no example to help understand) - Where is the
map
module? (same questions as above possibly)
When a unit is blocked on its path toward a goal, by an ally standing on its "virtual halt" tile, how to determine the 2 neighbour tiles +/- leading forwards? I have found:
wesnoth.map.rotate_right_around_center(loc, center, angle)
but the fact that it expects an "angle" in range 1...6 makes me doubt about its functionality.
Thank you!
Re: questions about Wesnoth-Lua
IIUC, the
wesnoth
module is a table of functions, which can be added to or even overridden. The table is created, and a lot of functions are added in, src/scripting/game_lua_kernel.cpp.Re: questions about Wesnoth-Lua
Thank you! I will have a look.
EDIT: Ok, that's what I was searching for. Unfortunately, it can hardly be useful for my 2 use cases:
- Understanding better what each func does, or what each structure contains, and the logic behind.
- Expanding & improving the doc on all that online.
Conclusion: only involved coders can improve that; or maybe also highly motivated "scriptors" who have done the work of longuish and penible trial & error explorations (on the Wesnoth platform even much more).
Last edited by denispir on November 7th, 2019, 10:51 am, edited 1 time in total.
-
- Inactive Developer
- Posts: 503
- Joined: April 24th, 2016, 4:18 pm
Re: questions about Wesnoth-Lua
/s
"cfg" is named that to reduce the amount of work on the keypunch department, and ensure we stay within the 72-column limit for punchcards, to allow us to re-colate them should we drop the card tray.
"cfg" is named that to reduce the amount of work on the keypunch department, and ensure we stay within the 72-column limit for punchcards, to allow us to re-colate them should we drop the card tray.
I forked real life and now I'm getting merge conflicts.
Re: questions about Wesnoth-Lua
I would then propose "Tad_Carlucci wrote: ↑November 6th, 2019, 4:07 pm "cfg" is named that to reduce the amount of work on the keypunch department, and ensure we stay within the 72-column limit for punchcards, to allow us to re-colate them should we drop the card tray.
i
" as in i/o.