Electric Vehicles Lib: Reloaded

by OwnlyMe

Library. CONTAINS NO VEHICLES. Can be used as a dependency or included in your mod

Internal
a month ago
2.0
9
Transportation
Owner:
OwnlyMe
Source:
N/A
Homepage:
N/A
License:
MIT
Created:
a month ago
Latest Version:
2.0.2 (a month ago)
Factorio version:
2.0
Downloaded by:
9 users

Even just counting since 2.0, i've invested an unreasonable amount of time in my mods. (plus over 2000 hours before)
If you can afford it, a donation on https://www.patreon.com/c/OwnlyMods would be very appreciated


HOW TO USE:
vehicles must have an "electrical" type energy_source (this is a custom fuel type. create it if it doesn't exist)
register your transformers and brakes on_init and on_configuration_changed like this:
remote.call("electric-vehicles-lib", "register-transformer", {name = "electric-vehicles-hi-voltage-transformer"})
remote.call("electric-vehicles-lib", "register-brake", {name = "electric-vehicles-regen-brake-controller", efficiency = 0.5})

In control.lua:
use_own_library = not remote.interfaces["electric-vehicles-lib"]
if use_own_library then:
events: (or call the corresponding functions from within your events if use_own_library)
script.on_init(ev_on_init_on_configuration_changed)
script.on_configuration_changed(ev_on_init_on_configuration_changed)
script.on_event(defines.events.on_built_entity, ev_on_built_entity)
script.on_event(defines.events.on_robot_built_entity, ev_on_robot_built_entity)
script.on_event(defines.events.on_player_placed_equipment, ev_on_player_placed_equipment)
script.on_event(defines.events.on_player_removed_equipment, ev_on_player_removed_equipment)
script.on_event(defines.events.on_tick, ev_on_tick)
script.on_event(defines.events.on_train_changed_state, ev_on_train_changed_state)

For more info, check how Laser tanks includes this as a module


My mods:
Combat:
- Blood & Gore
- Raven mk2
- Shield FX
- Laser Tanks
- Laser Rifle

Basing:
- Wind Turbines
- Vehicle Physics


Deprecated:
Combat:
- Turret Shields
- Railgun Revival
- Desert Eagle
- Wave Defense Unlimited
- Universal Turret
- DotA
- Glowing Laser Beams -> Updated version by Pikachar
- RPG Items -> Updated version by ZwerOxotnik
- Spell Pack -> Updated version by ZwerOxotnik
- Hovercrafts in collaboration with Arcani

Basing:
- Realistic Reactors in collaboration with IngoKnieto
- Realistic Reactors - Utilities
- Overloaded Trains
- Resource Spawning Ingame
- Transformers
- Speaker Signals Expansion
- Solar Panel Equipment
- 0.16 Graphics
- Unlushed Trees
- Bleached Trees
- Copy&Paste for 0.16
- Lua Combinator 2
- Lua Combinator 3
- Fire Department
- Robot Tree Farm
- Modder's Science Pack
- Assembling Machine Equipment
- Bottled Science
- Heat Glow
- Market
- Market - AutoBuy