Removing Random Level Generation Labels
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.
Re: Removing Random Level Generation Labels
Gah Note to self: read code written by myself at least thrice to notice all glaringly obvious mistakes. Sorry about that.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.
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}
Co-Creator of The Fellowship of the Clay (BfW 1.10) ~~ Maintainer of the German Code of Conduct
How to isolate problematic WML code ~~ WML error messages and their reasons
How to isolate problematic WML code ~~ WML error messages and their reasons
Re: Removing Random Level Generation Labels
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.
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.
Re: Removing Random Level Generation Labels
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.
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.Ceres wrote:I tried that too, but it only removes the random name parts. You have still things like "'s Forest
" or "ham
" left.
Re: Removing Random Level Generation Labels
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:wrong link, sorry...
http://svn.gna.org/viewcvs/wesnoth/trun ... dialog.cpp
adding label["immutable"] = "no"; should be enough...
Max wrote:label["immutable"] = "no"
Re: Removing Random Level Generation Labels
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);