Page 1 of 1
explain me energy and time
Posted: Sun May 22, 2016 4:19 am
by darthun
Hi,
I'm making my first mod. I'm scared my idea will be stolen. But i'm also looking for help with some concepts.
I want to make sure my mod is balanced, and need information on how to tweak power usage, energy, and the time it takes for a research or a recipe.
I'm also looking for trustworthy friends who can teach me some quick tips.
The mod is almost done, It's more like a system of machines that works together. I think it's gonna be fun.
Is there a way to add a behavior to an existing item ? Random example : When a non-modded fast-inserter is destroyed or mined, it spawns electronics circuits on the ground.
Re: explain me energy and time
Posted: Sun May 22, 2016 9:00 am
by ArderBlackard
darthun wrote:When a non-modded fast-inserter is destroyed or mined, it spawns electronics circuits on the ground.
I guess it would be a bit different from adding behaviour to an entity. Instead of this you need to subscribe to the 'on_entity_died' event. Just check what is the name of the destroyed entity - and react accordingly.
Re: explain me energy and time
Posted: Sun May 22, 2016 9:19 am
by daniel34
ArderBlackard wrote:darthun wrote:When a non-modded fast-inserter is destroyed or mined, it spawns electronics circuits on the ground.
I guess it would be a bit different from adding behaviour to an entity. Instead of this you need to subscribe to the 'on_entity_died' event. Just check what is the name of the destroyed entity - and react accordingly.
There's no need to subscribe to an event, this can be done using
Lua/EntityPrototype#loot.
An example on how to use this is on the
Data.raw page (search for "loot").
Re: explain me energy and time
Posted: Sun May 22, 2016 9:27 am
by ArderBlackard
Thanks, @daniel34, you are right, I've forgotten about this property

Just some thoughts: subscribing to the event can be useful if loot should not be a constant set, but should depend on something else.
Re: explain me energy and time
Posted: Sun May 22, 2016 3:37 pm
by darthun
I was looking for something like the event subscription. Thanks
Also, i keep getting entity-name.my-new-mod doesnt have a order string and there is no item to place.
I'm pretty convinced i put an order string with random letters about everywhere the tutorial tells me to put them. ( I have no clue how these order strings work, they make no sense to me ) It's making me crazy.
Re: explain me energy and time
Posted: Sun May 22, 2016 3:39 pm
by prg
If you want help with that, provide the code.
Re: explain me energy and time
Posted: Sun May 22, 2016 4:03 pm
by darthun
I'm reluctant because the mod isn't complete, but i will post it.
Re: explain me energy and time
Posted: Sun May 22, 2016 4:52 pm
by darthun
i was missing the
place_result
line in my item definition ! wow. I must have compared it to the base prototype a few times but only just saw it.
on to more debugging !