Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 201 202 [203] 204 205 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1457630 times)

MaximumZero

  • Bay Watcher
  • Stare into the abyss.
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3030 on: February 22, 2013, 12:53:57 am »

Is it theoretically possible to write a script for DFHack that can change a Dwarf's likes or preferences? You know, to change things like "admires cats for their aloofness" or hatred of snails?
If someone makes a dummy-proof version of this, please let me know.
Logged
  
Holy crap, why did I not start watching One Punch Man earlier? This is the best thing.
probably figured an autobiography wouldn't be interesting

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3031 on: February 22, 2013, 09:43:08 am »

Proof of concept: http://www.bay12forums.com/smf/index.php?topic=112276.0

I forget how I did it. I'll try to look into it later today.
Logged

vjek

  • Bay Watcher
  • If it didn't work, change the world so it does.
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3032 on: February 22, 2013, 10:38:56 am »

Regarding preferences...

The link to pref_adjust has been in my sig and on the wiki for several months, now.  The older version for many months before that.  But not to be 'that guy'...

Spoiler: pref_adjust.lua (click to show/hide)
I used the 'rtbl' array to have a sorted list for another script that made them hate all domestic animals (in a range).  As such, it's superfluous and you could reference something like df.global.world.raws.creatures.all.[n].creature_id to do the same thing without that 'rtbl' array.

Oh and... standard disclaimer, the pref_adjust script changes ALL DWARVES IN PLAY.  If you want it to just affect a single dwarf, you'll have to modify it.

Thundercraft

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3033 on: February 22, 2013, 12:33:09 pm »

Thanks, vjek.

I thought I vaguely recalled this having been done already. But, as I said, I could not find a mention of it in this thread, in DFHack's documents, or even on GitHub. Somehow, it escaped me to look in your awesome scripts. :-[
Logged

MaximumZero

  • Bay Watcher
  • Stare into the abyss.
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3034 on: February 22, 2013, 03:03:53 pm »

How in the world are you supposed to get that to work on one dorf?
Logged
  
Holy crap, why did I not start watching One Punch Man earlier? This is the best thing.
probably figured an autobiography wouldn't be interesting

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3035 on: February 22, 2013, 03:35:30 pm »

What if the civ id of 1 matches a human civ you've pissed off though? Or do subterranean animal tribes get the first several civ numbers?
yeah animal tribes get civ numbers as well, though just for the safe side you best either don't piss off to many civs or assign it to your own.
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

IRIS_EYE_AZURE

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3036 on: February 22, 2013, 04:39:39 pm »

Can someone help explain autoSyndrome to me?

I've been playing around with it, and it appears to be very limited in functionality. When the job complete event is called, the unit reference has already been removed from the job.

The lua eventful interface adds in the unit and building references, in addition to the job itself. I'm not sure why the cpp event isn't implemented in the same way.

Edit: I'm referring to a a built copy of the latest git files at https://github.com/peterix/dfhack
Give the syndrome the "\LOCATION" or "\UNIT_ID" synclass and it should give you more or less what you want.

https://github.com/peterix/dfhack/blob/master/plugins/autoSyndrome.cpp#L357

Follow up:
I modified autoSyndrome to print the current reaction being processed to the dfhack console. I'm not sure why, but the "couldn't find unit -1" message only appears on reaction products without syndromes. So in other words, autoSyndrome works, but puts out unnecessary spam messages to the console.

perhaps a check for syndromes on the reaction products could be done before the worker check?
Logged

Intrinsic

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3037 on: February 23, 2013, 07:49:36 am »

Is there a way to display a currently selected dwarfs attributes? interested in speed only atm. ty.
Logged
Start Duelyst with a bonus 100gold, use referral code: Buttfungus
Enter during signup or ingame under Settings.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3038 on: February 23, 2013, 12:00:25 pm »

Is there a way to display a currently selected dwarfs attributes? interested in speed only atm. ty.

Go into the lua interface with "lua", highlight the dwarf you want with k, v, l or what have you, then type this:

dfhack.units.computeMovementSpeed(dfhack.gui.getSelectedUnit())

Lower is better.

Andux

  • Bay Watcher
  • [PREFSTRING:semicolons]
    • View Profile
    • Andux's DFWiki page
Re: DFHack 0.34.11 r2
« Reply #3039 on: February 23, 2013, 02:06:01 pm »

How in the world are you supposed to get that to work on one dorf?

Change the last bit to something like:
Code: [Select]
-- ---------------------------------------------------------------------------
-- main script operation starts here
-- ---------------------------------------------------------------------------
local args = {...}
if not args[1] then
local unit=dfhack.gui.getSelectedUnit()
if unit then
clear_preferences(unit)
brainwash_unit(unit)
else
print("Select a unit, or use pref_adjust all to brainwash ALL dwarves.")
end
elseif string.upper(args[1])=="ALL" then
clearpref_all_dwarves()
adjust_all_dwarves()
else
print("Unknown argument: "..args[1])
end
Logged
(Do not sign anything.) -- Fell, Planescape: Torment

MADMAN · Save Tools · WTF Tools · Generated Raws Extractor · Tweak for 0.31–34.xx

Intrinsic

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3040 on: February 23, 2013, 02:26:33 pm »

Is there a way to display a currently selected dwarfs attributes? interested in speed only atm. ty.

Go into the lua interface with "lua", highlight the dwarf you want with k, v, l or what have you, then type this:

dfhack.units.computeMovementSpeed(dfhack.gui.getSelectedUnit())

Lower is better.

Cheers that worked, i just have to remember to use v etc as i accidentally pressed q and then used the command and DF crashed :D
Logged
Start Duelyst with a bonus 100gold, use referral code: Buttfungus
Enter during signup or ingame under Settings.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r2
« Reply #3041 on: February 23, 2013, 07:54:03 pm »

Coul dfhack supress the games inbuild auto-pause?

Example:
You use mining designations to designate an area to be dug. The game pauses.
You are in the military screen, assigning uniforms. The game pauses.
You are in the manager screen. The game pauses.

Could dfhack force the game to still run while using these menus? I am just asking for a potential hard-mode RTS option. ;)
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3042 on: February 23, 2013, 07:55:05 pm »

Coul dfhack supress the games inbuild auto-pause?

Example:
You use mining designations to designate an area to be dug. The game pauses.
You are in the military screen, assigning uniforms. The game pauses.
You are in the manager screen. The game pauses.

Could dfhack force the game to still run while using these menus? I am just asking for a potential hard-mode RTS option. ;)

The menu pause? No, almost certainly not. There is a nopause plugin already included for other stuff, however.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r2
« Reply #3043 on: February 23, 2013, 07:58:04 pm »

All the "normal" autopause can be disabled in the init.txt and the anouncements.txt. I do indeed mean the menu pause.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3044 on: February 23, 2013, 08:02:08 pm »

All the "normal" autopause can be disabled in the init.txt and the anouncements.txt. I do indeed mean the menu pause.

Well, nopause disables pause entirely, even by the player, so it could be useful for a kind of hardcore RTS mode.
Pages: 1 ... 201 202 [203] 204 205 ... 373