Tile Randomization

 BIG NOTE: This thread is unfinished and will be finished / completely written by: B1_Gaming (Bu1ld3r) 

'''NOTE: The ingame part of the tutorial was originally written by customlevelfan78 on HorizonWII.net so credit goes to him for this part. I have rewritten it a bit because there were some things that were not mentioned in his tutorial.'''

Introduction
After you've created a tileset you may have some problems with repeating tiles like:

This tutorial will help you to create a randomization for tiles inside Newer Super Mario Bros Wii and Reggie.

Requirements
- Newer Sources

- Puzzle

- Ruby

- Notepad++

Pre Steps:
- Go in NEWERSOURCES > Kamek > tools and open randtilegen.rb in Notepad++

- Open your tileset in Puzzle, to have it ready and choose the tiles

Step 1 - Adding your tileset to the Script:
- This will add your tileset in the randomization list. For this example, i'll use ''Pa1_obake_soto. (This tileset is already randomized but i want to use it as an example)'' - Scroll until the end of the file in Notepad++ (before the directory), then paste the following (DON'T forget the PaX_ prefix) - Edit this template as you wish (remove the second tileset, if you don't need it) - When filled, it will look like this :

Step 2 - Choosing the tiles to randomize:
- These steps will allow you to find what tiles will be randomized

- Go back to Puzzle (if it helps, toggle alpha by clicking on the related option in Tasks)

- Now you have to find the tiles' coordinates : to count the tiles you have to count the hexadecimal way which counts like the following:

- Remember that you have to write the Y postition and then the X position.

Step 3 - Adding randomization to the code:
- It's now time to add the randomization code to the newly-added tileset !

- Paste the following template in a new line inbetween the start and the end of the tileset code :

If you have many tiles that are next to each other, like in the first and second example, you can make it in a quicker way, using the following template (the first and last tiles are included) :

Note that the parameter is not necessary.

Parameters
Parameters tell the game in which direction to randomize. Their usage depends on the tile's usage in Reggie :

-   is for tiles that aren't expanded, and here the game will choose a random one between the given ones

-   is for tiles that are only expanded horizontally

-   is for tiles that are expanded vertically

-   is for tiles that are expanded in both directions

-   and   are for couples of tiles, as they allow to apply randomization to both while matching each top tile (where   is applied) to the respective bottom one (where   is applied ).