Accumulator Wagon


Adds a train wagon capable of storing and transporting electric power, allowing new means of getting power to remote outposts and power grids. Special circuit signals allow for fine-grained control of charging and discharging priority.

Content
3 years ago
0.16 - 1.1
10.5K
Trains

b correct removal of proxy entities

3 years ago
(updated 3 years ago)

I think on_pre_player_mined_item is the wrong event for on_entity_gone, as it doesn't contain the mined entity. Instead you should probably handle on_player_mined_entity and on_robot_mined_entity. You might also want to handle on_entity_cloned, for compatibility with other mods.
(The same goes for your other mod, logistic cargo wagon.)

Let me correct that, I had some incorrect information.
AFAIK you should listen to on_player_mined_entity and on_robot_mined_entity in order to remove the proxy entities. Looking through your code, I can only find on_pre_player_mined_item. If I understand the API documentation correctly, this is incorrect. (on_pre_player_mined_item only fires if an item is put into the players inventory. For example, this causes proxy entities to stay behind in the map editor).
(same applies to your other mod, logistic cargo wagon.)

3 years ago
(updated 3 years ago)

Unless you already do all that and I'm just terrible at reading code, in which case I'm sorry for bothering you.

3 years ago
(updated 3 years ago)

Ugh, I should think more before I write bug reports. Turns out that in some modes, the map editor just doesn't fire any events when deleting an entity.
However, after some tests, I can confirm that robots can leave an invisible accumulator behind when deconstructing the wagon (properly in the game, not just in the map editor this time). The logistics cargo wagon seems to be ok on the other hand, since the wagon can't be mined with a passenger in it anyway. (Although I still can't get that mod to work properly.)

btw, I really appreciate your stuff on here. I feel like that didn't get across in my last couple of messages.

3 years ago

Ahh, more map editor weirdness - fun! Good work figuring it out. And yeah, I think there's something freshly buggy about the cargo wagon, should have some time to dig this weekend.

New response