whenever I click on a station that existed before this mod was installed, I get a crash:
_Trains_Caller _/methods/guiFrameEvents.lua:32 attempt to index feild '?' (a nil value)
line 31-33:
trainStopEntity.UpdateGui=function(entity)
getFrame(entity,{"station.checkbox"}).state=(global.trainStations[entity.unit_number].callActivated)
end
hmm, maybe i could ...
attempt 1:[
<pre>
if getFrame(entity,{"station.checkbox"}).state~=nil then -- check if station has been assigned varibles by Trains_Caller
--if station build before mod initial load (or just dont have values,
</pre>
-- then give it some
global.trainStations[entity.unit_number]={callActivated=false,station=entity,trainCalled=false}
--
getFrame(entity,{"station.checkbox"}).state=(global.trainStations[entity.unit_number].callActivated)
else -- if has values already, then
getFrame(entity,{"station.checkbox"}).state=(global.trainStations[entity.unit_number].callActivated)
end
]
yay, it works...kinda
but then the activation tic box doesn't stay clicked, and t trying to set up any trains without at least one station active gives yet another error :/
attempt 2,
[
if getFrame(entity,{"station.checkbox"}).state~=nil then -- check if station has been assigned variables by Trains_Caller
--if station build before mod initial load (or just don't have values), then give it some
global.trainStations[entity.unit_number]={callActivated=true,station=entity}
--
getFrame(entity,{"station.checkbox"}).state=(global.trainStations[entity.unit_number].callActivated)
else -- if has values already, then
getFrame(entity,{"station.checkbox"}).state=(global.trainStations[entity.unit_number].callActivated)
end
]
yay, it works...kinda, the activation checkbox stays ticked, the item/signal selection gui can be accessed,
but when in train setup, when an item or number is chosen, errors out
when select station is clicked, errors out
...even for newly built standard stations :(
one error is:
error while running event on_tick (ID 0)
Key station has unknown type
so basically, its having trouble assigning station ids for existing stations for its table, and my poor hax makes it ignore it enough to open the gui, but still ignores the original problem of pre-existing trainstops having no assigned IDs or variables by Trains_Caller. I can't narrow that down in the mod, or how to add it.
[attempts 3-8 have been redacted as nope .flip it. idk.]
hopefully this is some use to you to narrow down the issue