ports to 1.7: random map generator

Discussion of all aspects of the game engine, including development of new and existing features.

Moderator: Forum Moderators

Post Reply
User avatar
Natasiel
Moderator Emeritus
Posts: 60
Joined: February 28th, 2007, 7:43 pm

ports to 1.7: random map generator

Post by Natasiel »

I don't know if this is the right place to post about it, but seems fit.

I am trying to port World Conquest to 1.7 and met some issues. Some I have been able to fix, some others waiting for my ignorance to be filled.

My main problem is to clear the labels on the map. The map generator places random labels for villages and groups of hexes like forests, lakes, etc. Those are unwanted, adding noise to the manually set labels.

So far I have been unable to get rid of those labels, any help would be appreciated.

Thank you,

Natasiel.
Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Re: ports to 1.7: random map generator

Post by Boucman »

I saw your post yesterday, and had a quick look at the code

there is no way to easily remove the labels at this point

i'll try to add something before final 1.8, but no promises.
Fight key loggers: write some perl using vim
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: ports to 1.7: random map generator

Post by AI »

This should clear the map at prestart.

Code: Select all

[event]
  name=prestart
  [lua]
    code=<<
      local w, h, b = wesnoth.get_map_size()
      for y1 = 1 - b, h + b do
        for x1 = 1 - b, w + b do
          wesnoth.fire("label",{x=x1,y=y1,text=""})
        end
      end
    >>
  [/lua]
[/event]
User avatar
Natasiel
Moderator Emeritus
Posts: 60
Joined: February 28th, 2007, 7:43 pm

Re: ports to 1.7: random map generator

Post by Natasiel »

Thanks to both of you. the lua snippet did the trick.
Post Reply