Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Looking for a program for updating raw files.  (Read 885 times)

Greiger

  • Bay Watcher
  • Reptilian Illuminati member. Keep it secret.
    • View Profile
Looking for a program for updating raw files.
« on: July 10, 2014, 11:31:34 pm »

So with bugfixing versions coming out again, modders have to convert raws with every release.  When your mods are in your own file that's all well and good, but what about when something with your mod requires you to apply an edit to a vanilla object?  Or even worse an entire group of vanilla objects?  Sometimes you can just overwrite the vanilla file.  But sometimes there are new tags added and you can't do that.

So it sounds like a program that could look at the raw files, look for particular tags and apply changes based on simple predetermined rules without otherwise changing the file could be quite a timesaver for modders every bugfix release.

I vaguely recall there was once a program specifically designed to do this with DF raw files, but it was outdated even two years ago, and I can't seem to find it anymore anyway.  But really I can't imagine DF would be the only place where a text editor with functionality like that would be useful, so surely that can't be the only one.

Does anybody know of any programs that can do something like this?  Perhaps a Notepad++ plugin of some kind even?
Logged
Disclaimer: Not responsible for dwarven deaths from the use or misuse of this post.
Quote
I don't need friends!! I've got knives!!!

Darkgamma

  • Bay Watcher
    • View Profile
Re: Looking for a program for updating raw files.
« Reply #1 on: July 11, 2014, 10:03:22 am »

If you're on Windows, try WinMerge. You'll still have to do it manually, but it works
Logged
if it's a blob made of steel, don't fight it. it may not heal, but it probably doesn't need to.

Greiger

  • Bay Watcher
  • Reptilian Illuminati member. Keep it secret.
    • View Profile
Re: Looking for a program for updating raw files.
« Reply #2 on: July 11, 2014, 10:45:12 am »

That does indeed appear to be quite useful.  At the very least it can spot any differences between old raws and new and identify when it is perfectly safe to just overwrite.  Seems to be able to do something at least similar to what I want as well, just need to learn to use it.

Thanks much.
Logged
Disclaimer: Not responsible for dwarven deaths from the use or misuse of this post.
Quote
I don't need friends!! I've got knives!!!

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Looking for a program for updating raw files.
« Reply #3 on: July 11, 2014, 10:50:10 am »

Does anybody know of any programs that can do something like this?  Perhaps a Notepad++ plugin of some kind even?
You can do regular expression search/replace in Notepad++, which should get you 95% or more to any single tag change you wanted.  You can record macros to string together a bunch of those.

That said, a purpose-built tool for this sort of thing would be really, really helpful.

In my case, a mod I'm working on (very slowly) inserts minerals that are supposed to mimic the layer stones.  I don't mind making a different version for vanilla and a couple popular tilesets, but it is a pain to hunt down the tile character and colors for 24 different materials.
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

BigD145

  • Bay Watcher
    • View Profile
Re: Looking for a program for updating raw files.
« Reply #4 on: July 11, 2014, 12:04:40 pm »

Notepad++ can do comparisons. http://sourceforge.net/projects/npp-compare/
Logged

Greiger

  • Bay Watcher
  • Reptilian Illuminati member. Keep it secret.
    • View Profile
Re: Looking for a program for updating raw files.
« Reply #5 on: July 11, 2014, 12:12:18 pm »

I kinda figured Notepad ++ had to have that functionality, but I couldn't find it.   Good to know I can just use that as well.
Logged
Disclaimer: Not responsible for dwarven deaths from the use or misuse of this post.
Quote
I don't need friends!! I've got knives!!!

Cobbler89

  • Bay Watcher
  • Cobbler cancels celebrate Caesar: mending soles
    • View Profile
Re: Looking for a program for updating raw files.
« Reply #6 on: July 11, 2014, 10:50:19 pm »

Question: If a creature is defined in file A.txt, is it possible by any means to add or modify tags to this creature in a second file B.txt? Because if it were, that would greatly simplify this whole issue... just put all the modifications in separate files instead of the vanilla raws and poof, the worst that can happen is vanilla adds something you need to modify, not that it updates something you're already overriding (since the updated version will be equally overwritten). I know that there's some interesting stuff going on with modifying an existing set of tags when one creature takes tags from another (e.g. giant and man versions), but I don't know if any similar functionality exists for modifying the same creature.
Logged
Quote from: Mr S
You've struck embedded links. Praise the data miners!
Quote from: Strong Bad
The magma is seeping under the door.

Quote from: offspring
Quote from: Cobbler89
I have an idea. Let's play a game where you win by being as quiet as possible.
I get it, it's one of those games where losing is fun!
I spend most of your dimension's time outside of your dimension. I can't guarantee followup or followthrough on any comments, ideas, or plans.

palu

  • Bay Watcher
    • View Profile
Re: Looking for a program for updating raw files.
« Reply #7 on: July 11, 2014, 11:54:30 pm »

Creature variations, though I'm not sure if they can do tiles. Would be a real pain making all those though.
Logged
Hmph, palu showing off that reading-the-instructions superpower.
The internet encourages thoughtful, intelligent discussion and if you disagree I hate you.

Cobbler89

  • Bay Watcher
  • Cobbler cancels celebrate Caesar: mending soles
    • View Profile
Re: Looking for a program for updating raw files.
« Reply #8 on: July 12, 2014, 09:17:22 am »

I thought (though maybe this just shows how little I know about modding) that creature variations would create a whole new creature based on the first one (if the first creature is fully defined and not a template of some sort)?
Logged
Quote from: Mr S
You've struck embedded links. Praise the data miners!
Quote from: Strong Bad
The magma is seeping under the door.

Quote from: offspring
Quote from: Cobbler89
I have an idea. Let's play a game where you win by being as quiet as possible.
I get it, it's one of those games where losing is fun!
I spend most of your dimension's time outside of your dimension. I can't guarantee followup or followthrough on any comments, ideas, or plans.

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Looking for a program for updating raw files.
« Reply #9 on: July 12, 2014, 12:39:12 pm »

I thought (though maybe this just shows how little I know about modding) that creature variations would create a whole new creature based on the first one (if the first creature is fully defined and not a template of some sort)?
You have the intuition for this correct: a creature variation is a separate creature.  A good example is the Olm Man (see the raws on the wiki).  It copies all the tags from the Olm, applies a couple creature variation templates to it, and then includes miscellaneous additional tags that override what was copied from the Olm.  Importantly, the original Olm is left unchanged and could appear on the map.

So, creature variations are a good fit if you want to create a slew of new creatures in a theme (maybe a "mutant" variation), but not a good fit for changing existing creatures.
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