data.raw - I dumped it to text file
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
data.raw - I dumped it to text file
I've dumped data.raw to a text file which is now on github - thought I'd share in case it's of use to anyone.
I wanted to know what the full structure of data.raw looked like, and being able to quickly search for something (using browsers' text search feature) helps save time.
Anyway, here's the link: https://raw.githubusercontent.com/auber ... r/data.raw
I wanted to know what the full structure of data.raw looked like, and being able to quickly search for something (using browsers' text search feature) helps save time.
Anyway, here's the link: https://raw.githubusercontent.com/auber ... r/data.raw
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: data.raw - I dumped it to text file
Might look prettier if you disable comments serpent.block(data.raw, {comment=false})
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: data.raw - I dumped it to text file
Yup, was thinking that myself. Will get an updated version posted at same URL some time later today.Nexela wrote:Might look prettier if you disable comments serpent.block(data.raw, {comment=false})
EDIT: Done
![Smile :)](./images/smilies/icon_e_smile.gif)
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: data.raw - I dumped it to text file
Would be nice if you'd make it into a downloadable mod. Having data.raw dump for vanilla game is useful but it would be even more useful if people could create it for their modded environment.
for example, I try to add stuff to Science Cost Tweaker and I have to look up names of items. Instead of having to do a search from both mods folder and the game data folder I could just search in a single text file if I could dump it all.
for example, I try to add stuff to Science Cost Tweaker and I have to look up names of items. Instead of having to do a search from both mods folder and the game data folder I could just search in a single text file if I could dump it all.
Re: data.raw - I dumped it to text file
You can use this. https://mods.factorio.com/mods/sparr/expose-data-raw
Or just create a data.final.fixes file in any mod that contains this
the output will be inside your factorio_current log
Or just create a data.final.fixes file in any mod that contains this
Code: Select all
log(serpent.block(data.raw, {comment=false, sparse=true}))
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: data.raw - I dumped it to text file
The problem with putting a data.raw in to a mod is that it will just be a snapshot of what data.raw looks like for me, at a specific time with specific game version and mods, and it won't contain any of the stuff from mods active in the current game for the current player/server. You'll still need to do what you're currently doing, because the data can change from game to game depending on multiple factors.hoho wrote:Would be nice if you'd make it into a downloadable mod. Having data.raw dump for vanilla game is useful but it would be even more useful if people could create it for their modded environment.
for example, I try to add stuff to Science Cost Tweaker and I have to look up names of items. Instead of having to do a search from both mods folder and the game data folder I could just search in a single text file if I could dump it all.
The reason I dumped it to file and put it on github was to just have a quickly searchable (via browser page search feature) file with all the vanilla stuff in. It saves me having to hunt through different lua files in base and core mods.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: data.raw - I dumped it to text file
Can you round the numbers to 10 decimal places? It kind of hard to read with .99999 and .00001 everywhere.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: data.raw - I dumped it to text file
Serpent accepts custom formatters so yes, probably. I'll take a look and see what I can do.
EDIT: So I tried writing a `custom` formatter for Serpent only to realise it's not called per property but instead seems to be called once for the entire dump. *sigh*
EDIT: So I tried writing a `custom` formatter for Serpent only to realise it's not called per property but instead seems to be called once for the entire dump. *sigh*
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: data.raw - I dumped it to text file
serpent does have this:
numformat (string; "%.17g") -- specify format for numeric values (shortest possible round-trippable double)
numformat (string; "%.17g") -- specify format for numeric values (shortest possible round-trippable double)
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: data.raw - I dumped it to text file
Doh! How did I miss that?! Trying it now and will upload the results if better.Nexela wrote:serpent does have this:
numformat (string; "%.17g") -- specify format for numeric values (shortest possible round-trippable double)
EDIT: It worked! File is much easier to read now! New version uploaded to github
![Smile :)](./images/smilies/icon_e_smile.gif)
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: data.raw - I dumped it to text file
Now it has a bunch of 1e+02 and similar.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: data.raw - I dumped it to text file
FixedDaveMcW wrote:Now it has a bunch of 1e+02 and similar.
![Smile :)](./images/smilies/icon_e_smile.gif)
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: data.raw - I dumped it to text file
Search for "e+", not everything is fixed. ![Wink ;)](./images/smilies/icon_e_wink.gif)
![Wink ;)](./images/smilies/icon_e_wink.gif)
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: data.raw - I dumped it to text file
Gah! Ok, new version uploaded which as far as I can tell has all numbers formatted reasonablyDaveMcW wrote:Search for "e+", not everything is fixed.
![Smile :)](./images/smilies/icon_e_smile.gif)
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: data.raw - I dumped it to text file
Looks great, thanks! ![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)