Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 176 177 [178] 179 180 ... 360

Author Topic: DFHack 0.43.03-r1  (Read 1079535 times)

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2655 on: May 27, 2015, 01:38:14 pm »

First, dear god illiterate dong is amusing as hell.

Second, thanks to your pointing out what I was missing I've just about got a perfected script to allow a createitem type script to make artifacts with proper records and names and decorations and all that noise but I'm tired so I'll work out the last few bits later. Perhaps then I'll be able to figure out why I was able to fake artifact mooding and creation with advfort reliably on one save but not on any others since.

Third, as was said, for vanilla you've got:

sideburn
sideburn
beard
moustache
nada
nada
hair
hair

Then under tissue length is the first part of stuff like repairing clean shaven beards or whatnot, and under bp_modifier I think is the second part. The values listed under tissue_length will let you figure out which ones you need under bp_modifier though there is only one hair length value there, and the second one apparently changes waviness/thickness/etc?

Interestingly, when you go through the lengths it takes to get bearded elves the way the styles are applied has the amusing effect of letting you wear your moustache, beard, and sideburns in ponytails.
Spoiler (click to show/hide)
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2656 on: May 27, 2015, 01:44:18 pm »

gui/gm-editor is the go-to for quick tweaks, especially when you're an illiterate dong who can't operate lua from the command line like me. K-cursor a dwarf and punch it in, it'll jump straight to the unit vector.

e: Oh and just plain deduction. One's 3 is double-braided and the other's is combed, find the 2 in one and 0 in the other.

unit object, unit vector is the thing that contains the unit objects

DragonDePlatino

  • Bay Watcher
  • [HABIT:COLLECT_WEALTH]
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2657 on: May 27, 2015, 01:51:41 pm »

Second, thanks to your pointing out what I was missing I've just about got a perfected script to allow a createitem type script to make artifacts with proper records and names and decorations and all that noise but I'm tired so I'll work out the last few bits later.

Oh! Max™! I know this might not be the place to ask, but could I make a simple request while you are working with createitem? You can't spawn TRAPPARTS or TRACTION_BENCH properly, so maybe you could fix that as well?

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2658 on: May 27, 2015, 01:52:15 pm »

Is that true with gui/hack-wish?

DragonDePlatino

  • Bay Watcher
  • [HABIT:COLLECT_WEALTH]
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2659 on: May 27, 2015, 01:56:27 pm »

Erm...you lost me.

All I know is that if I try something like "createitem TRAPCOMP:TRAMPCOMP INORGANIC:GOLD 1" or "createitem TRACTION_BENCH:TRACTION_BENCH INORGANIC:GOLD 1" then it won't work. I have no idea what hack-wish is.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2660 on: May 27, 2015, 01:58:33 pm »

It's a searchable GUI implementation of create-item accessible using gui/hack-wish in the DFHack console.

DragonDePlatino

  • Bay Watcher
  • [HABIT:COLLECT_WEALTH]
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2661 on: May 27, 2015, 02:11:26 pm »

How did I not know about this sooner?!? This would have saved me a lot of time I wasted using createitem. DFHack needs some better command documentation. D:

Yeah, it seems I can spawn components and traction benches just fine with gui/hack-wish. It's a shame it can't spawn plant growths or spawn something while controlling a creature, though. I could get a lot of usage out of those features. :/

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2662 on: May 27, 2015, 02:13:27 pm »

spawn something while controlling a creature

???

It's a shame it can't spawn plant growths

Yeah, haven't done much research into how all that works.

DragonDePlatino

  • Bay Watcher
  • [HABIT:COLLECT_WEALTH]
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2663 on: May 27, 2015, 02:22:48 pm »

Spawning something while controlling a creature...

If I go into arena mode, spawn a creature and put my cursor over it, I can spawn an item with createitem. If I assume control of that creature, createitem will still work and it will spawn an item at my feet.

On the other hand, it seems I can't do this with gui/hack-wish. If I try spawning an item while I'm a creature it says "A unit needs to be selected to use hackwish".

Klisz

  • Bay Watcher
  • Dabbling Modder
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2664 on: May 27, 2015, 02:31:15 pm »

I'm interested in retrieving a dwarf's hairstyles and facial features using dfhack. After looking at the source code of stonesense I am under the impression these values are stored in "unit.appearance.tissue_style". At first I thought the values are in the same order as they appear in the white segment of the character description, but the values of dwarves that have the same styles do not match up. Could someone tell me how these values are matched to what you can read on the character description screen?

Spoiler: Dwarf 1 (click to show/hide)
Spoiler: Dwarf 2 (click to show/hide)

I think it's in the order that the tissue style units are defined in the raws for the creature in question. So for dwarves, first hair, then beard, then moustache, then sideburns.

Spawning something while controlling a creature...

If I go into arena mode, spawn a creature and put my cursor over it, I can spawn an item with createitem. If I assume control of that creature, createitem will still work and it will spawn an item at my feet.

On the other hand, it seems I can't do this with gui/hack-wish. If I try spawning an item while I'm a creature it says "A unit needs to be selected to use hackwish".

When you're controlling a creature, you're not considered to have it "selected". You need to view yourself with z, then use hackwish.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2665 on: May 27, 2015, 02:53:17 pm »

That wouldn't explain why createitem works, though.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2666 on: May 27, 2015, 03:32:41 pm »

