2.0 port of Biter_Detector_Sentinel_Combinator

Place to get help with not working mods / modding interface.
onkelflorian
Manual Inserter
Manual Inserter
Posts: 3
Joined: Fri Jun 03, 2016 10:00 pm
Contact:

2.0 port of Biter_Detector_Sentinel_Combinator

Post by onkelflorian »

Hi im trying to port Biter_Detector_Sentinel_Combinator to factorio 2.0

i solved multiple issues, following the 2.0 porting guide, regarding the recipe and got it running until i place it down. i get the following error message:
Error while running event Biter_Detector_Sentinel_Combinator::on_nth_tick(12)
LuaConstantCombinatorControlBehavior doesn't contain key parameters.
stack traceback:
[C]: in function '__index'
__Biter_Detector_Sentinel_Combinator__/control.lua:147: in function 'update_sentinel_signal'
__Biter_Detector_Sentinel_Combinator__/control.lua:274: in function <__Biter_Detector_Sentinel_Combinator__/control.lua:239>
79.703 Quitting: user-quit.
79.994 Steam API shutdown.
79.997 Goodbye
the section of the code it is referring to is in the control.lua:

Code: Select all

local function update_sentinel_signal(s)
	local ecc = s.e.get_control_behavior()
	if not (ecc and (ecc.enabled or s.alarm)) then return end

	-- Find slots to replace/fill-in, as well as special control signals
	local ps, ps_stat, ps_free, sig, range, alarm_test = {}, {}, {}
	-- Internal slots on combinator itself
	for n, p in ipairs(ecc.parameters) do
		if not p.signal.name then table.insert(ps_free, {n, p.index})
		else
			sig = ('%s.%s'):format(p.signal.type, p.signal.name)
			if BiterSignals[sig] then ps_stat[sig] = {n, p.index} else ps[sig] = p end
			if sig == conf.sig_range then range = p.count or 0 end
			if sig == conf.sig_alarm_test then alarm_test = p.count ~= 0 end
	end end
specifically the the line147 "for n, p in ipairs(ecc.parameters) do".

i found that the constant combinator has changed quite a bit. its not my mod in the first place but i would like to update it, its a nice addition with a missing feature: getting a signal when a biter is in range...

anybody able to help here?
Post Reply

Return to “Modding help”