Here is my code for map generation. I want to make particles emit from
Dirtwall to produce a smoke-like effect from them. I'm considerably
far in my game development, but the further I get, the more confused I
am(guess thats learning, though.) How would i do this? I have a
particle scene ready to call but even then I don't know how i would
specifically set EACH particle on each Dirtwall generated.

`````` func make_map():
#core of map floor / rock
for x in range(1, current_map_size.x - 1):
for y in range(1, current_map_size.y -1):
var num = rand_range(0.0, 100.0)
if num < percentage_floors:
set_cell(x,y, TILES.Wispfloor)
else:
set_cell(x,y, TILES.Dirtwall)
#Rockborder set  L/R Sides
for x in [0, current_map_size.x - 1]:
for y in current_map_size.y:
set_cell(x, y, TILES.Dirtwall)
#Top n Bot Sides
for x in current_map_size.x:
for y in [0, current_map_size.y - 1]:
set_cell(x, y, TILES.Dirtwall)
func smooth_map():
#
for x in range(1, current_map_size.x - 1):
for y in range(1, current_map_size.y - 1):
var number_of_neighbor_walls = 0
for direction in neighbor_dir:
var current_tile = Vector2(x,y) + direction
if get_cell(current_tile.x, current_tile.y) == TILES.Dirtwall:
number_of_neighbor_walls += 1
#check if we should change tile based on neighboring tiles
if number_of_neighbor_walls > 4:
set_cell(x,y, TILES.Dirtwall)
elif number_of_neighbor_walls < 4:
set_cell(x,y, TILES.Wispfloor)
``````

From your code it's not apparent when and where you want to spawn the particles. In principle this is as easy as setting the `global_position`-property of the Particle2D to the `global_position` of the tile which you can get by the following line:

``````to_global(\$TileMap.map_to_world(Vector2(x, y)))
``````

Edit: `map_to_world` expects a Vector2() instead of two variables for `x` and `y`

I haven't included any code that has to do about the particle generation, but that makes sense. would that apply the particles to each and every specific Dirtwall generated block?
Thats what i'm trying to pull off

would that apply the particles to each and every specific Dirtwall generated block?

You mean to all of them at the same time? No. The line I posted above will give you the global coordinates of the TileMap-cell (x, y) - and then you could spawn a particle effect there. If you want to do this for all tiles you would do something like:

``````for cell in \$TileMap.get_used_cells():
var particle_position = to_global(\$TileMap.map_to_world(cell))
``````for cell in \$TileMap.get_used_cells_by_id(2):