I think the createitem plugin has something in there that makes it check the df.global.world.units.active[0] for the player controlled unit doesn't it?

Yep!
Code: [Select]
    df::unit *unit = Gui::getSelectedUnit(out, true);
    if (!unit)
    {
        if (*gametype == game_type::ADVENTURE_ARENA || World::isAdventureMode())
        {
            // Use the adventurer unit
            unit = world->units.active[0];
        }

Still getting the hang of the dfhack.createItem though, I was looking at uhh expwnents modtools/create-item.lua trying to figure out a better way to fake up an artifact (which was productive!) and I still feel like it shouldn't work every time I look at the parts I used but I'll be damned if it didn't start spitting out fake-ifacts for me while I was trying to get the right syntax for checking the newly spawned item id/assigning it to the artifact record.

Code: [Select]
local utils = require 'utils'

validArgs = validArgs or utils.invert({
 'help',
 'material',
 'item',
})

local args = utils.processArgs({...}, validArgs)

if args.help then
 print(
[[artifuckery.lua
arguments:
    -help
        print this help message
    -material matstring
        specify the material of the item to be created
        examples:
            INORGANIC:IRON
            CREATURE_MAT:DWARF:BRAIN
            PLANT_MAT:MUSHROOM_HELMET_PLUMP:DRINK
    -item itemstr
        specify the itemdef of the item to be created
        examples:
            WEAPON:ITEM_WEAPON_PICK
 ]])
 return
end

args.creator = df.global.world.units.active[0]

if not args.item then
 error 'Invalid item.'
end
local itemType = dfhack.items.findType(args.item)
if itemType == -1 then
 error 'Invalid item.'
end
local itemSubtype = dfhack.items.findSubtype(args.item)

args.material = dfhack.matinfo.find(args.material)
if not args.material then
 error 'Invalid material.'
end

local item = dfhack.items.createItem(itemType, itemSubtype, args.material['type'], args.mate
rial.index, args.creator)

 local base=df.global.world.items.all[2015] --I know there's a way to pick up the item made by the function above
 df.global.world.artifacts.all:new()
 df.global.world.artifacts.all:insert('#',{new=df.artifact_record})
local facts = df.global.world.artifacts.all
 for _,k in ipairs(facts) do
  if k.id==0 then
   local fake=k
   fake.id=df.global.artifact_next_id
   --fake.name = --I bet I can get these randomly generated huh
   --fake.flags = {new=df.bitarray} --still not sure how to get these to populate but they're all false anyways...
   fake.item = {new=base}
   fake.anon_1 = -1000000
   fake.anon_2 = -1000000
   fake.anon_3 = -1000000
     fake.item.flags.artifact=true
     base.flags.artifact=true
     if fake.item == 'WEAPON' then item:setSharpness(1,0) end
     if base == 'WEAPON' then item:setSharpness(1,0) end
     fake.item:setQuality(5)
     base:setQuality(5)
     --fake.item.itemdecoration or something needs to be added but they randomize on first viewing happily
     --base.itemdecoration there's also gotta be a way to have base copy over fully to fake instead of just portions
     df.global.artifact_next_id=df.global.artifact_next_id+1
   end
end

Pardon the mess, but it struck me to try something like this when I got stumped figuring out why my region7 save file can actually use advfort + these bits to trigger and complete strange moods:
Code: [Select]
function weapon()
                df.global.world.units.active[0].flags1.has_mood=true
                df.global.world.units.active[0].mood=0
                df.global.world.units.active[0].job.current_job.job_type=57
                df.global.world.units.active[0].job.mood_skill=27
                df.global.world.units.active[0].job.current_job.job_items[0].mat_type=0 --went with a cheap solution
                df.global.world.units.active[0].job.current_job.job_items[0].mat_index=8 --my first success was a coal battle axe >.<
end
-- ---------------------------------------------------------------------------
function armor()
                df.global.world.units.active[0].flags1.has_mood=true
                df.global.world.units.active[0].mood=0
                df.global.world.units.active[0].job.current_job.job_type=57
                df.global.world.units.active[0].job.mood_skill=28
                df.global.world.units.active[0].job.current_job.job_items[0].mat_type=0
                df.global.world.units.active[0].job.current_job.job_items[0].mat_index=8
I've got worlds which are generated with the exact same seeds and such, same raws, all that jazz for region8, 9, etc but none of them get past the screen where the job timer would count down after selecting the materials/using the artifake script. Keep having to devel/pop-screen out of it. Yet I go back to the first folder I tried it on and it just cranks em out all day long.
« Last Edit: May 27, 2015, 03:36:43 pm by Max™ »
Logged

Youbo

  • Bay Watcher
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2667 on: May 27, 2015, 04:46:34 pm »

No legendary DFHacker can help me with my problem? Its been a few days and still no answers. Its on page 177 if anyone is willing to help.
Even if you don't have an a solution, a simple ''That is not fixable'' will be appreciated so I can scrap the world and move on.
Thanks in advance!
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2668 on: May 27, 2015, 05:12:31 pm »

...Oh, wow, yeah, I just noticed what you did. Uh. You could have just changed the item's subtype directly, with item:setSubtype(subtypenum). What you did there was... weird, heh.

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: DFHack 0.40.24-r3
« Reply #2669 on: May 27, 2015, 07:53:45 pm »

Most of what we do here is weird, is it not?
Logged
Pages: 1 ... 176 177 [178] 179 180 ... 360