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.
Removing Random Level Generation Labels
They just annoy me! I have no clue how to program in Lua but I've been reverse engineering the files a bit. I had to edit the english.cfg to remove the names, but when that happened, labels just turned into error notes. I made them empty strings instead, but the labels still exist, they are just invisible.
I want a way to remove those labels so I can name towns, forests and roads myself, in random maps!
Can anybody help me?
I want a way to remove those labels so I can name towns, forests and roads myself, in random maps!
Can anybody help me?
- Elvish_Hunter
- Posts: 1576
- Joined: September 4th, 2009, 2:39 pm
- Location: Lintanir Forest...
Re: Removing Random Level Generation Labels
Even when using Lua, when placing a label you'll still end up calling wesnoth.wml_actions.label, that is equivalent to the WML tag [label]. So, since this is more a WML question (and especially WML answer) rather than a Lua question, I moved the topic to the WML Workshop.
About removing labels: our wiki says this:
About removing labels: our wiki says this:
So, I'm pretty sure that you can't remove those labels (per default, they're immutable and we don't have a [remove_label] tag), unless you attempt to modify the map generator (http://wiki.wesnoth.org/MapGeneratorWML).immutable: whether this label is protected from being removed or changed by players. Default yes.
Current maintainer of these add-ons, all on 1.16:
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
The Sojournings of Grog, Children of Dragons, A Rough Life, Wesnoth Lua Pack, The White Troll (co-author)
Re: Removing Random Level Generation Labels
Ah, sorry. This just proves my ineptness. Thank you for both the moving of the thread, and the tips. I will report my progress. Thanks again!
EDIT: If you look at the WML Random Map Generator .cfg, there is apparently nothing on labelling. It seems hardcoded. Only the town names are listed, but the suffixes/prefixes are set even though I remove the small label portion in the .cfg.
EDIT: If you look at the WML Random Map Generator .cfg, there is apparently nothing on labelling. It seems hardcoded. Only the town names are listed, but the suffixes/prefixes are set even though I remove the small label portion in the .cfg.
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Removing Random Level Generation Labels
Would it allow you to do a FOREACH loop on all the map hexes and set the label to an empty string?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: Removing Random Level Generation Labels
Tried it, nope.Pentarctagon wrote:Would it allow you to do a FOREACH loop on all the map hexes and set the label to an empty string?
Is there any specific reason for those labels to be immutable? IMO it would make much more sense if they weren't.
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
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.UMC Story Images — Story images for your campaign!
Re: Removing Random Level Generation Labels
I tried that too, but it only removes the random name parts. You have still things like "
's Forest
" or "ham
" left.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
That, again, sounds like a bug or at least a possible FR to me. Imagine you would want to use the generator for a generic scenario, without any of those labels.
UMC Story Images — Story images for your campaign!
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: Removing Random Level Generation Labels
Sounds like a bug. The immutable setting is to prevent players from modifying it, but wml/lua should always be able to do it. (Thus one could write some functionality for it using [set_menu_item].)Ceres wrote:Tried it, nope.Pentarctagon wrote:Would it allow you to do a FOREACH loop on all the map hexes and set the label to an empty string?
The underground random map maps in HttT and SoF don't have labels, so there should be some way/reason (unless it's the fact that those are underground... )
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.
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
Re: Removing Random Level Generation Labels
I personally hate the placename labels and the fact that it’s not optional on random-generated maps.
Yuck yuck yuck yuck. Did not ask for that.
Yuck yuck yuck yuck. Did not ask for that.
Wesnoth Bestiary ( PREVIEW IT HERE )
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Unit tree and stat browser
Canvas ( PREVIEW IT HERE )
Exp. map viewer
Re: Removing Random Level Generation Labels
Yes, exactly. I've analyzed the WML Random Level Generator and it seems hard coded too. Almost as if they went through extra lengths to keep those labels there. Doesn't that suck?
Haha, anyway, I hope somebody comes up with a solution.
Haha, anyway, I hope somebody comes up with a solution.
Re: Removing Random Level Generation Labels
it is:mintleaf wrote:Yes, exactly. I've analyzed the WML Random Level Generator and it seems hard coded too.
here's the file that's placing those labels:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/mapgen.cpp
it creates labels, sets x/y and text=. immutable isn't set and the default happens to be yes.mintleaf wrote:Almost as if they went through extra lengths to keep those labels there. Doesn't that suck?
Re: Removing Random Level Generation Labels
Mmmm, that's some really adept snooping. Could you kindly explain to me how to disable those commands without ruining the integrity of the program? I'm not quite sure what to take apart here.Max wrote:it is:mintleaf wrote:Yes, exactly. I've analyzed the WML Random Level Generator and it seems hard coded too.
here's the file that's placing those labels:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/mapgen.cpp
it creates labels, sets x/y and text=. immutable isn't set and the default happens to be yes.mintleaf wrote:Almost as if they went through extra lengths to keep those labels there. Doesn't that suck?
Re: Removing Random Level Generation Labels
wrong link, sorry...
http://svn.gna.org/viewcvs/wesnoth/trun ... dialog.cpp
adding label["immutable"] = "no"; should be enough...
http://svn.gna.org/viewcvs/wesnoth/trun ... dialog.cpp
adding label["immutable"] = "no"; should be enough...
Re: Removing Random Level Generation Labels
Sorry to take your time even more, but I'd need a quick tutorial on how to do that. Is that inside the Wesnoth exe? I can't find that file in any of the directories. How do I go about editing this? Once again, sorry!