Search found 705 matches

by gnombat
April 11th, 2024, 11:38 pm
Forum: WML Workshop
Topic: Now THIS is funny
Replies: 9
Views: 240

Re: Now THIS is funny

Do you have an actual space in your folder name? I.e., 3rd Army ? You should rename it and replace the space with an underscore, i.e., 3rd_Army . One wonders why campaign .cfgs that contain all those understrokes I removed work just fine, though. The underscore character should work fine, but spaces...
by gnombat
April 11th, 2024, 10:16 pm
Forum: Lua Labs
Topic: Working lua need advice deciding which method is best
Replies: 34
Views: 951

Re: Working lua need advice deciding which method is best

Are you sure that's not supposed to be wml.tag.variable?
by gnombat
April 11th, 2024, 6:17 pm
Forum: Scenario & Campaign Development
Topic: Legend of the Invincibles
Replies: 8125
Views: 2117730

Re: Legend of the Invincibles

Just installed 1.18 BfW from Steam. Campaign originally played on 1.16. If you want to continue from your save file, you may just want to install version 1.16, because 1.18 is not 100% compatible with 1.16 (and there's no guarantee it will work with save files from 1.16). If you install 1.16 you sh...
by gnombat
April 11th, 2024, 3:02 pm
Forum: Lua Labs
Topic: Working lua need advice deciding which method is best
Replies: 34
Views: 951

Re: Working lua need advice deciding which method is best

I'm not sure I understand what you have in unit_filter.
Spannerbag wrote: April 11th, 2024, 2:04 pm the unit_filter string (which is the contents of a [filter])
I'm still not clear on what unit_filter is expected to contain.

It might help if you posted the WML code.
by gnombat
April 11th, 2024, 12:16 pm
Forum: Lua Labs
Topic: Working lua need advice deciding which method is best
Replies: 34
Views: 951

Re: Working lua need advice deciding which method is best

_G is about Lua variables, [set_global_variable] is about WML variables which are stored in file. Yep, got that - and I think you've answered my question but, to be crystal clear, if something is created by [set_global_variable] , that variable/data will not automagically appear in _G ? That is, th...
by gnombat
April 11th, 2024, 4:44 am
Forum: Lua Labs
Topic: Working lua need advice deciding which method is best
Replies: 34
Views: 951

Re: Working lua need advice deciding which method is best

_("There is a $color $species.") I only speak American, not even English, but that looks like a pain for translators. Would they re-order $color and $species as necessary (in which case this appears to be a preferable alternative to string.format, which I find much more readable)? What ab...
by gnombat
April 11th, 2024, 3:49 am
Forum: WML Workshop
Topic: Okay, what's up with the macros
Replies: 19
Views: 563

Re: Okay, what's up with the macros

I see quite a lot of errors in the code pasted above: The _main.cfg file refers to {~add-ons/my_first_campaign/scenarios} instead of {~add-ons/3rd_army/scenarios} . The scenario .cfg file doesn't have a closing [/scenario] tag. The scenario .cfg file refers to a macro TRAIT_LEADER which doesn't actu...
by gnombat
April 11th, 2024, 2:31 am
Forum: Lua Labs
Topic: Working lua need advice deciding which method is best
Replies: 34
Views: 951

Re: Working lua need advice deciding which method is best

_("There is a $color $species.") I only speak American, not even English, but that looks like a pain for translators. Would they re-order $color and $species as necessary (in which case this appears to be a preferable alternative to string.format, which I find much more readable)? Yes, th...
by gnombat
April 10th, 2024, 9:10 pm
Forum: Lua Labs
Topic: Working lua need advice deciding which method is best
Replies: 34
Views: 951

Re: Working lua need advice deciding which method is best

If you used global variables then stringx.vformat(_("There is a $color $species."), _G) something of this idea will work. _G is table of global variables. The stringx.vformat documentation also suggests using WML variables - then this should work: stringx.vformat(_("There is a $color...
by gnombat
April 10th, 2024, 8:52 pm
Forum: Lua Labs
Topic: Working lua need advice deciding which method is best
Replies: 34
Views: 951

Re: Working lua need advice deciding which method is best

* - What is the correct term for doing a {...} btw? A table constructor . Oh, no pressure or anything but if you do get chance (and aren't utterly bored with my stupidity) I'd still like to know what it was with _ I got wrong. _ is a function which should always take as its argument a single litera...
by gnombat
April 10th, 2024, 2:59 pm
Forum: Lua Labs
Topic: Working lua need advice deciding which method is best
Replies: 34
Views: 951

Re: Working lua need advice deciding which method is best

First, why does using both stringx.vformat and concatenation not make sense? Can stringx.vformat also concatenate and I missed it? Well, yes? Isn't that basically what your second example was doing - concatenating strings using stringx.vformat , without using the concatenation operator ( .. )? I'm ...
by gnombat
April 10th, 2024, 12:55 pm
Forum: Lua Labs
Topic: Working lua need advice deciding which method is best
Replies: 34
Views: 951

Re: Working lua need advice deciding which method is best

I prefer the first (concatenation) method however I've read on stackoverflow that this is inefficient. I would not worry about this unless you are (a) inside a loop, and (b) performing concatenation on the same string over and over again inside that loop. Performing a single string concatenation, o...
by gnombat
April 9th, 2024, 11:21 pm
Forum: Users’ Forum
Topic: So, let's make a scenario
Replies: 11
Views: 2260

Re: So, let's make a scenario

I'm confused what the confusion is about at this point. I think the problem is that the scenario editor is just confusing. It basically assumes that you already know how to write WML code by hand, but if you know how to write WML code by hand, it's not clear that the scenario editor is actually use...
by gnombat
April 9th, 2024, 3:40 am
Forum: Scenario & Campaign Development
Topic: Ascension
Replies: 101
Views: 19987

Re: Ascension

That doesn't look right - the underscore character _ for marking a string as translatable cannot be used in a .pbl file.

See the example .pbl file.