Search found 2163 matches

by Celtic_Minstrel
March 26th, 2024, 4:36 am
Forum: WML Workshop
Topic: Reset achievements for UMC campaign?
Replies: 27
Views: 1037

Re: Reset achievements for UMC campaign?

Also surprised to learn that Wesnoth doesn't know where the WML originates from... I vaguely recall reading ages ago that the engine maintained namespaces and prepended campaign specific strings to every variable within said campaign to avoid name clashes between variables in different campaigns (I...
by Celtic_Minstrel
March 26th, 2024, 4:30 am
Forum: Ideas
Topic: New Lua functions.
Replies: 8
Views: 368

Re: New Lua functions.

Do you mean wesnoth.audio.sources ? If I understand that correctly it handles sources that can play sound files. Not any sounds that are actively playing. The reason why this is so important for narration is that if the player skips dialogue we want to cancel the voiceover. The intended use-case fo...
by Celtic_Minstrel
March 23rd, 2024, 10:09 pm
Forum: Lua Labs
Topic: How to make my own gui.show_story
Replies: 7
Views: 316

Re: How to make my own gui.show_story

ZombieKnight wrote: March 23rd, 2024, 5:25 pm I thought I could just put true in that if, that says if theres a golden line or not...
Okay I'm sticking with the default one
There's a lot of functionality built in to the story screen that you would have to reimplement yourself if you wanted to alter its appearance.
by Celtic_Minstrel
March 23rd, 2024, 10:04 pm
Forum: Ideas
Topic: New Lua functions.
Replies: 8
Views: 368

Re: New Lua functions.

For 1 you could look into the sound source functionality. It might be able to do what you want, but I'm not sure. For 3, yes, we would like to use the GPU for IPFs, but we're not quite there yet. Compiling IPFs down into shader code is possible and would probably greatly boost performance for things...
by Celtic_Minstrel
March 23rd, 2024, 4:07 pm
Forum: Lua Labs
Topic: How to make my own gui.show_story
Replies: 7
Views: 316

Re: How to make my own gui.show_story

The story screen is even more complicated than the narration dialog, so I think reimplementing it with gui.show_dialog is a very bad idea. You're welcome to try it if you really want to, but you're almost certainly going to end up with something inferior to the original.
by Celtic_Minstrel
March 23rd, 2024, 4:05 pm
Forum: WML Workshop
Topic: How to use a custom font in my add-on?
Replies: 17
Views: 732

Re: How to use a custom font in my add-on?

Probably not. It would need to be someone who knows C++.
by Celtic_Minstrel
March 23rd, 2024, 4:33 am
Forum: WML Workshop
Topic: How to use a custom font in my add-on?
Replies: 17
Views: 732

Re: How to use a custom font in my add-on?

I don't think there is anything technically difficult about supporting custom fonts – we already let translators add arbitrary fonts suitable to their language, if necessary. It's mostly just that no-one ever found the time and motivation to do it. A pull request would very likely be accepted, if th...
by Celtic_Minstrel
March 23rd, 2024, 4:30 am
Forum: WML Workshop
Topic: Reset achievements for UMC campaign?
Replies: 27
Views: 1037

Re: Reset achievements for UMC campaign?

Broadly speaking, I believe you're misunderstanding what achievements are. They're something that tracks global state outside of a particular playthrough of a campaign, like "I once defeated the spider in the Dank Tunnels" or "I once managed to have an army with a Sharpshooter, an Ave...
by Celtic_Minstrel
March 18th, 2024, 5:14 pm
Forum: Lua Labs
Topic: WML table navigation
Replies: 2
Views: 261

Re: WML table navigation

local u = wesnoth.units.get(wml.variables["unit.id"]) local u_table=u.__cfg First of all, that's completely pointless. It's roughly equivalent to: local u_table = wml.variables["unit"] Although there's always the possibility that the stored unit has been changed without being un...
by Celtic_Minstrel
March 17th, 2024, 2:22 pm
Forum: Lua Labs
Topic: How to create a message with custom background
Replies: 7
Views: 313

Re: How to create a message with custom background

No, gui.show_narration is defined in C++ and WML. The WML part of the definition can be found in the data/gui/windows/wml_message.cfg file. If you loaded that file and passed the [resolution] tag to gui.show_dialog , you'd have a dialog that looks exactly like a message dialog, but probably lacks so...
by Celtic_Minstrel
March 17th, 2024, 1:43 am
Forum: Lua Labs
Topic: How to create a message with custom background
Replies: 7
Views: 313

Re: How to create a message with custom background

You can create pretty much any dialog you can imagine, yes. The show_narration dialog is fairly complex, however. You could probably copy it WML definition from core and make a new dialog using it, though. By the way, show_narration is part of GUI2 – it's just one of the pre-built dialogs provided f...
by Celtic_Minstrel
March 16th, 2024, 3:21 pm
Forum: Lua Labs
Topic: How to create a message with custom background
Replies: 7
Views: 313

Re: How to create a message with custom background

I could be wrong, but I don't think there's any way to do that without recreating the whole dialog. The closest idea that comes to mind would be changing the active definition, but there's no Lua API to change definitions, so I don't think it can be done in Lua. There is the idea of creating a custo...
by Celtic_Minstrel
March 13th, 2024, 11:05 pm
Forum: Lua Labs
Topic: [solved] Storing a test condition as a string
Replies: 5
Views: 267

Re: [solved] Storing a test condition as a string

That's another good solution, yes. However, instead of a global function, I'd recommend namespacing it: -- I'm starting the global variable with a capital letter only because the linting systems I use -- consider lowercase names to be a probable error PrefFunctions = {} function PrefFunctions.blood_...
by Celtic_Minstrel
March 13th, 2024, 7:21 am
Forum: Lua Labs
Topic: [solved] Storing a test condition as a string
Replies: 5
Views: 267

Re: Storing a test condition as a string

it will need to be saved between games (and perhaps even persist?). This means it will need to be WML, yes, so version #1 will not work for you. Solution #2 looks like the cleanest, though I'm unclear how it would handle errors. Broadly speaking, it more or less doesn't , but it shouldn't crash in ...
by Celtic_Minstrel
March 13th, 2024, 2:03 am
Forum: Lua Labs
Topic: [solved] Storing a test condition as a string
Replies: 5
Views: 267

Re: Storing a test condition as a string

I'll answer your direct question in a moment, but before that I want to question why you're storing the condition as a string of Lua code. Is new_prefs a general Lua table, or does it need to be valid WML? Note : All these will assume you set the $quests.seen_blood_rain variable to yes instead of 1,...