Use the LuaTrain object, not the entity. This can be accessed by the train property on any of the entities composing the train (cargo wagons or locomotives).
http://lua-api.factorio.com/latest/LuaE ... tity.train
http://lua-api.factorio.com/latest/LuaTrain.html
Search found 50 matches
- Tue Feb 07, 2017 2:18 am
- Forum: Modding help
- Topic: Controlling trains by script using dummy?
- Replies: 5
- Views: 2223
- Sun Feb 05, 2017 1:41 am
- Forum: Texture Packs
- Topic: [Done] Graphics for a Factorissimo replacement
- Replies: 6
- Views: 5616
Re: [Request] Graphics for a Factorissimo replacement
Off-topic: Is your code on github? I'm particularly interested in how you achieved this... "Factories can have names, which appear on both the building and the item when picked up" It isn't but it will be. I can run through that part though. I've used a lot of other tricks and mechanical ...
- Sat Feb 04, 2017 8:14 pm
- Forum: Texture Packs
- Topic: [Done] Graphics for a Factorissimo replacement
- Replies: 6
- Views: 5616
[Done] Graphics for a Factorissimo replacement
EDIT: Commissioned someone to make a building instead I've created a replacement for Factorissimo with more features and much higher performance. I made this for myself and my friends but, I will, of course release it publicly soon after we've had a chance to test it on a playthrough thoroughly for ...
- Sat Feb 04, 2017 7:43 pm
- Forum: Modding discussion
- Topic: Logistics network overview
- Replies: 3
- Views: 1450
Re: Logistics network overview
Yep, unfortunately. You can create your own UI and some way to trigger it, but you can't modify or replace the UI of the base game. it is possible to determine the selected entity (mouse-over), so you could show and hide a UI based on that, but it would have to be in the middle of the screen since a...
- Fri Feb 03, 2017 7:00 pm
- Forum: Ideas and Requests For Mods
- Topic: Balancing Night Length with Day Length
- Replies: 3
- Views: 2093
Re: Balancing Night Length with Day Length
There is no way to do that, you'll have to change the time. If you choose to do this I suggest just freezing time (game.surfaces['nauvis'].freeze_daytime(true) http://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.freeze_daytime) and modifying the surface.daytime value yourself in the tick e...
- Fri Feb 03, 2017 6:54 pm
- Forum: Implemented mod requests
- Topic: Don't clear entities when calling set_tiles
- Replies: 5
- Views: 1559
Re: Don't clear entities when calling set_tiles
That is exactly what I did
Thanks anyway <3
Thanks anyway <3
- Thu Feb 02, 2017 11:13 pm
- Forum: Modding discussion
- Topic: Logistics network overview
- Replies: 3
- Views: 1450
Re: Logistics network overview
The base UI can't be modified at all. This mod might scratch what you're looking for though: https://mods.factorio.com/mods/anoutsid ... ics-system
- Thu Feb 02, 2017 11:07 pm
- Forum: Ideas and Requests For Mods
- Topic: [Request] Mod to teleport items/liquids/energy
- Replies: 5
- Views: 2565
Re: [Request] Mod to teleport items/liquids/energy
At least for me personally, my teleportation mod is another higher tier tech to play with in a very large modpack. Like Feed the Beast, it's fun to have higher tiers of things to keep climbing towards rather than the game just being "launch the rocket" or "launch more rockets faster&q...
- Thu Feb 02, 2017 5:11 am
- Forum: Modding help
- Topic: create_entity fast_replace isn't working
- Replies: 5
- Views: 1120
Re: create_entity fast_replace isn't working
For anyone's future reference: I believe this happened because I'm spawning the entities in places where the player can't ordinarily place them. create-entity doesn't care, but fast-replace=true does.
- Wed Feb 01, 2017 11:30 pm
- Forum: Implemented mod requests
- Topic: Don't clear entities when calling set_tiles
- Replies: 5
- Views: 1559
Re: Don't clear entities when calling set_tiles
They have to collide because they're placed by a script in a location where players shouldn't be able to place buildings.
- Wed Feb 01, 2017 11:10 pm
- Forum: Ideas and Requests For Mods
- Topic: [Request] Mod to teleport items/liquids/energy
- Replies: 5
- Views: 2565
Re: [Request] Mod to teleport items/liquids/energy
I have a bit of a plan to do this, but it might be awhile. I'm planning on creating a teleportation pad and a receiver pad which has a cooldown (probably around 2 minutes on activation), and uses something like 2MW * number of items (items, not stacks) with some kind of distance scalar as well. I'm ...
- Wed Feb 01, 2017 10:43 pm
- Forum: Implemented mod requests
- Topic: Don't clear entities when calling set_tiles
- Replies: 5
- Views: 1559
Don't clear entities when calling set_tiles
I have several placable-off-grid entities placed by script, and if I set tiles under them they're deleted. Right now I'm going to just move those entities away and put them back after calling set_tiles, but it'd be nice to have a flag to disable this behavior
- Wed Feb 01, 2017 10:41 pm
- Forum: Won't implement
- Topic: Destination inventory for on_picked_up_item
- Replies: 6
- Views: 1889
Re: Destination inventory for on_picked_up_item
@Sirenfal see if this code is any help - I was mainly interested in when an item was dropped rather than picked up, but it could be refactored to work the other way, ie. when something is picked up. https://forums.factorio.com/viewtopic.php?p=213673#p213673 I've been able to hack around these thing...
- Wed Feb 01, 2017 8:31 pm
- Forum: Modding help
- Topic: create_entity fast_replace isn't working
- Replies: 5
- Views: 1120
Re: create_entity fast_replace isn't working
Nope. In the meantime I'll just spawn the dual entities, clone the items and delete the old entities. For anyone else trying to do this: self.input, self.output = self.output, self.input for _, key in pairs({'input', 'output'}) do local old = self[key] self[key] = old.surface.create_entity({ name='f...
- Wed Feb 01, 2017 8:15 pm
- Forum: Modding help
- Topic: create_entity fast_replace isn't working
- Replies: 5
- Views: 1120
Re: create_entity fast_replace isn't working
I think fast_replaceable_group has to be a type "container" I thought so too at first, but I noticed long handed inserters have a non-type fast replacable group. So I tried these two prototypes with items and they can be fast replaced properly by hand with each other, but not with other c...
- Wed Feb 01, 2017 7:57 pm
- Forum: Modding help
- Topic: create_entity fast_replace isn't working
- Replies: 5
- Views: 1120
create_entity fast_replace isn't working
I have two container types: (https://paste.whitefire.in/view/uPUIWvbpgM) { type = "container", name = "fre_connection-chest_input", icon = "__base__/graphics/icons/steel-chest.png", flags = {"not-blueprintable", "not-deconstructable"}, minable = nil,...
- Sat Jan 28, 2017 5:40 pm
- Forum: Implemented mod requests
- Topic: Surface parameter for clear_chart()
- Replies: 1
- Views: 755
Surface parameter for clear_chart()
I'd like to be able to clear the chart for a specific surface instead of all surfaces.
- Sun Jan 22, 2017 1:46 pm
- Forum: Modding help
- Topic: No ghost on entity death
- Replies: 1
- Views: 723
No ghost on entity death
Is there a way to specify that I do not want an automatic ghost for a particular entity when it dies? I can do that with a hook like this, but it's not exactly clean- script.on_event(defines.events.on_entity_died, function(event) if(event.entity.name == 'my_entity') then local ent = event.entity loc...
- Sun Jan 22, 2017 12:47 am
- Forum: Ideas and Requests For Mods
- Topic: Biter Mobilization
- Replies: 1
- Views: 818
Re: Biter Mobilization
This is the most important AI mod: https://mods.factorio.com/mods/Veden/Rampant If you want more difficulty besides try PredictabowlEnemies with Rampant, as well as Bob's enemies. Anything much better than that is limited by the slow AI in this game, but this is enough to make things feel a lot bett...
- Sat Jan 21, 2017 10:22 pm
- Forum: Modding help
- Topic: Labeled items stacking
- Replies: 2
- Views: 537
Re: Labeled items stacking
Thanks