Removing Random Level Generation Labels

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.
Ceres
Forum Regular
Posts: 620
Joined: September 18th, 2010, 7:56 pm
Location: Germany

Re: Removing Random Level Generation Labels

Post by Ceres »

Anonymissimus wrote:EDIT
I made a quick check using the interactive :lua debug command, and could remove one of the labels that way, so the FOREACH... should work, something else was wrong I suppose.
Gah :doh: Note to self: read code written by myself at least thrice to notice all glaringly obvious mistakes. Sorry about that.

So, anyway, placing the following code at data/multiplayer/scenarios/Random_Scenario.cfg, line 26 (so it is inside the [event]) will remove all labels on the random map:

Code: Select all

[store_locations]
	variable=hexes
[/store_locations]
{FOREACH hexes i}
	[label]
		x,y=$hexes[$i].x,$hexes[$i].y
		text=""
	[/label]
{NEXT i}
{CLEAR_VARIABLE hexes}
Max
Posts: 1449
Joined: April 13th, 2008, 12:41 am

Re: Removing Random Level Generation Labels

Post by Max »

you have to compile wesnoth yourself:
http://wiki.wesnoth.org/CompilingWesnoth

the result would be an executable that adds immutable=no to all labels. it also means you would have to host the game.

it might be easier to stick to wml/lua.

there's a (i think 1.11) feature that might be interesting:
http://forums.wesnoth.org/viewtopic.php?f=10&t=36348

i might be wrong but this could possibly be used to create an add-on that could offer an option (right-click) to remove those labels.
JaMiT
Inactive Developer
Posts: 511
Joined: January 22nd, 2012, 12:38 am

Re: Removing Random Level Generation Labels

Post by JaMiT »

Crendgrim wrote:Maybe it is enough to edit out the [naming] and [village_naming] tags from the random scenarios (or, if that fails, their content)? I have not tried it, but it seems to be the easiest solution if it works.
Ceres wrote:I tried that too, but it only removes the random name parts. You have still things like " 's Forest" or "ham" left.
That looks like a bug to me. And in fact, there was an attempt in the source code to suppress the fragments for villages, but it was undermined by a "hack". So it didn't work. Anyway, this much is now fixed in trunk.
User avatar
mintleaf
Posts: 40
Joined: October 23rd, 2012, 10:49 am

Re: Removing Random Level Generation Labels

Post by mintleaf »

Max wrote:wrong link, sorry...
http://svn.gna.org/viewcvs/wesnoth/trun ... dialog.cpp

adding label["immutable"] = "no"; should be enough...
Okay, I've got the source ready and this C++ file open. I'm terribly sorry that I have to ask you, where do I put this?
Max wrote:label["immutable"] = "no"
Max
Posts: 1449
Joined: April 13th, 2008, 12:41 am

Re: Removing Random Level Generation Labels

Post by Max »

in one of the last lines:

Code: Select all

config& label = res.add_child("label");
label["text"] = i->second;
label["immutable"] = "no";
i->first.write(label);
Post Reply