Page 1 of 1

"column_count" not found in property tree Problem

Posted: Fri Aug 17, 2018 2:47 pm
by Pippaf1
Hi I am playing Factorio v 0.16.51. I have a mod giving the following Error:

Error while running event DriveAssist::on_player_driving_changed_state (ID 26)
Key "column_count" not found in property tree at ROOT
stack traceback:
__DriveAssist__/control.lua:6: in function <__DriveAssist__/control.lua:1>

Any help please. Philippa

Re: "column_count" not found in property tree Problem

Posted: Fri Aug 17, 2018 3:56 pm
by eradicator
There's no mod called "DriveAssist" on the mod portal. So i have no clue who the author is, but you should contact them. Maybe the in-game mod menu tells you the contact info?

If it's your own mod please upload the relevant code. Sounds like something is trying to access column_count on a non-table gui element.

Re: "column_count" not found in property tree Problem

Posted: Fri Aug 17, 2018 7:00 pm
by Pippaf1
This is an old mod first authored by "Turtleā€ and subsequently modded to keep up with factorio versions.

I find this mod to be very useful as the driving mechanic in the game is sketchy to say the least.

Please find below the control lua code:

Code: Select all

script.on_event(defines.events.on_player_driving_changed_state, function(event)
    local player = game.players[event.player_index]
    if player.vehicle and player.vehicle.valid and player.vehicle.type == "car" then
        if player.gui.left.frameDA == nil then
            local frameDA = player.gui.left.add{type = "frame", name = "frameDA", direction = "horizontal"}
            local tab = frameDA.add{type ="table", name = "tableDA", colspan = 3}
            tab.add{type = "button", name = "buttonDANorthWest", caption = "NW"}
            tab.add{type = "button", name = "buttonDANorth", caption = "N"}
            tab.add{type = "button", name = "buttonDANorthEast", caption = "NE"}
            tab.add{type = "button", name = "buttonDAWest", caption = "W"}
            tab.add{type = "label", name = "DAblank4", caption = " "}
            tab.add{type = "button", name = "buttonDAEast", caption = "E"}
            tab.add{type = "button", name = "buttonDASouthWest", caption = "SW"}
            tab.add{type = "button", name = "buttonDASouth", caption = "S"}
            tab.add{type = "button", name = "buttonDASouthEast", caption = "SE"}
        end
    elseif player.gui.left.frameDA then
        player.gui.left.frameDA.destroy()
    end
end)

script.on_event(defines.events.on_gui_click, function(event)
    local player = game.players[event.player_index]
    if event.element.name == "buttonDANorth" then
        player.vehicle.orientation = 0.0
    elseif event.element.name == "buttonDANorthWest" then
        player.vehicle.orientation = 0.875
    elseif event.element.name == "buttonDAWest" then
        player.vehicle.orientation = 0.75
    elseif event.element.name == "buttonDASouthWest" then
        player.vehicle.orientation = 0.625
    elseif event.element.name == "buttonDASouth" then
        player.vehicle.orientation = 0.5
    elseif event.element.name == "buttonDASouthEast" then
        player.vehicle.orientation = 0.375
    elseif event.element.name == "buttonDAEast" then
        player.vehicle.orientation = 0.25
    elseif event.element.name == "buttonDANorthEast" then
        player.vehicle.orientation = 0.125
    end
end)
As my coding skills are virtually non existent. I just get by fixing the info.json file to get the game to see the mod. This problem is a bit beyond me.

So all help is very gratefully received. Philippa

Re: "column_count" not found in property tree Problem

Posted: Fri Aug 17, 2018 7:23 pm
by Klonan
'colspan' is now 'column_count'

Re: "column_count" not found in property tree Problem

Posted: Fri Aug 17, 2018 9:38 pm
by Pippaf1
Thank you Klonan, I did the suggested change and all is now working fine. :D