Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 17 18 [19] 20 21 22

Author Topic: Proposal: a standard format for mods in a diff/patch Mod Starter Pack  (Read 41616 times)

Button

  • Bay Watcher
  • Plants Specialist
    • View Profile
Re: Proposal: a standard format for mods in a diff/patch Mod Starter Pack
« Reply #270 on: August 25, 2014, 10:54:59 am »

So I haven't read all the comments since Friday because it is so late it's early but I just remembered I had yet to upload this so here's the mod loader guys http://dffd.wimbli.com/file.php?id=9509

If you just run it off the bat it'll give errors on the plant files, the raw files need to be flattened out because it gets confused by comments being on the same line as a tag. It's just the load-in not the write-out yet but the write-out should be fairly obvious once you take a look at it.

Nice!  Unfortunately it doesn't seem to like the plant_crops, plant_garden, or plant_new_trees files - I got eleven thousand lines of complaining about them! :o  Should be easy enough to fix, I imagine, and I look forward to seeing a full merge based on this (or any other) concept.

It doesn't like them even after flattening? I thought the problem with them was - and I tested this by fixing it manually in plant_crops but it was late and I didn't feel like figuring out the flattener >> - is that they have comments on the same line as their [PLANT:whatever] tags and the parser isn't expecting that.

But if it throws all those errors even with flattening I'll have to take another look at that.



I'm planning to integrate the loader with the raw flattener, and then get it writing output, later this week. Then I'll set it up to pull in from other mods.

The first pass will probably just pull in new objects, and do a string-based diff/merge on the whole object body of each changed object. The framework is there for better tag handling but I get the feeling we want to have a working alpha asap.
« Last Edit: August 25, 2014, 11:11:38 am by Button »
Logged
I used to work on Modest Mod and Plant Fixes.

Always assume I'm not seriously back

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Proposal: a standard format for mods in a diff/patch Mod Starter Pack
« Reply #271 on: August 25, 2014, 11:56:06 am »

 :I don't know howyour flattening them but the last batch file I posted does it quite nicely using sed and leaves no comments on the same line as tokens...

http://www.bay12forums.com/smf/index.php?topic=142295.msg5595688#msg5595688

Alternatively I have some c logic I could offer to parse tokens... But I don't think that's in need.
« Last Edit: August 25, 2014, 12:10:08 pm by thistleknot »
Logged

Merkator

  • Bay Watcher
    • View Profile
Re: Proposal: a standard format for mods in a diff/patch Mod Starter Pack
« Reply #272 on: August 26, 2014, 04:28:34 am »

I already wrote basic raw parser with pyparsing.
I will post it here later.
For now I don't have access to my linux machine.

UPDATE:

Ok. Here it goes :)
Link to gist

The grammar look like that:
Code: [Select]
from pyparsing import Word, ZeroOrMore, Suppress, Optional, Regex
from pyparsing import alphas, alphanums
from pyparsing import ParseException

lbracket = Suppress('[')
rbracket = Suppress(']')
tile = Regex("\'.\'")
arg = Suppress(':') + (Word(alphanums) ^ tile)
self.token = lbracket + Word(alphas) + Optional(ZeroOrMore(arg)) + rbracket


UPDATE2:

I am moron.
Script has some problems with handling comments and names with _ inside.
Now everything is working correctly.
« Last Edit: August 26, 2014, 01:17:39 pm by Merkator »
Logged

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Proposal: a standard format for mods in a diff/patch Mod Starter Pack
« Reply #273 on: August 26, 2014, 09:02:21 am »

I see your python script... And fold.

:)

Maybe button is having an issue w parsing files where tokens and comments NEED to be on the same line. Such as the text subfolder and some items in the data subfolder?

Idk, but only the objects\*.text should be reformatted, reformatting other files by moving/deleting their comments may break the way the game reads the line.
« Last Edit: August 26, 2014, 09:04:03 am by thistleknot »
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Proposal: a standard format for mods in a diff/patch Mod Starter Pack
« Reply #274 on: August 26, 2014, 09:08:25 am »

I see your python script... And fold.

:)

Maybe button is having an issue w parsing files where tokens and comments NEED to be in the same line. Such as the text subfolder and some items in the data subfolder?
Yeah, it looks like we should skip any flattening of the files in the text folder, since they are all one-entry-per-line already and the "comments" are actually literal text.  But standard diffs should be able to handle those files once they survive the pre-processing stage.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Button

  • Bay Watcher
  • Plants Specialist
    • View Profile
Re: Proposal: a standard format for mods in a diff/patch Mod Starter Pack
« Reply #275 on: August 26, 2014, 09:37:53 am »

