Page 1 of 1

[Solved]Using autoplace to make a tile appear under a resource?

Posted: Fri Jun 27, 2025 7:49 pm
by Fishbus
Heya,

I'm trying to achieve a look that is to create a tile under the same location as a certain resource when generating chunks.

e.g.: creating a stone-tile under iron-ore resources.

My current thought is to perhaps have a tile have the exact same autoplace function as the resource in question, but I can't quite wrap my little lizard brain around it. It doesn't need to be precise, it can be roughly the same.

NOTE: I'd like to do it that way, not the other way around (i.e. not using tile restriction on an ore autoplace to only appear on this tile).
Also without using runtime scripts.

Cheers

Re: Using autoplace to make a tile appear under a resource?

Posted: Fri Jun 27, 2025 8:34 pm
by robot256
IIRC, I discovered by accident that Aquilo uses an effect trigger event to create ice under it. (I had copied it and somehow ice was spawning on Nauvis, traced back to the build effect trigger on the resource entity.) That sounds like exactly what you want.

Re: Using autoplace to make a tile appear under a resource?

Posted: Fri Jun 27, 2025 9:59 pm
by Fishbus
robot256 wrote: Fri Jun 27, 2025 8:34 pm IIRC, I discovered by accident that Aquilo uses an effect trigger event to create ice under it. (I had copied it and somehow ice was spawning on Nauvis, traced back to the build effect trigger on the resource entity.) That sounds like exactly what you want.
Thank you!

Investigating down this path, lead me to make a function that is just the ticket:
(based on the aquilo one, but allowed to be customizable more easily)

Code: Select all

local function create_tiles(tilename, rad)
  return {
		type = "direct",
		action_delivery =
		{
			type = "instant",
			target_effects =
			{
				{
					type = "set-tile",
					tile_name = tilename,
					radius = rad or 1,
				}
			}
		}
	}
end
in the resource entry I just put this:
created_effect = create_tiles("grass-2", 2.5),

Re: [Solved]Using autoplace to make a tile appear under a resource?

Posted: Wed Jul 02, 2025 7:38 am
by Natha
Alternatively, you can use the same noise expression for your tile autoplace