So im wondering if there is a easy way to find out the exact path/file names.
Like for example inserters are data.raw.inserter, is there somewhere that labels all of these?
I have looked at the data.raw page on the wiki but this doesnt seem to state the specific names, like the inserters are under quiet a few sub headings.
Figuring out data.raw types
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Figuring out data.raw types
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Figuring out data.raw types
thanks but as I said in the post that doesnt specify the proper name, as the inserters actually come under several headers
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Figuring out data.raw types
Uhm...no they don't? Each prototype is stored in a subtable that is named exactly by its respective prototype type. There are no exceptions.
Code: Select all
data.raw[type][name]
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Figuring out data.raw types
If I search for inserter on that page its under several headers, as in items, corpse, explosion.eradicator wrote: Mon Dec 07, 2020 1:04 amUhm...no they don't? Each prototype is stored in a subtable that is named exactly by its respective prototype type. There are no exceptions.Maybe you should post a code example to better explain what you think you're seeing.Code: Select all
data.raw[type][name]
edit, I ah think I see what you mean, you click on the link at the top and it will take you to the correct area on that page.
Still having some issues though, say for example the arithmetic combinator, if I write it as I see it in that page it does not work "data.raw.arithmeticcombinator["arithmetic-combinator"]"
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Figuring out data.raw types
Well, each "building" in the game usually needs at least a recipe to craft it, and an item to place it and the actual building. And then a corpse when the building is destroyed etc.boss8989 wrote: Mon Dec 07, 2020 1:17 am If I search for inserter on that page its under several headers, as in items, corpse, explosion.
You can't just leave out the dash...boss8989 wrote: Mon Dec 07, 2020 1:17 am Still having some issues though, say for example the arithmetic combinator, if I write it as I see it in that page it does not work "data.raw.arithmeticcombinator["arithmetic-combinator"]"
Code: Select all
data.raw["arithmetic-combinator"]["arithmetic-combinator"]
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Figuring out data.raw types
ok that makes sense thanks, the reason I left out the dash's is because the inserter does "data.raw.inserter["inserter"]eradicator wrote: Mon Dec 07, 2020 1:41 amWell, each "building" in the game usually needs at least a recipe to craft it, and an item to place it and the actual building. And then a corpse when the building is destroyed etc.boss8989 wrote: Mon Dec 07, 2020 1:17 am If I search for inserter on that page its under several headers, as in items, corpse, explosion.
You can't just leave out the dash...boss8989 wrote: Mon Dec 07, 2020 1:17 am Still having some issues though, say for example the arithmetic combinator, if I write it as I see it in that page it does not work "data.raw.arithmeticcombinator["arithmetic-combinator"]"
If a class ("type") has only one actual prototype ("building") then that prototype usually has the same name as the type, but ofc other mods can add differently named ones.Code: Select all
data.raw["arithmetic-combinator"]["arithmetic-combinator"]
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Figuring out data.raw types
That's all really just syntactic sugar for
Code: Select all
data["raw"]["inserter"]["inserter"]
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.