- Edited
I want to loop through the world and find any "Grass" tiles on my Tilemap. I then want to perform an action on each valid tile, like instancing a new scene.
What I'm trying to accomplish is creating any trees, rocks, etc in the world at runtime. This let's me build the background map, and generate a new environment each playthrough.
I'm new to Godot, recently migrating from BYOND. Over there, this would be pretty straightforward. Just tell the client that for every grass in the world, place a tree if a probability threshold is met:
World
GenerateTrees()
for(var/turf/grass/g in world)
if(prob(10))
var/obj/tree/t = new(obj/tree)
t.loc=locate(g.x, g.y, g.z)
I have no clue how I'd go about doing something like this with GDscript, though... can anyone help me out?