electric trains

Place to get help with not working mods / modding interface.
vzybilly
Fast Inserter
Fast Inserter
Posts: 143
Joined: Thu May 14, 2015 6:10 pm
Contact:

Re: electric trains

Post by vzybilly »

Good news, I have made to fully working mods that use this to power trains. one off of the solar (unlimited) and the other to power off of the electrical network. I've had both running on a map for a good 30 minutes in a big loop, no issues.

I'll polish them up and see about uploading them for the world.
Will code for Food. I also have 11+ mods!

@xi@g@me
Inserter
Inserter
Posts: 30
Joined: Wed Jan 28, 2015 6:03 pm
Contact:

Re: electric trains

Post by @xi@g@me »

Nice! Hope to see how you did that ASAP

JamesOFarrell
Filter Inserter
Filter Inserter
Posts: 402
Joined: Fri May 23, 2014 8:54 am
Contact:

Re: electric trains

Post by JamesOFarrell »

Sadly it is really inconsistent. I never found a good workable solution so i went with coal. Hope you can find a better way.

vzybilly
Fast Inserter
Fast Inserter
Posts: 143
Joined: Thu May 14, 2015 6:10 pm
Contact:

Re: electric trains

Post by vzybilly »

JamesOFarrell wrote:Sadly it is really inconsistent. I never found a good workable solution so i went with coal. Hope you can find a better way.
it is consistent, you just have to do it every tick. until we can find out how to add to the train buffer.
Will code for Food. I also have 11+ mods!

vzybilly
Fast Inserter
Fast Inserter
Posts: 143
Joined: Thu May 14, 2015 6:10 pm
Contact:

Re: electric trains

Post by vzybilly »

https://forums.factorio.com/forum/vie ... 91&t=15364

Electric trains run off of an electrical network.
Solar trains are the basic unlimited energy trains.
Will code for Food. I also have 11+ mods!

@xi@g@me
Inserter
Inserter
Posts: 30
Joined: Wed Jan 28, 2015 6:03 pm
Contact:

Re: electric trains

Post by @xi@g@me »

Yesh, thanks for you mod vzybilly :) I had a look at the code, that's smart :)

However, why is there no function associated to the event on_save of the game ? The maps are not to be saved with the game ?

vzybilly
Fast Inserter
Fast Inserter
Posts: 143
Joined: Thu May 14, 2015 6:10 pm
Contact:

Re: electric trains

Post by vzybilly »

@xi@g@me wrote:Yesh, thanks for you mod vzybilly :) I had a look at the code, that's smart :)

However, why is there no function associated to the event on_save of the game ? The maps are not to be saved with the game ?
From what I hear, "global.*" is stored in the game map. it gets saved automatically. it does persist through games, even full restarts of the games so I would have to say that it's true.

This happens when you start a new world

Code: Select all

game.on_init()
And this happens when you load into an existing world/after saving, which means you need to be very careful with this method has a 2 hour game should see 60 calls to from this, atleast!

Code: Select all

game.on_load()
Will code for Food. I also have 11+ mods!

@xi@g@me
Inserter
Inserter
Posts: 30
Joined: Wed Jan 28, 2015 6:03 pm
Contact:

Re: electric trains

Post by @xi@g@me »

Ah, OK, good to know :)

Post Reply

Return to “Modding help”