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.
explain me energy and time
- ArderBlackard
- Long Handed Inserter
- Posts: 74
- Joined: Thu May 05, 2016 12:41 pm
- Contact:
Re: explain me energy and time
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.darthun wrote:When a non-modded fast-inserter is destroyed or mined, it spawns electronics circuits on the ground.
Gib dich hin bis du Glück bist
Re: explain me energy and time
There's no need to subscribe to an event, this can be done using Lua/EntityPrototype#loot.ArderBlackard wrote: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.darthun wrote:When a non-modded fast-inserter is destroyed or mined, it spawns electronics circuits on the ground.
An example on how to use this is on the Data.raw page (search for "loot").
- ArderBlackard
- Long Handed Inserter
- Posts: 74
- Joined: Thu May 05, 2016 12:41 pm
- Contact:
Re: explain me energy and time
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.

Just some thoughts: subscribing to the event can be useful if loot should not be a constant set, but should depend on something else.
Gib dich hin bis du Glück bist
Re: explain me energy and time
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.

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
If you want help with that, provide the code.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: explain me energy and time
I'm reluctant because the mod isn't complete, but i will post it.
Re: explain me energy and time
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 !
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 !