Maybe button is having an issue w parsing files where tokens and comments NEED to be on the same line. Such as the text subfolder and some items in the data subfolder?

No, I'm having an issue where work is preventing me from spending as much time on this as I'd like :P. That's why I didn't flatten the raws myself - had to get to sleep, had to get to work, and then yesterday work became the devourer of souls.

I'm just parsing .txt files from objects, and PeredexisErrant said he ran into problems in plants, which was something I believed would only happen if the raw files weren't flattened before running. So I asked him if he flattened them/if the plants problem happened even after flattening, but he hasn't replied about that yet.
Logged
I used to work on Modest Mod and Plant Fixes.

Always assume I'm not seriously back

Merkator

  • Bay Watcher
    • View Profile
Re: Proposal: a standard format for mods in a diff/patch Mod Starter Pack
« Reply #276 on: August 26, 2014, 11:50:22 am »

Sorry I don't inform you guys, still my code need (probably need) flattened raws.
I will post my script with everything in.

BTW the ./text/*.txt files should be treated different. Because they are completely different than standard raws.
In those files the tokens work as variables.
In rest of the raws, they create visible structure.
My approach work only on the normal raws, and remove the comments :(
Logged

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Proposal: a standard format for mods in a diff/patch Mod Starter Pack
« Reply #277 on: August 26, 2014, 12:44:17 pm »

There's also text in data subfolders that have tokens ni believe that are read line by line vs by token.

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: Proposal: a standard format for mods in a diff/patch Mod Starter Pack
« Reply #278 on: August 26, 2014, 05:45:27 pm »

No flattening, I just ran the code as it came.
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

Button

  • Bay Watcher
  • Plants Specialist
    • View Profile
Re: Proposal: a standard format for mods in a diff/patch Mod Starter Pack
« Reply #279 on: August 26, 2014, 06:02:31 pm »

No flattening, I just ran the code as it came.

OK, then the plant errors were expected. :) I did say you'd get plant errors if you ran without flattening first :P
Logged
I used to work on Modest Mod and Plant Fixes.

Always assume I'm not seriously back

Button

  • Bay Watcher
  • Plants Specialist
    • View Profile
Re: Proposal: a standard format for mods in a diff/patch Mod Starter Pack
« Reply #280 on: August 28, 2014, 09:10:25 am »

I hope I haven't killed this thread/discouraged anybody from working on it. As you may have noticed I don't have a ton of time to work on this myself so please don't think that I've claimed the project or anything.
Logged
I used to work on Modest Mod and Plant Fixes.

Always assume I'm not seriously back

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Proposal: a standard format for mods in a diff/patch Mod Starter Pack
« Reply #281 on: August 28, 2014, 06:26:35 pm »

I know everyone is talking about automation and the best script methods to merge mods together, but why not have one person do it by hand? I have done it dozens of times, and its quite easy if you take minor mods and vanilla DF as base. Since you say that you dont even want to try MDF + Genesis + LfR or something similar, it might be that the entire process of writing the code to merge mods is much more work than merging them by hand.

I mean... this thread is over 2 weeks old. In that time I could have merged 100 minor mods into a modpack, using simple on/off toggles on the [OBJECT:X] line at the top, and using specific filenames, with only the current visual-basics based LNP/Starter Pack GUI as base. And I dont have coding knowledge, I would copy+paste the AQUIFER button you have for this.

I dont mean to intrude, but I have the feeling that you are overcomplicating stuff. Although I have to add that new additions would require recompiling the launcher. Splinterz would probably find a way around that, even using the system I described, by using a dropdown menu and an external txt that modders could add their mods to, he did the same for MDF.

Suggestion: Add a new tab to your normal DF Starter Pack, with 10 very popular minor mods, and wait for peoples feedback? Thats what I would do.
« Last Edit: August 28, 2014, 06:33:55 pm by Meph »
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Proposal: a standard format for mods in a diff/patch Mod Starter Pack
« Reply #282 on: August 28, 2014, 06:35:21 pm »

Your way is ugly. I mean, that way lies madness, which is to say that way is why I was so confused with Masterwork in general.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Proposal: a standard format for mods in a diff/patch Mod Starter Pack
« Reply #283 on: August 28, 2014, 06:46:23 pm »

Yes its ugly. And primitive. But you know that only because you have modding/programming background knowledge. Users dont care.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Proposal: a standard format for mods in a diff/patch Mod Starter Pack
« Reply #284 on: August 28, 2014, 06:54:08 pm »

Users don't care either way; modders/programmers seem to prefer something more compartmentalized. A system to merge mods only needs to be made once while manually merging needs to be done many times. I'd say it's worth it.
Pages: 1 ... 17 18 [19] 20 21 22