Can't use Prefab Maker for some reason?
Follow the steps below to create prefabs without Prefab Maker.
- Map out your prefab(s) in a 'TileMap'.
- Enter Tilemap prefab data into map notes.
Inside the Note field on your 'TileMap' properties Enter the following:
<MTPrefabsStart>
<MTPrefabsEnd>
Between those two tags you will create your prefabs.
<MTPrefabsStart>
<Name, x, y, width, height>
<MTPrefabsEnd>
Name is the name you wish to assign the prefab.
x is the x location of the upper left tile of the prefab on the 'TileMap'.
y is the y location of the upper left tile of the prefab on the 'TileMap'.
width is the number of tiles wide the prefab will be.
height is the number of tiles high the prefab will be.
Example:
<MTPrefabsStart>
<MyFirstPrefab, 3, 3, 6, 6>
<MySecondPrefab, 2, 2, 4, 4>
<MTPrefabsEnd>
Once you've done this you can call these prefabs using the usePrefab script call.
let Name = "MyFirstPrefab";
let x = 13;
let y = 37;
let changeRegion = true;
let save = true;
Ritter.MapTransform.usePrefab(Name, x, y, changeRegion, save);