Page 1 of 1
data.raw - I dumped it to text file
Posted: Sun Sep 18, 2016 5:25 am
by aubergine18
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
Re: data.raw - I dumped it to text file
Posted: Sun Sep 18, 2016 6:18 am
by Nexela
Might look prettier if you disable comments serpent.block(data.raw, {comment=false})
Re: data.raw - I dumped it to text file
Posted: Sun Sep 18, 2016 6:20 am
by aubergine18
Nexela wrote:Might look prettier if you disable comments serpent.block(data.raw, {comment=false})
Yup, was thinking that myself. Will get an updated version posted at same URL some time later today.
EDIT: Done
Re: data.raw - I dumped it to text file
Posted: Tue Sep 20, 2016 8:37 am
by hoho
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.
Re: data.raw - I dumped it to text file
Posted: Tue Sep 20, 2016 10:09 am
by Nexela
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
Code: Select all
log(serpent.block(data.raw, {comment=false, sparse=true}))
the output will be inside your factorio_current log
Re: data.raw - I dumped it to text file
Posted: Tue Sep 20, 2016 11:50 am
by aubergine18
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 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.
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.
Re: data.raw - I dumped it to text file
Posted: Tue Sep 20, 2016 4:54 pm
by DaveMcW
Can you round the numbers to 10 decimal places? It kind of hard to read with .99999 and .00001 everywhere.
Re: data.raw - I dumped it to text file
Posted: Tue Sep 20, 2016 7:30 pm
by aubergine18
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*
Re: data.raw - I dumped it to text file
Posted: Tue Sep 20, 2016 9:19 pm
by Nexela
serpent does have this:
numformat (string; "%.17g") -- specify format for numeric values (shortest possible round-trippable double)
Re: data.raw - I dumped it to text file
Posted: Tue Sep 20, 2016 9:51 pm
by aubergine18
Nexela wrote:serpent does have this:
numformat (string; "%.17g") -- specify format for numeric values (shortest possible round-trippable double)
Doh! How did I miss that?! Trying it now and will upload the results if better.
EDIT: It worked! File is much easier to read now! New version uploaded to github
Re: data.raw - I dumped it to text file
Posted: Tue Sep 20, 2016 10:45 pm
by DaveMcW
Now it has a bunch of 1e+02 and similar.
Re: data.raw - I dumped it to text file
Posted: Tue Sep 20, 2016 11:05 pm
by aubergine18
DaveMcW wrote:Now it has a bunch of 1e+02 and similar.
Fixed
Re: data.raw - I dumped it to text file
Posted: Tue Sep 20, 2016 11:07 pm
by DaveMcW
Search for "e+", not everything is fixed.
Re: data.raw - I dumped it to text file
Posted: Tue Sep 20, 2016 11:21 pm
by aubergine18
DaveMcW wrote:Search for "e+", not everything is fixed.
Gah! Ok, new version uploaded which as far as I can tell has all numbers formatted reasonably
Re: data.raw - I dumped it to text file
Posted: Tue Sep 20, 2016 11:40 pm
by DaveMcW
Looks great, thanks!