explain me energy and time

Place to post guides, observations, things related to modding that are not mods themselves.
darthun
Burner Inserter
Burner Inserter
Posts: 12
Joined: Mon May 16, 2016 10:19 pm
Contact:

explain me energy and time

Post 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.
User avatar
ArderBlackard
Long Handed Inserter
Long Handed Inserter
Posts: 74
Joined: Thu May 05, 2016 12:41 pm
Contact:

Re: explain me energy and time

Post 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.
Gib dich hin bis du Glück bist
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: explain me energy and time

Post 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").
quick links: log file | graphical issues | wiki
User avatar
ArderBlackard
Long Handed Inserter
Long Handed Inserter
Posts: 74
Joined: Thu May 05, 2016 12:41 pm
Contact:

Re: explain me energy and time

Post 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.
Gib dich hin bis du Glück bist
darthun
Burner Inserter
Burner Inserter
Posts: 12
Joined: Mon May 16, 2016 10:19 pm
Contact:

Re: explain me energy and time

Post 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.
User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: explain me energy and time

Post by prg »

If you want help with that, provide the code.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
darthun
Burner Inserter
Burner Inserter
Posts: 12
Joined: Mon May 16, 2016 10:19 pm
Contact:

Re: explain me energy and time

Post by darthun »

I'm reluctant because the mod isn't complete, but i will post it.
darthun
Burner Inserter
Burner Inserter
Posts: 12
Joined: Mon May 16, 2016 10:19 pm
Contact:

Re: explain me energy and time

Post 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 !
Post Reply

Return to “Modding discussion”