How can I use GDScript to set a cell on a Tilemap to an atlas subtile?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By rami-slicer

I’m trying to make a 2D procedural terrain generator in Godot 3.2 and I would like for the generator to be able to select various shades of a color to represent grass, stone, dirt, etc.
I have a palette with said colors, and I created an atlas for each tile type, however I can’t find a way to make the script place a specific subtile from a specific atlas. Help?

:bust_in_silhouette: Reply From: rakkarage

set_cell takes a Vector2 autotile_coord that determines which sub tile to use