disallow_modification query

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
User avatar
Spannerbag
Posts: 759
Joined: December 18th, 2016, 6:14 pm
Location: Yes

disallow_modification query

Post by Spannerbag »

Hi,
Can disallow_modification be used anywhere else besides [modification]?
The wiki isn't clear if this is also recognised inside [resource] so I thought I'd ask here.

My reason for asking is that there is a chance at sometime in the (distant) future I might create a mod/resource.

The thought occurred: is it possible to release something as both a mod (where players can specify a config) and a resources (where the campaign author sets the config)?
However if the player has the mod version installed, the campaign must be able to ignore the [modification].

I suspect the two are separate and it'll have to be one or the other - but thought I'd ask.

Cheers!
-- Spannerbag
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.18, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
User avatar
Ravana
Forum Moderator
Posts: 3313
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: disallow_modification query

Post by Ravana »

You can [filter_condition] for it in any case.
white_haired_uncle
Posts: 1456
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

Re: disallow_modification query

Post by white_haired_uncle »

I don't really know anything about mods/resources/lotsofotherstuff, but I would point out that if you look in data/_main.cfg you can see the order in which stuff gets loaded.

Also, I swear there's a way to query the active mods (like what you see in a save file active_mods="...") from lua. All I can find is wesnoth.scenario.mp_settings (see active_mods).

Anyway, you can probably have one check for the other and take corrective action as necessary.
Speak softly, and carry Doombringer.
User avatar
octalot
General Code Maintainer
Posts: 818
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: disallow_modification query

Post by octalot »

Make the modification load the resource, instead of putting an extra copy of it into the modification. That way, if a campaign author has already enabled the resource, the mod is just telling the engine to enable a resource that's already enabled.
User avatar
Spannerbag
Posts: 759
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: disallow_modification query

Post by Spannerbag »

octalot wrote: August 17th, 2024, 5:30 pm Make the modification load the resource, instead of putting an extra copy of it into the modification. That way, if a campaign author has already enabled the resource, the mod is just telling the engine to enable a resource that's already enabled.
Thanks for the post, that was my thought: use a "wrapper" mod - but from the wiki I got the impression this wasn't allowed.
Would this be as simple as having a mod that basically did a [load_resource]?

Thanks also to Ravana and white_haired_uncle for your posts, it's all appreciated.

Cheers!
-- Spannerbag
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.18, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
Shiki
Developer
Posts: 373
Joined: July 13th, 2015, 9:53 pm
Location: Germany

Re: disallow_modification query

Post by Shiki »

The thought occurred: is it possible to release something as both a mod (where players can specify a config) and a resources (where the campaign author sets the config)?
If the modification used [load_resource], then the code will be included only once even if bot the scenario and the active mode use [load_resource] for the same resource.
Try out the dark board theme.
User avatar
Spannerbag
Posts: 759
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: disallow_modification query

Post by Spannerbag »

Shiki wrote: August 17th, 2024, 10:41 pm [If the modification used [load_resource], then the code will be included only once even if bot the scenario and the active mode use [load_resource] for the same resource.
Thanks for the clarification/confirmation, much appreciated.
Another chink of light dispels another small bit of darkness. :)

Cheers!
-- Spannerbag
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.18, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
Post Reply