Search found 2229 matches
- 52 minutes ago
- Forum: Lua Labs
- Topic: two [grid] tags
- Replies: 23
- Views: 394
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.
- Yesterday, 6:00 pm
- Forum: Lua Labs
- Topic: two [grid] tags
- Replies: 23
- Views: 394
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 ...
- Yesterday, 1:59 pm
- Forum: Lua Labs
- Topic: two [grid] tags
- Replies: 23
- Views: 394
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...
- Yesterday, 4:57 am
- Forum: Lua Labs
- Topic: two [grid] tags
- Replies: 23
- Views: 394
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: two [grid] tags
- Replies: 23
- Views: 394
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: 99
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.
- April 25th, 2024, 4:08 am
- Forum: Lua Labs
- Topic: [GUI] dynamic widget definition
- Replies: 4
- Views: 151
Re: [GUI] dynamic widget definition
Sounds like what you're doing is digging into the spinner's internals (it's a compound widget, which means it's composed of several smaller widges). That's definitely not the way it's supposed to work, but it's good to know that there's at least a workaround for the fact that it's not properly suppo...
- April 25th, 2024, 2:14 am
- Forum: Lua Labs
- Topic: [GUI] dynamic widget definition
- Replies: 4
- Views: 151
Re: [GUI] dynamic widget definition
Now for the float, I'd like to use a slider, and that slider's minimum and maximum values and step size aren't known when I create the node definition, and it appears they cannot be modified on the fly. My guess is that they are fixed, and I have to define them when I define(/instantiate/initialize...
- April 25th, 2024, 12:04 am
- Forum: WML Workshop
- Topic: negative ai aggression
- Replies: 2
- Views: 111
Re: negative ai aggression
The quantity (1 - aggression) is used to determine which of two attacks is better. The actual code that does the comparison is this ( harm_weight is the aforementioned aggression-based quantity): // Compare: P(we kill them) - P(they kill us). a = them_a.hp_dist[0] - us_a.hp_dist[0] * harm_weight; b ...
- April 24th, 2024, 5:20 pm
- Forum: WML Workshop
- Topic: [solved] comma = or syntax
- Replies: 4
- Views: 164
Re: [solved] comma = or syntax
Apart from the case of commas on the left hand side of the
The same goes for the range syntax – that's specific to certain places and doesn't generally work anywhere.
=
, it's based on the key whether or not a comma has any special meaning. So for example, it won't work with name
in most cases.The same goes for the range syntax – that's specific to certain places and doesn't generally work anywhere.
- April 22nd, 2024, 12:59 pm
- Forum: WML Workshop
- Topic: [solved] where I can use [lua] and it's return value, what I can do in modify_unit
- Replies: 12
- Views: 418
Re: [solved] where I can use [lua] and it's return value, what I can do in modify_unit
So it looks like you can't do this either, which is unfortunate as I have multiple objects I'd like to insert. Why would you need to? You can dump multiple objects into [modify_unit anyway, so just put the [insert_tag] directly in there (like in your second example, but with name=object ). That mak...
- April 21st, 2024, 3:31 pm
- Forum: WML Workshop
- Topic: [solved] where I can use [lua] and it's return value, what I can do in modify_unit
- Replies: 12
- Views: 418
Re: where I can use [lua] and it's return value, what I can do in modify_unit
It seems quite logical to me. If a [lua] block returns a valid WML tag, I would expect that to have the same result as if I had typed in said tag at that location. Clearly, I'm wrong, but it's what I would expect. I'm not sure how viable that interpretation is. It would be equivalent to allowing [l...
- April 21st, 2024, 2:36 pm
- Forum: WML Workshop
- Topic: [solved] where I can use [lua] and it's return value, what I can do in modify_unit
- Replies: 12
- Views: 418
Re: where I can use [lua] and it's return value, what I can do in modify_unit
I've noticed that it seems I can't do much inside [modify_unit]. For example, I have tried an failed to print/save the value of $this_unit in various ways, but whatever I try seems to be silently ignored. I don't think there's any way to debug the value of $this_unit in [modify_unit] . You could us...
- April 20th, 2024, 2:20 pm
- Forum: WML Workshop
- Topic: [closed] Merge unit animaions
- Replies: 19
- Views: 603
Re: [closed] Merge unit animaions
That's at least mentioned here. Maybe that's too easy to miss…?
- April 20th, 2024, 2:03 pm
- Forum: Lua Labs
- Topic: How to display two dialogs on each other
- Replies: 5
- Views: 228
Re: How to display two dialogs on each other
This is very easy. The first dialog (ie, the one in the background) must call the second dialog in either the pre_show or a callback function (depending on how your logic works). That example you posted is about placing things on top of things within a single dialog, so it's not relevant to the ques...