Search found 2202 matches
- Today, 1:16 pm
- Forum: Coder’s Corner
- Topic: Seeking tricky WML examples
- Replies: 14
- Views: 2763
Re: Seeking tricky WML examples
You're right, the issue doesn't have anything to do with WFL. It just happens to more frequently come up with WFL for various reasons. I'm thinking something really simple like: #define MY_MACRO "bar"#enddef [message] speaker=harry message="foo {MY_MACRO}" [/message] Yup, that lo...
- Today, 1:10 pm
- Forum: Lua Labs
- Topic: Custom dialog placement
- Replies: 10
- Views: 178
Re: Custom dialog placement
That's technically true, but you, personally, don't need to know those numbers. There are variables in the GUI2 positioning system that already contain the correct numbers. You may also need the height of the menubar, which strangely isn't in a variable (it seems to be 30). I recommend you look at t...
- Today, 5:19 am
- Forum: Lua Labs
- Topic: Can add-on register key pressed while gui.show_dialog is active? e.g. >a<, >space< ...
- Replies: 10
- Views: 262
Re: Can add-on register key pressed while gui.show_dialog is active? e.g. >a<, >space< ...
You can display dialogs on top of each other, but only the one on the top can be interacted with, even if it's completely transparent.
- Today, 5:18 am
- Forum: Lua Labs
- Topic: Custom dialog placement
- Replies: 10
- Views: 178
Re: Custom dialog placement
The Lua API only lets you use a single [resolution] (you pass the content of that tag to gui.show_dialog ). You could of course have your own logic to choose between resolution tags, though I think you don't have access to the screen size… So in other words, you can't use the [window] tag for a Lua ...
- Today, 3:43 am
- Forum: Lua Labs
- Topic: Custom dialog placement
- Replies: 10
- Views: 178
Re: Custom dialog placement
I'm pretty sure there's no need to do that. There's allowance in either [window] or [window_definition] for specifying where the dialog window should appear on the screen, so you really just need to work out the right numbers or formulas to get the effect you want. (If it's in [window_definition] yo...
- Today, 3:40 am
- Forum: Coder’s Corner
- Topic: Seeking tricky WML examples
- Replies: 14
- Views: 2763
Re: Seeking tricky WML examples
WML has very few special characters. Any character that appears after the = , with a few exceptions, is considered to be part of the value of the attribute. It doesn't matter how convoluted it looks or how many punctuation characters appear in it – as long as none of the special characters appear, i...
- Today, 12:38 am
- Forum: Coder’s Corner
- Topic: Seeking tricky WML examples
- Replies: 14
- Views: 2763
Re: Seeking tricky WML examples
Don't worry, there are people experienced with WML who are also confused by this.
- Today, 12:17 am
- Forum: Lua Labs
- Topic: Custom dialog placement
- Replies: 10
- Views: 178
Re: Custom dialog placement
gui.show_narration is written in C++, so while technically yes it could be reused, that doesn't help you any. Unless the placement is done in the WML – you're welcome to take a look.
- Today, 12:16 am
- Forum: Lua Labs
- Topic: Can add-on register key pressed while gui.show_dialog is active? e.g. >a<, >space< ...
- Replies: 10
- Views: 262
Re: Can add-on register key pressed while gui.show_dialog is active? e.g. >a<, >space< ...
No.
The GUI2 system provides at least two different ways to do it, but they're not exposed in the Lua API.
The GUI2 system provides at least two different ways to do it, but they're not exposed in the Lua API.
- Today, 12:15 am
- Forum: Coder’s Corner
- Topic: Seeking tricky WML examples
- Replies: 14
- Views: 2763
Re: Seeking tricky WML examples
Well, if I understand correctly, this definition would also work fine.
Code: Select all
#define MY_FORMULA
" (if(a = b,
12,
22
)) "#enddef
- Yesterday, 1:46 pm
- Forum: Lua Labs
- Topic: Custom dialog placement
- Replies: 10
- Views: 178
Re: Custom dialog placement
The dialog doesn't know anything about the map screen, so it's technically not possible. Since the sidebar is a fixed width as far as I know, you can probably get this to work with the default theme, at least; it would probably break if someone uses a different theme though. Basically, you would hav...
- April 15th, 2024, 5:41 pm
- Forum: WML Workshop
- Topic: [solved] Artificial Inteligence more [avoid] tags
- Replies: 4
- Views: 131
Re: [solved] Artificial Inteligence more [avoid] tags
Yeah, you're right, you need the empty not tag as well.
- April 15th, 2024, 1:29 pm
- Forum: WML Workshop
- Topic: [solved] Artificial Inteligence more [avoid] tags
- Replies: 4
- Views: 131
Re: Artificial Inteligence question
If you want units to avoid certain terrains only when they're not using the Goto MicroAI, that's easy. Set up the avoid tag for the avoided terrains like normal. Then add an empty avoid tag in the Goto Micro AI definition. For MicroAIs that support it, an avoid tag inside their definition overrides ...
- April 15th, 2024, 1:27 pm
- Forum: WML Workshop
- Topic: Clone unit in WML
- Replies: 5
- Views: 327
Re: Clone unit in WML
If I understand correctly, you want to make a unit that's a copy of the leader unit while avoiding ID conflicts? In that case, all you need to do is store the unit, delete the ID from the stored unit, modify anything else you want, and then unstore the unit. A stored unit is already a copy of the un...
- April 15th, 2024, 1:23 pm
- Forum: WML Workshop
- Topic: variable expansion
- Replies: 4
- Views: 252
Re: variable expansion
You can't use [set_variable] for container variables. It just won't work. There's no way to make your false example work in a similar way. You could maybe work something out with [set_variables] (note the extra S), but I have a feeling it wouldn't be that much less verbose than your first example. Y...