Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: How possible is it to "patch" RAW files as of 0.50.x?  (Read 1766 times)

PetMudstone

  • Bay Watcher
  • Damned Fool
    • View Profile
How possible is it to "patch" RAW files as of 0.50.x?
« on: December 13, 2022, 01:03:47 am »

From what I've seen, it is now possible to simply select creatures and adjust tokens on 'em without having to completely replace the files that hold 'em.

This does make me wonder though, how far does this "patching" system go at the moment? Am I able to select individual castes? Can I also select stuff like weapons and entities to remove and append tokens? For instance, if I wanted to adjust the minimum size requirement for great axes and also give them to dwarven civilizations.

I ask because the possibility of having patch operation stuff like this is very exciting to me and because there isn't too much documentation on the added systems for it at present.
Logged

Eric Blank

  • Bay Watcher
  • *Remain calm*
    • View Profile
Re: How possible is it to "patch" RAW files as of 0.50.x?
« Reply #1 on: December 13, 2022, 01:32:40 am »

you can select particular castes definitely.

[SELECT_CREATURE:DWARF]
   [SELECT_CASTE:x]
these are all the select/cut tokens putnam listed:

SELECT/CUT_CREATURE
SELECT/CUT_ENTITY
SELECT/CUT_INTERACTION
SELECT/CUT_ITEM
SELECT/CUT_WORD
SELECT/CUT_TRANSLATION
SELECT/CUT_SYMBOL
SELECT/CUT_INORGANIC
SELECT/CUT_PLANT
SELECT/CUT_MUSIC
SELECT/CUT_REACTION
SELECT/CUT_SOUND

I dont think you can remove individual tokens/variables stuff though. You can cut the object and then recreate it without the token you wanted to remove at least.
Logged
I make Spellcrafts!
I have no idea where anything is. I have no idea what anything does. This is not merely a madhouse designed by a madman, but a madhouse designed by many madmen, each with an intense hatred for the previous madman's unique flavour of madness.

PetMudstone

  • Bay Watcher
  • Damned Fool
    • View Profile
Re: How possible is it to "patch" RAW files as of 0.50.x?
« Reply #2 on: December 13, 2022, 01:46:22 am »

Good to know! Thanks. I'm a bit saddened that there ain't a way to remove or specifically modify individual tokens on things other than creatures right now but this is still a major step up.
« Last Edit: December 21, 2022, 12:58:07 am by PetMudstone »
Logged

voliol

  • Bay Watcher
    • View Profile
    • Website
Re: How possible is it to "patch" RAW files as of 0.50.x?
« Reply #3 on: December 13, 2022, 09:55:53 am »

You should be able to remove and modify creature tokens by adding tokens for applying a creature variation which does. This is a really versatile system - the only thing it has a hard time doing is removing/changing tokens within a certain context, like removing ATTACK_EDGED from one attack but not all others in a creature. Other types of objects don't have corresponding "variation" support though, so they are much trickier.

Ninjedit: oh you already kind of implied the above. I'll blame my reading comprehension on a slight fever :P

Roostre

  • Bay Watcher
  • DF addict since 2009
    • View Profile
Re: How possible is it to "patch" RAW files as of 0.50.x?
« Reply #4 on: December 17, 2022, 03:16:06 pm »

There doesn't seem to be a need for a special tag saying "I want to replace X token". I had success testing a stress invulnerability cheat mod that consisted simply of this:

Code: [Select]
[OBJECT:CREATURE]

[SELECT_CREATURE:DWARF]
[PERSONALITY:STRESS_VULNERABILITY:0:1:2]

When DF detects duplicate tokens in the raws of the same object, a failsafe seems to kick in; it takes the bottom-most of the duplicates, and disregards the others. In the case of tokens added by a mod, it prioritizes the duplicate in the mod.

Now, as for cutting a single token you simply want gone from the object, I'm still not sure.
Logged
Quote from: Ronnie James Dio
Beware; you've found the answer.

Haethei

  • Escaped Lunatic
    • View Profile
Re: How possible is it to "patch" RAW files as of 0.50.x?
« Reply #5 on: December 22, 2022, 06:49:04 am »

Can I also select stuff like weapons and entities to remove and append tokens? For instance, if I wanted to adjust the minimum size requirement for great axes and also give them to dwarven civilizations.

Yes, and I've already done this in my mod. Feel free to look at how I did it in the raws and use it for your own modding, if you don't want to just use mine :)

https://steamcommunity.com/sharedfiles/filedetails/?id=2903254505

The bigger issue seems to be REMOVING tokens. If you wanted to get rid of dwarf access to short swords without removing short swords from the game completely, I'm afraid I can't figure that out yet.

Logged

natemiddleman

  • Bay Watcher
    • View Profile
Re: How possible is it to "patch" RAW files as of 0.50.x?
« Reply #6 on: December 23, 2022, 08:32:41 am »

How do you use CUT_CREATURE? For example I want to remove Sheep so I try

[OBJECT:CREATURE]
[CUT_CREATURE:SHEEP]

but that doesn't work
« Last Edit: December 23, 2022, 09:48:28 am by natemiddleman »
Logged

Shazbot

  • Bay Watcher
    • View Profile
Re: How possible is it to "patch" RAW files as of 0.50.x?
« Reply #7 on: December 23, 2022, 05:02:35 pm »

Here's how I did that sort of cutting.

creature_cut.txt

Code: [Select]
creature_cut

[OBJECT:CREATURE]

[CUT_CREATURE:BIRD_BLUEJAY]
Logged