Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Generated Creature Renamer  (Read 1374 times)

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Generated Creature Renamer
« on: January 26, 2017, 02:14:13 am »

I've made a DFHack plugin that parses through all generated creatures in any save file, and gives them names that match their description.

This means that graphics pack makers can actually give randomly generated bests sprites that at least somewhat match them.

It turns this:

Code: [Select]
FORGOTTEN_BEAST_1
FORGOTTEN_BEAST_2
FORGOTTEN_BEAST_3
FORGOTTEN_BEAST_4
FORGOTTEN_BEAST_5
FORGOTTEN_BEAST_6
FORGOTTEN_BEAST_7
FORGOTTEN_BEAST_8
FORGOTTEN_BEAST_9
FORGOTTEN_BEAST_10
FORGOTTEN_BEAST_11
FORGOTTEN_BEAST_12
TITAN_1
DEMON_1
DEMON_2
DEMON_3
DEMON_4
DEMON_5
DEMON_6
DEMON_7
DEMON_8
DEMON_9
DEMON_10
DEMON_11
DEMON_12
DEMON_13
DEMON_14
DEMON_15
DEMON_16
DEMON_17
DEMON_18
DEMON_19
DEMON_20
NIGHT_CREATURE_1
NIGHT_CREATURE_2
NIGHT_CREATURE_3
NIGHT_CREATURE_4
NIGHT_CREATURE_5
NIGHT_CREATURE_6
NIGHT_CREATURE_7
NIGHT_CREATURE_8
NIGHT_CREATURE_9
NIGHT_CREATURE_10
NIGHT_CREATURE_11
NIGHT_CREATURE_12
NIGHT_CREATURE_13
NIGHT_CREATURE_14
NIGHT_CREATURE_15
NIGHT_CREATURE_16
NIGHT_CREATURE_17
NIGHT_CREATURE_18
NIGHT_CREATURE_19
NIGHT_CREATURE_20
NIGHT_CREATURE_21
NIGHT_CREATURE_22
NIGHT_CREATURE_23
NIGHT_CREATURE_24
NIGHT_CREATURE_25
NIGHT_CREATURE_26
NIGHT_CREATURE_27
NIGHT_CREATURE_28
NIGHT_CREATURE_29
NIGHT_CREATURE_30
HF27 DIVINE_1
HF27 DIVINE_2
HF27 DIVINE_3

Into This:
Code: [Select]
FORGOTTEN_BEAST_dimetrodon
FORGOTTEN_BEAST_quadruped
FORGOTTEN_BEAST_blob
FORGOTTEN_BEAST_honeyeater
FORGOTTEN_BEAST_crab
FORGOTTEN_BEAST_snail
FORGOTTEN_BEAST_crocodile
FORGOTTEN_BEAST_alligator
FORGOTTEN_BEAST_humanoid
FORGOTTEN_BEAST_dimetrodon1
FORGOTTEN_BEAST_nematode
FORGOTTEN_BEAST_quadruped1
TITAN_quadruped2
DEMON_assassin bug
DEMON_gecko
DEMON_tick
DEMON_iguana
DEMON_deer
DEMON_tortoise
DEMON_tortoise1
DEMON_raccoon
DEMON_tortoise2
DEMON_llama
DEMON_tortoise3
DEMON_scorpion
DEMON_snail1
DEMON_pterosaur
DEMON_quadruped3
DEMON_leech
DEMON_louse
DEMON_sauropod
DEMON_antlion larva
DEMON_humanoid1
NIGHT_CREATURE_humanoid2
NIGHT_CREATURE_humanoid3
NIGHT_CREATURE_humanoid4
NIGHT_CREATURE_humanoid5
NIGHT_CREATURE_humanoid6
NIGHT_CREATURE_humanoid7
NIGHT_CREATURE_humanoid8
NIGHT_CREATURE_humanoid9
NIGHT_CREATURE_humanoid10
NIGHT_CREATURE_humanoid11
NIGHT_CREATURE_humanoid12
NIGHT_CREATURE_humanoid13
NIGHT_CREATURE_humanoid14
NIGHT_CREATURE_humanoid15
NIGHT_CREATURE_humanoid16
NIGHT_CREATURE_humanoid17
NIGHT_CREATURE_humanoid18
NIGHT_CREATURE_humanoid19
NIGHT_CREATURE_humanoid20
NIGHT_CREATURE_humanoid21
NIGHT_CREATURE_cavy
NIGHT_CREATURE_lizard
NIGHT_CREATURE_moose
NIGHT_CREATURE_koala
NIGHT_CREATURE_tortoise4
NIGHT_CREATURE_pangolin
NIGHT_CREATURE_chinchilla
NIGHT_CREATURE_monitor
NIGHT_CREATURE_tortoise5
NIGHT_CREATURE_tortoise6
HFhumanoid22
HFhumanoid23
HFserpent

As you can see, much more friendly.

I haven't tested it in adventure mode, but fortress mode didn't have any issues with it, and an angel that I spawned into fort mode successfully took the graphics that I set to it.

The plugin will be in the next DFHack release, but if modders need a build for testing, I can provide one.

A full list of the possible name suffixes is here: https://hastebin.com/wajehazola.txt

Also, as you can see in the list above, duplicate names get numbered, so a graphics set will need to repeat entries for common types, like humanoid.
« Last Edit: January 26, 2017, 02:21:22 am by Japa »
Logged

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: Generated Creature Renamer
« Reply #1 on: February 04, 2017, 02:42:25 am »



This mod allows titans and demons to look like this.
Logged

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: Generated Creature Renamer
« Reply #2 on: February 06, 2017, 03:27:09 am »

Is that all one creature, or several?

Edit: AV thread post indicates it's probably an assortment of clowns and FBs.
« Last Edit: February 06, 2017, 03:30:15 am by Bumber »
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: Generated Creature Renamer
« Reply #3 on: February 06, 2017, 04:24:00 am »

Correct. It's a couple different giant beasts, all with sprites matching their descriptions.
« Last Edit: February 06, 2017, 04:34:53 am by Japa »
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Generated Creature Renamer
« Reply #4 on: February 07, 2017, 05:39:07 am »

...Wait, just editing generated raws keeps in a save? Does adding entirely new raws with the [GENERATED] tag keep, too?

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: Generated Creature Renamer
« Reply #5 on: February 07, 2017, 07:40:47 am »

I haven't tested adding entirely new generated raws, but changing the name of the generated one keeps.

I've also added a function to save the million and a half required creature graphics definitions into a file, to make it easier (read possible) to make a graphics set with the new names.
« Last Edit: February 07, 2017, 07:42:23 am by Japa »
Logged