Override-problem

Place to get help with not working mods / modding interface.
Post Reply
Nasabot
Fast Inserter
Fast Inserter
Posts: 102
Joined: Fri Oct 30, 2015 11:16 am
Contact:

Override-problem

Post by Nasabot »

In my mod I had some problem with override. Lets look at 2 different cases:

data.raw.recipe["xyz"].ingredients = xyz
and
data.raw.assembling-machine["xyz"].energy = xyz

The problem is, that the assembling machine override seam to not work because of the "-".(and a lot of entities have its type defined like this) Its possible to bypass this problem by substituting an assembling machine with a new entity, but this is a tedious and untidy process.

Does anybody know if there is possibility to solve this?

keyboardhack
Filter Inserter
Filter Inserter
Posts: 478
Joined: Sat Aug 23, 2014 11:43 pm
Contact:

Re: Override-problem

Post by keyboardhack »

If i understand your question correctly then you want to do this.

Code: Select all

data.raw.["assembling-machine"]["xyz"].energy = xyz
Waste of bytes : P

Nasabot
Fast Inserter
Fast Inserter
Posts: 102
Joined: Fri Oct 30, 2015 11:16 am
Contact:

Re: Override-problem

Post by Nasabot »

Yes, you understood my question, but unfortunatly this does not work.
I tried several different combinations like
data.raw.("assembling-machine")["xyz"].energy = xyz
data.raw.[assembling-machine]].["xyz"].energy = xyz
etc.
Does not work.

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: Override-problem

Post by Choumiko »

data.raw["assembling-machine"]["xyz"].energy = xyz

no dots when using [], probably a type from keyboardhack ;)

Nasabot
Fast Inserter
Fast Inserter
Posts: 102
Joined: Fri Oct 30, 2015 11:16 am
Contact:

Re: Override-problem

Post by Nasabot »

Thanks bro. No it works! Very useful!

Post Reply

Return to “Modding help”