Search found 2238 matches

by Celtic_Minstrel
Today, 5:08 am
Forum: Lua Labs
Topic: [solved] How to store unit using custom wml tag
Replies: 4
Views: 131

Re: How to store unit using custom wml tag

function wesnoth.wml_actions.your_tag(cfg) local filter = wml.shallow_literal(cfg) filter.key_you_want_to_remove = nil -- repeat for other keys wml.remove_children(filter, 'tag_you_want_to_remove', 'another_tag_you_want_to_remove') filter = wml.tovconfig(filter) -- now just use filter instead of cf...
by Celtic_Minstrel
Today, 5:03 am
Forum: WML Workshop
Topic: Nearly impassably terrain
Replies: 3
Views: 109

Re: Nearly impassably terrain

P.S. I'm also a bit confused why I can make a custom terrain type, but I can't configure the "movement type" on it. Probably wouldn't help me here, but that just seems like something that would be part of a terrain type, it has to be stored somewhere and I can't think of a better place. A...
by Celtic_Minstrel
Today, 4:49 am
Forum: Lua Labs
Topic: [solved] How to store unit using custom wml tag
Replies: 4
Views: 131

Re: How to store unit using custom wml tag

If you're asking how to store a unit in a WML variable from Lua, like [store_unit] does: local unit = wesnoth.units.find "unit_id" -- get the unit however you want, this example looks it up by its ID wml.variables["your.variable[2].path"] = unit.__cfg If you're asking how to find...
by Celtic_Minstrel
Yesterday, 8:28 pm
Forum: WML Workshop
Topic: What is the easiest way to set defence value on specific tile?
Replies: 2
Views: 107

Re: What is the easiest way to set defence value on specific tile?

Probably the easiest way is to make a custom version of the village overlay that sets the defense how you want it to be set.
by Celtic_Minstrel
Yesterday, 8:27 pm
Forum: Lua Labs
Topic: [solved] two [grid] tags
Replies: 54
Views: 959

Re: [solved] two [grid] tags

Ravana wrote: Yesterday, 7:52 pm It is way how to run wml such as [lua] midscenario with debug command.
Or rather, it is the function to run arbitrary ActionWML for any reason whatsoever.
by Celtic_Minstrel
Yesterday, 5:36 pm
Forum: Lua Labs
Topic: [solved] two [grid] tags
Replies: 54
Views: 959

Re: [solved] two [grid] tags

white_haired_uncle wrote: Yesterday, 4:19 pm (though good luck finding it on the wiki unless you know exactly what to search for).
Why is that? Is there something that could be done to make it easier to find?
by Celtic_Minstrel
Yesterday, 12:41 pm
Forum: Lua Labs
Topic: [closed] How to dialog:close() when >space< is typed into the text_box
Replies: 2
Views: 79

Re: How to dialog:close() when >space< is typed into the text_box

I'm pretty sure you posted the method you tried in the previous thread. Why is it not in this post?
by Celtic_Minstrel
Yesterday, 12:41 pm
Forum: Lua Labs
Topic: [solved] two [grid] tags
Replies: 54
Views: 959

Re: two [grid] tags

Thanks! Oh dumb me, this works "dialog.test_text:focus()" Yes – either that or "gui.widget.focus(dialog.test_text)". I use dialog:set_canvas(1, { } ) To hide the label background...Any idea how to hide text_box background? Just to clarify, that doesn't hide it. It deletes it. Th...
by Celtic_Minstrel
Yesterday, 1:23 am
Forum: Lua Labs
Topic: [solved] two [grid] tags
Replies: 54
Views: 959

Re: two [grid] tags

Pretty much. Just be aware that that also includes deprecated things (which is mostly value_compat and callback).
by Celtic_Minstrel
April 26th, 2024, 11:36 pm
Forum: Lua Labs
Topic: [solved] two [grid] tags
Replies: 54
Views: 959

Re: two [grid] tags

If you mean in documentation, that would be LuaAPI/types/widget. If you mean in the source code, the relevant file is lua_widget_attributes.cpp.
by Celtic_Minstrel
April 26th, 2024, 6:00 pm
Forum: Lua Labs
Topic: [solved] two [grid] tags
Replies: 54
Views: 959

Re: two [grid] tags

I was hoping to find corresponding lua files that manipulate the widget so I could determine of its properties (select_layer(s), layer_selected, etc). Those don't exist. All core widgets are handled in C++. I don't know, but I did figure out that dialog.narration.selected_index=2 I'm not 100% sure ...
by Celtic_Minstrel
April 26th, 2024, 1:59 pm
Forum: Lua Labs
Topic: [solved] two [grid] tags
Replies: 54
Views: 959

Re: two [grid] tags

I'm not aware of any examples of it being used outside of mainline. In mainline it's used in the following windows: addon_list mp_create_game addon_manager campaign_dialog campaign_difficulty game_stats game_version mp_create_game preferences server_info story_viewer title_screen It's also used in a...
by Celtic_Minstrel
April 26th, 2024, 4:57 am
Forum: Lua Labs
Topic: [solved] two [grid] tags
Replies: 54
Views: 959

Re: two [grid] tags

The default mode of a stacked widget is to stack its layers on top of one another. A lot of actual uses of it instead use it as a way to swap between different layers, showing only one layer at a time. I'm not sure if there's an example of its intended use in mainline. On the other hand, it's probab...
by Celtic_Minstrel
April 25th, 2024, 11:35 pm
Forum: Lua Labs
Topic: [solved] two [grid] tags
Replies: 54
Views: 959

Re: two [grid] tags

That's what [stacked_widget] is for.
by Celtic_Minstrel
April 25th, 2024, 1:38 pm
Forum: WML Workshop
Topic: sound_source clarification
Replies: 2
Views: 120

Re: sound_source clarification

I think that's correct. You could try resetting the sound source whenever a unit moves. I would expect that to restart the sound from the beginning, but maybe if you're lucky it won't.