Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
RandomPicker no longer accepts things that have probability zero or less #1100
I'm developing a game with my friend, that includes random level generator. The level generator works better, if I set terraintypes to as many tiles as possible. However, I don't want these tiles to appear when modifying terrain in Tiled, so I set their probability to zero. This causes problems, because things in QMap container in RandomPicker get overwritten.
In this pull request, I've modifier the RandomPicker class, so it ignores those things that have zero probability or less. It fixes the problem.
I tested it with stamp and bucket fill with random mode, and I also tested terrain tool. It didn't cause any problems, not even when I set everything to have zero or negative probability.
added a commit
this pull request
Sep 28, 2015
It was a mandatory fix for Tiled too. :-)
You can export a tileset with the little Export button below the tileset view. You can then add that same tileset to other maps.
When you want to move your other maps over to refer to the same tileset, you could either choose to Export there too and then overwrite the external tileset file, or you could edit your maps in a text editor to change the tileset element to a reference to external tileset as you'll find in the first map file.