Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Symbol Generator  (Read 1058 times)

ChupaNahBrah

  • Escaped Lunatic
    • View Profile
Symbol Generator
« on: December 10, 2022, 07:23:07 pm »

Does anyone know of a symbol generator for DF? Like the symbol you can make for your group on embark. I was thinking of writing some code to make one but wanted to make sure it didn't already exist before putting in all that work.
Logged

TinFoilTopHat

  • Bay Watcher
    • View Profile
Re: Symbol Generator
« Reply #1 on: December 12, 2022, 07:51:33 pm »

I don't think I've heard of anything. What exactly are the features you're looking for?
Logged

ChupaNahBrah

  • Escaped Lunatic
    • View Profile
Re: Symbol Generator
« Reply #2 on: December 13, 2022, 10:33:57 am »

at the very least to generate an image like the ones that can be found on artifacts/engravings. Like "the image is of a unicorn and a dwarf. The dwarf is impaled on the unicorn" but specifically for the group symbol on the embark screen.
Logged

ChupaNahBrah

  • Escaped Lunatic
    • View Profile
Re: Symbol Generator
« Reply #3 on: December 13, 2022, 03:10:02 pm »

In the meantime, I practicing my coding skills by creating my own. Anyone happen to know where to find a list of all of the items in the "objects" section of the symbol creation screen. Been googling around and can't find it anywhere (creatures, plants, and trees are easily found on the wiki). There's way too many for me to want to type them one by one unless that's the only option.
Logged

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: Symbol Generator
« Reply #4 on: December 13, 2022, 10:27:39 pm »

I spent a couple of hours writing a lua function for printing the categories to the gamelog. Requires DFHack, so this is potentially missing anything new to the Steam release.
Code: [Select]
function log_symbols()
    local r = df.global.world.raws
    local log = dfhack.gui.writeToGamelog

    log("\nCreatures:")
    for _, v in ipairs(r.creatures.all) do
        log(v.name[0].."; "..v.name[1])
    end

    log("\nPlants:")
    for _, v in ipairs(r.plants.bushes) do
        log(v.name.."; "..v.name_plural)
    end
    for _, v in ipairs(r.plants.grasses) do
        log(v.name.."; "..v.name_plural)
    end

    log("\nTrees:")
    for _, v in ipairs(r.plants.trees) do
        log(v.name.."; "..v.name_plural)
    end

    log("\nShapes:")
    for _, v in ipairs(r.descriptors.shapes) do
        if #v.adj > 0 then
            for _, a in ipairs(v.adj) do
               log(a.value.." "..v.name.."; "..a.value.." "..v.name_plural)
            end
        else -- empty adjective vector
            log(v.name.."; "..v.name_plural)
        end
    end

    log("\nObjects:")
    for _, v in ipairs(r.itemdefs.all) do
        if v._type ~= df.itemdef_foodst then
            if v._type ~= df.itemdef_toyst and
                v._type ~= df.itemdef_instrumentst and
                v._type ~= df.itemdef_siegeammost and
                v.adjective ~= "" then
                    log(v.adjective.." "..v.name.."; "..v.adjective.." "..v.name_plural)
            else -- no adjective field
                log(v.name.."; "..v.name_plural)
            end
        else -- food lacks name_plural field
            log(v.name.."; "..v.name)
            --log("prepared meal; prepared meals") -- in-game bug
        end
    end

    log("\nDone!")
end

The plurals are separated by semi-colons (since large, serrated disk uses a comma.) The three prepared food types (biscuits, stew, roast) show up as 3 duplicate entries of "prepared meal" in-game, for some reason. There are a few world-specific procedurally generated things needing to be manually removed, but thankfully these are all at the end of their respective lists.
« Last Edit: December 13, 2022, 11:24:51 pm 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)?

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: Symbol Generator
« Reply #5 on: December 13, 2022, 10:28:03 pm »

Here are the trimmed, alphabetized (for verification purposes) lists:

Spoiler: Creature: (click to show/hide)

Spoiler: Plant: (click to show/hide)

Spoiler: Tree: (click to show/hide)

Spoiler: Shape: (click to show/hide)

Spoiler: Object: (click to show/hide)
You can replace the "biscuits", "stew", and "roast" Object entries (which I left sorted in the place of "prepared meal") with "prepared meal; prepared meals" if you want to match the in-game bug. Or you can pluralize them properly.

I copied down the Action/relation list manually and separated them:
Spoiler: Action: (click to show/hide)
Spoiler: Relationship: (click to show/hide)
« Last Edit: December 14, 2022, 01:02:31 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)?

ChupaNahBrah

  • Escaped Lunatic
    • View Profile
Re: Symbol Generator
« Reply #6 on: December 15, 2022, 06:26:33 pm »

I spent a couple of hours writing a lua function for printing the categories to the gamelog. Requires DFHack, so this is potentially missing anything new to the Steam release.
Thank you so much for your work! Unfortunately I don't play vanilla anymore with the steam release so I won't be able to use this with dfhack. But I will definitely learn form this and implement it into my program. I'm coding it using Python and I'm still a noob at coding but I'm getting there, I'd estimate 80% completion. Seriously, I can't thank you enough for getting a list of objects.
Logged