Page 2 of 2

Re: electric trains

Posted: Sun Aug 30, 2015 3:18 am
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.

Re: electric trains

Posted: Sun Aug 30, 2015 11:58 am
by @xi@g@me
Nice! Hope to see how you did that ASAP

Re: electric trains

Posted: Sun Aug 30, 2015 12:04 pm
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.

Re: electric trains

Posted: Sun Aug 30, 2015 1:12 pm
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.

Re: electric trains

Posted: Sun Aug 30, 2015 2:53 pm
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.

Re: electric trains

Posted: Mon Aug 31, 2015 11:16 am
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 ?

Re: electric trains

Posted: Mon Aug 31, 2015 5:26 pm
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()

Re: electric trains

Posted: Mon Aug 31, 2015 7:01 pm
by @xi@g@me
Ah, OK, good to know :)