Smart Display - conflict with Power Armor

Place to get help with not working mods / modding interface.
Post Reply
drkusa
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Mar 18, 2016 9:30 pm
Contact:

Smart Display - conflict with Power Armor

Post by drkusa »

I posted this note as a reply in another topic because I didn't know how to start a new topic then. So this is a dupe of that post.

In Factorio 16, I'm running into a conflict between the Smart Display mod and Power Armor. With a Smart Display entity placed on the map, as soon as I right-click Power Armor, it crashes to an error message (attached) and ends the game. Had a similar problem with Belt Sorter, but the modder posted a code change to a Control.lua file that corrected it. I looked in the Smart Display control folder but didn't see any code comparable to what I had seen in the Belt Sorter code...thought the same fix might work here but didn't see where to try it. Could be a completely different conflict issue.

I find the Smart Display mod an invaluable tool and really need it. But I also need better armor to take on the aliens. Any ideas how to fix this?
Attachments
FactorioPowerArmorError.JPG
FactorioPowerArmorError.JPG (18.48 KiB) Viewed 1857 times

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Smart Display - conflict with Power Armor

Post by eradicator »

There's 3 different versions of SmartDisplay on the portal, assuming latest...

Code: Select all

--LINE 595:
--if opened and opened.valid then  --wrong
if opened and opened.valid and opened.name then --better
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

drkusa
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Mar 18, 2016 9:30 pm
Contact:

Re: Smart Display - conflict with Power Armor

Post by drkusa »

Eradicator,
Thanks for the prompt reply and suggested fix. I'm not familiar with lua coding, so I must not have done it right. I copied and pasted the code you posted at Line 595 (which also extended into Line 596, but I still get an error, though slightly different than the previous one (attached). I've included a shot of the lua code section as i have it now. What am I doing wrong?
Attachments
FactorioPowerArmorErrorLuaCode.JPG
FactorioPowerArmorErrorLuaCode.JPG (33.63 KiB) Viewed 1824 times
FactorioPowerArmorError02.JPG
FactorioPowerArmorError02.JPG (25.76 KiB) Viewed 1824 times

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Smart Display - conflict with Power Armor

Post by eradicator »

Nah. You did it correctly. It's just that my quick hack didn't work. You really ought to contact the mod author and tell them to apply a proper fix. You can try one more ugly hack i can think of, but if that doesn't work there's no quick fix to it (and even if it works the author should still fix it properly).

Instead of my previous fix try this:

Code: Select all

-- if opened and opened.valid then -- wrong
if opened and opened.valid and (player.opened_gui_type == defines.gui_type.entity) then --more hackery
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

drkusa
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Mar 18, 2016 9:30 pm
Contact:

Re: Smart Display - conflict with Power Armor

Post by drkusa »

Thanks for giving it a shot. I don' t know enough about coding even to attempt finding a solution. Hopefully the mod author will have a fix in mind.

drkusa
Burner Inserter
Burner Inserter
Posts: 10
Joined: Fri Mar 18, 2016 9:30 pm
Contact:

Re: Smart Display - conflict with Power Armor

Post by drkusa »


User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Smart Display - conflict with Power Armor

Post by eradicator »

eradicator wrote:There's 3 different versions of SmartDisplay on the portal, assuming latest...
Lesson learned: Next time link the version you're using in the opening post. ;)
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Modding help”