Search found 2238 matches
- Yesterday, 5:08 am
- Forum: Lua Labs
- Topic: [solved] How to store unit using custom wml tag
- Replies: 4
- Views: 136
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...
- Yesterday, 5:03 am
- Forum: WML Workshop
- Topic: Nearly impassably terrain
- Replies: 3
- Views: 117
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...
- Yesterday, 4:49 am
- Forum: Lua Labs
- Topic: [solved] How to store unit using custom wml tag
- Replies: 4
- Views: 136
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...
- April 27th, 2024, 8:28 pm
- Forum: WML Workshop
- Topic: What is the easiest way to set defence value on specific tile?
- Replies: 2
- Views: 111
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.
- April 27th, 2024, 8:27 pm
- Forum: Lua Labs
- Topic: [solved] two [grid] tags
- Replies: 54
- Views: 972
- April 27th, 2024, 5:36 pm
- Forum: Lua Labs
- Topic: [solved] two [grid] tags
- Replies: 54
- Views: 972
Re: [solved] two [grid] tags
Why is that? Is there something that could be done to make it easier to find?white_haired_uncle wrote: ↑April 27th, 2024, 4:19 pm (though good luck finding it on the wiki unless you know exactly what to search for).
- April 27th, 2024, 12:41 pm
- Forum: Lua Labs
- Topic: [closed] How to dialog:close() when >space< is typed into the text_box
- Replies: 2
- Views: 82
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?
- April 27th, 2024, 12:41 pm
- Forum: Lua Labs
- Topic: [solved] two [grid] tags
- Replies: 54
- Views: 972
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...
- April 27th, 2024, 1:23 am
- Forum: Lua Labs
- Topic: [solved] two [grid] tags
- Replies: 54
- Views: 972
Re: two [grid] tags
Pretty much. Just be aware that that also includes deprecated things (which is mostly
value_compat
and callback
).- April 26th, 2024, 11:36 pm
- Forum: Lua Labs
- Topic: [solved] two [grid] tags
- Replies: 54
- Views: 972
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.
- April 26th, 2024, 6:00 pm
- Forum: Lua Labs
- Topic: [solved] two [grid] tags
- Replies: 54
- Views: 972
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 ...
- April 26th, 2024, 1:59 pm
- Forum: Lua Labs
- Topic: [solved] two [grid] tags
- Replies: 54
- Views: 972
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...
- April 26th, 2024, 4:57 am
- Forum: Lua Labs
- Topic: [solved] two [grid] tags
- Replies: 54
- Views: 972
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...
- April 25th, 2024, 11:35 pm
- Forum: Lua Labs
- Topic: [solved] two [grid] tags
- Replies: 54
- Views: 972
Re: two [grid] tags
That's what
[stacked_widget]
is for.- April 25th, 2024, 1:38 pm
- Forum: WML Workshop
- Topic: sound_source clarification
- Replies: 2
- Views: 121
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.