[MOD 0.16] Charge Transmission - Wireless Bot Charging

Topics and discussion about specific mods
User avatar
jamiechi1
Fast Inserter
Fast Inserter
Posts: 196
Joined: Wed Jan 03, 2018 10:12 pm

Re: [MOD 0.16] Charge Transmission - Wireless Bot Charging

Post by jamiechi1 »

I got it partly working for version 0.17. Here is a copy of my notes that I placed in discussions in the mod portal.

Needed to edit the json file as usual, and update the science labels to the new ones.
In prototypes/charger.lua (in a couple of places):
-- energy_usage = "0kW", -- game does not like this
energy_usage = "0.0001kW",
And the new science pack names:
{"automation-science-pack", 1},
{"logistic-science-pack", 1},
{"chemical-science-pack", 1},
{"production-science-pack", 1}

Needed to edit the json file as usual.

Initially had a crash when placing the Charge Transmission device. The game didn't like the return of an 'inf' when a real was expected so I removed math.huge and replaced it with 1000000. Don't know if a larger value is needed or not.
Changed Control.lua as shown below.
--bot.energy = math.huge
bot.energy = 1000000000 --edit: changed from 1 million to 1 billion - maybe needs to be bigger?
Seems to work ok after a few minutes testing.

Edit: The offsets for the interface needs adjusted.
Changes in charger.lua to adjust interface:

selection_box =
{
util.by_pixel(9, -13), util.by_pixel(31, 9) -- changed this line
},
...
-- shift = util.by_pixel(20, 20), -- from this
shift = util.by_pixel(20, -2), -- to this
hr_version =
{
filename = "__ChargeTransmission__/graphics/entities/charger/hr/base-interface.png",
width = 28,
height = 28,
x = (i-1) * 28,
scale = 0.5,
-- shift = util.by_pixel(20, 20), -- from this
shift = util.by_pixel(20, -2), -- to this
}

I don't know how to fix the menu that pops up when you click on the interface. Currently dispays a blank dialog.

User avatar
infinitysimplex
Burner Inserter
Burner Inserter
Posts: 14
Joined: Fri Jul 28, 2017 8:26 pm
Contact:

Re: [MOD 0.16] Charge Transmission - Wireless Bot Charging

Post by infinitysimplex »

I've been "gone" from the forums for about one and a half years (life takes its taxes ._.) and a lot has been happening here, I see. First of all, I'm really glad that so much has been done and worked. Great! :)
LION42 wrote:
Mon Apr 02, 2018 5:06 pm
(...)
jamiechi1 wrote:
Sat Apr 06, 2019 4:22 am
(...)
For one, Dustine released the mod as essentially feature-complete and 1.0, so I guess updating to a new game version isn't a priority. Actually, it can be terribly grinding and depressing, since one isn't building anything new, and programmer's burnout happens.

Then, regarding bots "forgetting" their task: The mod "resets" the bots (actually, their force) after charging them. That was the only way Dustine could stop them from waiting to be charged / going to a roboport. In 0.16, the game assigned them their original jobs back immediately. It seems that the job-assignment method changed in 0.17, and so this doesn't work any more. One could probably hack around a bit and try to find another way to send a bot back to its task after charging. But I (still) know too little Lua and factorio internals to do it, at least without some training period, for which I don't have the time atm. Does this help anyone who wanted to get into it? Sorry I can't help more. :?

Anyway, I'm glad it worked in 0.15 and 0.16, I played around with it quite a bit. Maybe it will be picked up by the devs or others, or we'll see more things from the author. Looking forward to it all. :3

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

Re: [MOD 0.16] Charge Transmission - Wireless Bot Charging

Post by eradicator »

infinitysimplex wrote:
Thu Jun 06, 2019 1:08 am
It seems that the job-assignment method changed in 0.17, and so this doesn't work any more. One could probably hack around a bit and try to find another way to send a bot back to its task after charging. But I (still) know too little Lua and factorio internals to do it, at least without some training period, for which I don't have the time atm
Having done my fair share of consulting on this i can say it was a pita to get it working in the first place. So good look to anyone who wants to try to get it to work again if the old methods don't work anymore. Some of my old posts may contain still unused hacks that may still work. Ordernig individual robots to do something specific is impossible though as far as i know, if that worked we'd never had to use hacks in the first place.
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.

User avatar
infinitysimplex
Burner Inserter
Burner Inserter
Posts: 14
Joined: Fri Jul 28, 2017 8:26 pm
Contact:

Re: [MOD 0.16] Charge Transmission - Wireless Bot Charging

Post by infinitysimplex »

eradicator wrote:
Thu Jun 06, 2019 7:06 am
Having done my fair share of consulting on this i can say it was a pita to get it working in the first place. So good look to anyone who wants to try to get it to work again if the old methods don't work anymore. Some of my old posts may contain still unused hacks that may still work. Ordernig individual robots to do something specific is impossible though as far as i know, if that worked we'd never had to use hacks in the first place.
That's where I got it from. :D Keep up the good work, you all, you really keep the game and community alive. :)
I'm just a bit worried that Dustine might have succumbed to the "pressure" of having to make progress, and therefore retreated from the community. :(
Take care of yourselves always, whatever you're doing. :)

Post Reply

Return to “Mods”