[MOD 0.14.2] Electric vehicles
Re: [MOD 0.14.2] Electric vehicles
hello, i would like to try the mod, but i have made a train and put 2x mk2 batteries and 1 fusion reactor in and still shows no fuel icon, batteries charge very fast and even added the HF coil and i don't understand why it doesn't move? might i recommend some ideas on what is happening in the no fuel icon showing on any tips somewhere in your top postings?
seems there is alot of comments on how these should be implemented, but i just want to play with my new toys and they aren't working?
EDIT:
seriously you have to add a transformer to make it go? gheeze this makes it unnecessarily complicated imo
EDIT 2:
after finally setting up my train and playing with it for a bit, i found it faster (with use of exoskeletons) free to maintain (fusion core, battery combo) and once set i never have to touch it or try and fuel it again. so despite the expense, at first, it is a no maintenance system.
but for those complaining about expense if you are using for personal use, simply change the recipes.lua file to suite whatever cost you feel is appropriate to you. if playing with a friend, share the modified mod, hopefully this isn't gona cause a major issue, but to me i have found if i don't like the cost of the technology, or to craft something, i change it, and go on and enjoy my game.
seems there is alot of comments on how these should be implemented, but i just want to play with my new toys and they aren't working?
EDIT:
seriously you have to add a transformer to make it go? gheeze this makes it unnecessarily complicated imo
EDIT 2:
after finally setting up my train and playing with it for a bit, i found it faster (with use of exoskeletons) free to maintain (fusion core, battery combo) and once set i never have to touch it or try and fuel it again. so despite the expense, at first, it is a no maintenance system.
but for those complaining about expense if you are using for personal use, simply change the recipes.lua file to suite whatever cost you feel is appropriate to you. if playing with a friend, share the modified mod, hopefully this isn't gona cause a major issue, but to me i have found if i don't like the cost of the technology, or to craft something, i change it, and go on and enjoy my game.
Last edited by Philip017 on Mon Oct 10, 2016 7:17 pm, edited 1 time in total.
Re: [MOD 0.14.2] Electric vehicles
You need to equip a 'high voltage transformer' on your locomotivePhilip017 wrote:hello, i would like to try the mod, but i have made a train and put 2x mk2 batteries and 1 fusion reactor in and still shows no fuel icon, batteries charge very fast and even added the HF coil and i don't understand why it doesn't move? might i recommend some ideas on what is happening in the no fuel icon showing on any tips somewhere in your top postings?
seems there is alot of comments on how these should be implemented, but i just want to play with my new toys and they aren't working?
Re: [MOD 0.14.2] Electric vehicles
RE: speed of electric car and tank,
i have found that the car and tank, especially compared to using exoskeletons, to be quite slow,
i have tried to add exoskeletons to my tank and found that it makes it turn faster, but not move faster.
can anyone give me a tip on how to change this function so i can have my tank move a bit faster?
ps i found out how to change the top speed of my locomotive, and now it FLYS! wohoo!
i have found that the car and tank, especially compared to using exoskeletons, to be quite slow,
i have tried to add exoskeletons to my tank and found that it makes it turn faster, but not move faster.
can anyone give me a tip on how to change this function so i can have my tank move a bit faster?
ps i found out how to change the top speed of my locomotive, and now it FLYS! wohoo!
Re: [MOD 0.14.2] Electric vehicles
Is there any chance that these vehicles could, if Bob's vehicle equipment mod is installed, also accept bob's vehicle equipment please?
-
- Filter Inserter
- Posts: 841
- Joined: Mon Sep 14, 2015 7:40 am
- Contact:
Re: [MOD 0.14.2] Electric vehicles
Hello, I'm the author of the Vehicle Wagon mod, and I & some users have noticed bugs when using both Electric Vehicles and Vehicle Wagon together.
Since my mod uses the entity.destroy() method for deleting vehicles, I believe it isn't detected by the tests for invalid entities in your Electric Vehicles Lib code. As such, the next tick after winching a powered electric vehicle onto a wagon, the on_tick function crashes since the electric vehicle no longer exists.
Furthermore, it also seems that if a completely empty electric vehicle is winched onto a wagon, the game won't crash, but when it's winched off again and one goes to try and edit the equipment grid, the script crashes again, presumably because it still believes the old, pre-winch car is still a valid entity, which it is not.
It seems an extra test for invalid entities needs to be performed in your on_tick function before entering the fuel_tick() routine (or perhaps during on_train_changed_state, because the process of winching vehicles inevitable causes train state changes since wagons are deleted and re-attached).
Steps to reproduce:
Since my mod uses the entity.destroy() method for deleting vehicles, I believe it isn't detected by the tests for invalid entities in your Electric Vehicles Lib code. As such, the next tick after winching a powered electric vehicle onto a wagon, the on_tick function crashes since the electric vehicle no longer exists.
Furthermore, it also seems that if a completely empty electric vehicle is winched onto a wagon, the game won't crash, but when it's winched off again and one goes to try and edit the equipment grid, the script crashes again, presumably because it still believes the old, pre-winch car is still a valid entity, which it is not.
It seems an extra test for invalid entities needs to be performed in your on_tick function before entering the fuel_tick() routine (or perhaps during on_train_changed_state, because the process of winching vehicles inevitable causes train state changes since wagons are deleted and re-attached).
Steps to reproduce:
- Start a new Sandbox game with Vehicle Wagon, Electric Vehicles, and Electric Vehicles Lib loaded.
- Accept all the cheats/freebies that pop up
- Build some rails, a Vehicle Wagon, an Electric Car/Tank, and a winch
- Craft a fusion reactor and transformer and put them in the Electric Car/Tank
- Attempt to winch the car/tank onto the wagon
Re: [MOD 0.14.2] Electric vehicles
Sigh. I wish there were events for when entities get destroyed or created by mods so we don't have to check for validity all the frickin' time. I'll have a look into this. Thanks for letting me know.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: [MOD 0.14.2] Electric vehicles
An alternative would be to raise events inside the mod that's destroying/creating the entities. For example:
Destroy:
Create:
Assuming you store a bunch of infos about destroyed entity, in order to recreate it, just add the .last_user to that store and use that for <playerId>...?
Destroy:
Code: Select all
local _died = defines.events.entity_died
local data = {
entity = entity,
tick = game.tick,
name = _died
}
game.raise_event( _died, data )
entity.destroy()
Code: Select all
local _built = defines.events.entity_built
local entity = someSurface.create_entity { .... }
local data = {
created_entity = entity,
player_index = <playerId>, -- ?
tick = game.tick,
name = _built
}
game.raise_event( _built, data )
Last edited by aubergine18 on Fri Oct 21, 2016 11:49 am, edited 1 time in total.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: [MOD 0.14.2] Electric vehicles
It's no so straight forward because there are assumptions around these events, like the player having a free slot in their inventory after building an entity, so you know you can put the item back and so on. And if a mod tracks killed entities than calling these events can skew with statistics and all kinds of hilarious things. It's generally a bad idea to raise built-in events triggered by the game logic.
Re: [MOD 0.14.2] Electric vehicles
Can't lua throw on_pre_mined and on_build events when destroying or creating things?
Last edited by Optera on Fri Oct 21, 2016 12:55 pm, edited 2 times in total.
My Mods: mods.factorio.com
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: [MOD 0.14.2] Electric vehicles
Yes, but only if the mod specifically raises the events.Optera wrote:Can't lua throw on_pre_mined and on_build events when destroying or creating things?
The vanilla events aren't triggered when mods do create/destroy, as that could easily create recursive loops and is just generally messy. So if mod wants to let other mods know something happened, it has to manually game.raise_event() or remote.call()
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: [MOD 0.14.2] Electric vehicles
If game.raise_event() or remote.call() can trigger built in events for destroy/building we should start using them more so we don't have to do valid checks all time.
My Mods: mods.factorio.com
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: [MOD 0.14.2] Electric vehicles
First, not without something like this so mods know whether the event is vanilla or modded.Optera wrote:If game.raise_event() or remote.call() can trigger built in events for destroy/building we should start using them more so we don't have to do valid checks all time.
Also, even if mods did start raising the normal game events, there are still myriad of issues:
1. Not all mods will do it
2. They might do it wrong
3. There's often multiple ways for something to happen
You'd have to be 100% sure that all other mods were working perfectly *and* that your mod is handing all situations properly.
For example, if a player disconnects from an MP game, you get an event aobut that, but might not realise it affects the entities your mod provides. Or what about forces merging? There's a whole bunch of things that at first might seem unrelated, but they can all affect entities in unexpected ways. The .valid flag (and .connected for player) is the most reliable way to know if something is actually still valid.
That being said, it would still be useful if mods raised events when they did stuff (even just custom events, doesn't have to be vanilla clones)
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: [MOD 0.14.2] Electric vehicles
I like the idea. Hope it will find it's way into the api.aubergine18 wrote:First, not without something like this so mods know whether the event is vanilla or modded.Optera wrote:If game.raise_event() or remote.call() can trigger built in events for destroy/building we should start using them more so we don't have to do valid checks all time.
Also, even if mods did start raising the normal game events, there are still myriad of issues:
1. Not all mods will do it
2. They might do it wrong
3. There's often multiple ways for something to happen
You'd have to be 100% sure that all other mods were working perfectly *and* that your mod is handing all situations properly.
For example, if a player disconnects from an MP game, you get an event aobut that, but might not realise it affects the entities your mod provides. Or what about forces merging? There's a whole bunch of things that at first might seem unrelated, but they can all affect entities in unexpected ways. The .valid flag (and .connected for player) is the most reliable way to know if something is actually still valid.
That being said, it would still be useful if mods raised events when they did stuff (even just custom events, doesn't have to be vanilla clones)
There is no such a thing as 100% perfect code. Being able to sort out base and by mod name we could however make sure to handle only events from mods we know to work well enough.
My Mods: mods.factorio.com
Re: [MOD 0.14.2] Electric vehicles
Hmm this brings up a new problem though. When you re-create the vehicle using surface.create_entity() the car won't work because it is dependent on on_built_entity to associate the entity with the equipment grid and there's no way I'm aware of to find the entity containing the grid if you only know about the grid.Supercheese wrote:Hello, I'm the author of the Vehicle Wagon mod, and I & some users have noticed bugs when using both Electric Vehicles and Vehicle Wagon together.
Since my mod uses the entity.destroy() method for deleting vehicles, I believe it isn't detected by the tests for invalid entities in your Electric Vehicles Lib code. As such, the next tick after winching a powered electric vehicle onto a wagon, the on_tick function crashes since the electric vehicle no longer exists.
Furthermore, it also seems that if a completely empty electric vehicle is winched onto a wagon, the game won't crash, but when it's winched off again and one goes to try and edit the equipment grid, the script crashes again, presumably because it still believes the old, pre-winch car is still a valid entity, which it is not.
It seems an extra test for invalid entities needs to be performed in your on_tick function before entering the fuel_tick() routine (or perhaps during on_train_changed_state, because the process of winching vehicles inevitable causes train state changes since wagons are deleted and re-attached).
Steps to reproduce:
The Electric Vehicles Lib script should now crash on the fuel_tick() function.
- Start a new Sandbox game with Vehicle Wagon, Electric Vehicles, and Electric Vehicles Lib loaded.
- Accept all the cheats/freebies that pop up
- Build some rails, a Vehicle Wagon, an Electric Car/Tank, and a winch
- Craft a fusion reactor and transformer and put them in the Electric Car/Tank
- Attempt to winch the car/tank onto the wagon
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: [MOD 0.14.2] Electric vehicles
Concocted a possible solution that mods can use when creating/destroying external entities: https://github.com/aubergine10/lifecycle-events
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: [MOD 0.14.2] Electric vehicles
The errors related to Vehicle Wagons should be fixed in 0.3.5
Re: [MOD 0.14.2] Electric vehicles
The regenerative braking module seems to produce far more energy than is required to accelerate. After providing some initial energy I can "charge" the regen and transformer modules by spamming W and S while driving the train. All aboard for free energy!
Apart from that I am loving this mod - by installing 14 radioisotope thermoelectric generators from Reactors, I have nuclear trains!
Edit, more feedaback: In my opinion the sound idle1.ogg is less intrusive and more fitting for an electric locomotive. Also, why'd you remove the air brake puffs on stopping?
Apart from that I am loving this mod - by installing 14 radioisotope thermoelectric generators from Reactors, I have nuclear trains!
Edit, more feedaback: In my opinion the sound idle1.ogg is less intrusive and more fitting for an electric locomotive. Also, why'd you remove the air brake puffs on stopping?
Re: [MOD 0.14.2] Electric vehicles
Blame Factorio's weird physics. The brake works the way it does to balance against the ridiculous consumption maths and meant for automatic trains. If you're dedicated enough to drive like that you deserve the free energy.GotLag wrote:The regenerative braking module seems to produce far more energy than is required to accelerate. After providing some initial energy I can "charge" the regen and transformer modules by spamming W and S while driving the train. All aboard for free energy!
I don't want it to look "steamy". Besides air is invisibleGotLag wrote:Edit, more feedaback: In my opinion the sound idle1.ogg is less intrusive and more fitting for an electric locomotive. Also, why'd you remove the air brake puffs on stopping?
Re: [MOD 0.14.2] Electric vehicles
to make "bobs mods" modules work on your electric car/train/tank do I need to add his equipment categories to each vehicle?
Any chance you can give the tank a nice "Clean" "Green" "environmentally friendly" electric LASER BEAM OF DOOM, to replace those dirty cannon shells and polluting bullets?
Any chance you can give the tank a nice "Clean" "Green" "environmentally friendly" electric LASER BEAM OF DOOM, to replace those dirty cannon shells and polluting bullets?
Re: [MOD 0.14.2] Electric vehicles
So you want an envorenmentally friendly way of the species extermination, don't you?