Help with Fluid Mix Check

Place to get help with not working mods / modding interface.
TheSAguy
Smart Inserter
Smart Inserter
Posts: 1456
Joined: Mon Jan 13, 2014 6:17 pm
Contact:

Help with Fluid Mix Check

Post by TheSAguy »

Hi,

I have a problem whit the new fluid mechanic. The game crashes due to the new fluid mix check.
I have a Solar Boiler in my MOD. The way it works, is that I create a hidden boiler unit when you place a solar panel.

Code: Select all

	--- Bio Solar Boiler / Solar Plant has been built
	if entity.valid and entity.name == "bi-solar-boiler-panel" then
		   
		local solar_plant = entity
		local boiler_solar = "bi-solar-boiler"   		
		
		local create_solar_boiler = surface.create_entity({name = boiler_solar, position = position, force = force}) -- Hidden Solar Paner
		
		create_solar_boiler.minable = false
		create_solar_boiler.destructible = false	
		
		-- Group Multiple Entities Together
		global.bi_solar_boiler_table[solar_plant.unit_number] = {base=solar_plant, boiler=create_solar_boiler, pole=create_sm_pole}		
		
	end

When you place the solar boiler next to existing pipes, the game crashes, because the steam and water touch.
As you can see on the image below, the inage on the right shows that the created solar boiler has a water input and a steam output. If you build the solar boiler to anb existing pipe, like on the left, it crashes.
Image

I think I somehow need to put in a check to see if it's possible to build the solar boiler before you place it, just like pipe, so it will tell you if it's legal.
Anyone know how to do this?

Thanks.
Post Reply

Return to “Modding help”