Search found 2248 matches

by Celtic_Minstrel
Yesterday, 11:33 pm
Forum: Lua Labs
Topic: How to save game into global variable
Replies: 3
Views: 104

Re: How to save game into global variable

There is probably no way to save the entire game with all the information of a real saved game. You might be able to get close by writing wesnoth.scenario.__cfg (if that exists, didn't check) and also dumping every unit and maybe a few other things. Maybe I could copy/reproduce code for saving and l...
by Celtic_Minstrel
Yesterday, 11:24 pm
Forum: Lua Labs
Topic: Messing with saving and reloading
Replies: 12
Views: 310

Re: Messing with saving and reloading

I don't think there's any reason why we couldn't have a way for an add-on to explicitly request a save or load, as long as: There are protections against overwriting other save files (maybe with the exception of save files explicitly requested by the same add-on). The user is not forced to load when...
by Celtic_Minstrel
Yesterday, 5:36 pm
Forum: Writers’ Forum
Topic: Gathering information about Scepter of Fire Campaign
Replies: 49
Views: 11188

Re: Gathering information about Scepter of Fire Campaign

I just want to note that if this has changed to actually working on the campaign rather than just "gathering information", you should probably create a new thread or at least rename the opening post and new posts.
by Celtic_Minstrel
Yesterday, 5:34 pm
Forum: Lua Labs
Topic: [closed] txt file creation
Replies: 2
Views: 80

Re: txt file creation

Wesnoth provides no facility for writing arbitrary files, only for reading them. There is a facility for writing arbitrary WML to disk in a fixed location though – look for PersistenceWML.
by Celtic_Minstrel
Yesterday, 5:33 pm
Forum: Lua Labs
Topic: Messing with saving and reloading
Replies: 12
Views: 310

Re: Messing with saving and reloading

ZombieKnight wrote: Yesterday, 4:52 pm Any idea how to save the game using add-on?
I don't think there's any way to do that.
by Celtic_Minstrel
Yesterday, 2:15 am
Forum: Writers’ Forum
Topic: Gathering information about Scepter of Fire Campaign
Replies: 49
Views: 11188

Re: Gathering information about Scepter of Fire Campaign

I thought that might be the case too, but I didn't read closely.
by Celtic_Minstrel
May 2nd, 2024, 11:33 pm
Forum: Writers’ Forum
Topic: Gathering information about Scepter of Fire Campaign
Replies: 49
Views: 11188

Re: Gathering information about Scepter of Fire Campaign

Even if that's a very nice portrait, it doesn't seem to match the style of Wesnoth?
by Celtic_Minstrel
May 2nd, 2024, 11:30 pm
Forum: Lua Labs
Topic: Messing with saving and reloading
Replies: 12
Views: 310

Re: Messing with saving and reloading

This is an unexplored idea, so I don't know what way to implement it (the more elegant, the better) 1. How to disable reloading an older state of the game (or resulting into loading the latest one)? (my ideas: global variable saving ... ) 2. How to reload the game to one of its older states using c...
by Celtic_Minstrel
April 30th, 2024, 11:46 pm
Forum: WML Workshop
Topic: StandardUnitFilter, adjacent to tile
Replies: 4
Views: 179

Re: StandardUnitFilter, adjacent to tile

I think I would suggest using [filter_adjacent_location] instead of [filter_adjacent] . As you suspected, [filter_adjacent] requires a unit to be present (it is, after all, part of StandardUnitFilter). Something like this (untested): [harm_unit] [filter_location] [filter_adjacent_location] x,y=$hit_...
by Celtic_Minstrel
April 30th, 2024, 11:37 pm
Forum: Scenario & Campaign Development
Topic: Need some fake bullying comments about campaigns for a meta-campaign
Replies: 7
Views: 392

Re: Need some fake bullying comments about campaigns for a meta-campaign

(Note: Some of these may sound more convincing with a few more typos and the like, or swapping out synonyms. Or if you just use them as inspiration rather than using them verbatim, that's fine too.) How could you ever think it would be fun for the main character to be killed off in the third scenar...
by Celtic_Minstrel
April 28th, 2024, 5:08 am
Forum: Lua Labs
Topic: [solved] How to store unit using custom wml tag
Replies: 4
Views: 193

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...
by Celtic_Minstrel
April 28th, 2024, 5:03 am
Forum: WML Workshop
Topic: Nearly impassably terrain
Replies: 3
Views: 174

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...
by Celtic_Minstrel
April 28th, 2024, 4:49 am
Forum: Lua Labs
Topic: [solved] How to store unit using custom wml tag
Replies: 4
Views: 193

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...
by Celtic_Minstrel
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: 157

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.
by Celtic_Minstrel
April 27th, 2024, 8:27 pm
Forum: Lua Labs
Topic: [solved] two [grid] tags
Replies: 54
Views: 1155

Re: [solved] two [grid] tags

Ravana wrote: April 27th, 2024, 7:52 pm It is way how to run wml such as [lua] midscenario with debug command.
Or rather, it is the function to run arbitrary ActionWML for any reason whatsoever.