Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 354 355 [356] 357 358 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1456844 times)

Bo-Rufus CMVII

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5325 on: March 11, 2014, 11:03:18 pm »

Thanks for the tip.
Logged

Bo-Rufus CMVII

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5326 on: March 12, 2014, 05:31:47 am »

Possible bugs in  calcInventoryWeight -

From Units.cpp:
Code: [Select]
static int calcInventoryWeight(df::unit *unit)
{
    int armor_skill = Units::getEffectiveSkill(unit, job_skill::ARMOR);
    int armor_mul = 15 - std::min(15, armor_skill);

    int inv_weight = 0, inv_weight_fraction = 0;

    for (size_t i = 0; i < unit->inventory.size(); i++)
    {
        auto item = unit->inventory[i]->item;
        if (!item->flags.bits.weight_computed)
            continue;

        int wval = item->weight;
        int wfval = item->weight_fraction;
        auto mode = unit->inventory[i]->mode;

        if ((mode == df::unit_inventory_item::Worn ||
             mode == df::unit_inventory_item::WrappedAround) &&
             item->isArmor() && armor_skill > 1)
        {
            wval = wval * armor_mul / 16;
            wfval = wfval * armor_mul / 16;
        }

        inv_weight += wval;
        inv_weight_fraction += wfval;
    }

    return inv_weight*100 + inv_weight_fraction/10000;
}
I see two possible problems:

1) When I use a script to spit out inventory item weights everything is zero, because the .weight_computed flags are all false.  I have to invoke .calculateWeight for each item in order to get a non-zero weight.  Unless something is forcing all the weights to be calculated before this function is called, it looks like the function will just skip everything.

2) Even when the weights are precalculated, the weight for a container does not include its contents.  So for example a quiver shows up as 1.5 dorf-pounds, but if you look at the unit's inventory in the game its weight is 30dp due to being full of steel bolts.  Similarly for packs and flasks.  I think the code needs to iterate through the contents of any containers that the unit is wearing (and probably also hauled containers).
Logged

Bo-Rufus CMVII

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5327 on: March 13, 2014, 05:40:50 pm »

Possible bugs in  calcInventoryWeight -
False alarm.  I was seeing the observed effects because I was loading a map and running the script without unpausing the game.  If I let it run for even a second, both "problems" go away.
Logged

FallenAngel

  • Bay Watcher
  • !!x(oᴥo)x!!
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5328 on: March 14, 2014, 01:25:31 pm »

I really like this, but I do want to bring up something that was probably covered somewhere in the 300+ pages...
The mac version lacks multiple scripts, like invasion-now.
I want a goblin invasion when I want it.

fricy

  • Bay Watcher
  • [DFHACK:ZEALOT]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5329 on: March 14, 2014, 01:53:23 pm »

I really like this, but I do want to bring up something that was probably covered somewhere in the 300+ pages...
The mac version lacks multiple scripts, like invasion-now.
I want a goblin invasion when I want it.

Uhm, no.
The reason you don't find the invasion-now script in the dfhack-mac-r3 download, is because that script is newer than the r3 package. You won't find it in the windows version either, only in r4 (I think). I try to collect them in Macnewbie, but there's some much one can do, and not all of them are useful in vanilla, as some needs modding to take advantage.

And scripts are multi-platform, they will usually work on windows/mac/linux without any modifications, just drop them into hack/scripts, restart df and call them. Plugins are another story, but we are not talking about those now.

And scripts are a bit of a mass anyway, there's no central script repository, not every modder uses github, and pushes the commits, so you may have a hard time hunting down the ones you need...that obviously needs some improvement, although in the last few months some new forums have been created to help with organization, so the situation is much better than it was before.

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5330 on: March 14, 2014, 02:20:36 pm »

There is no mac version of r4 because I don't have one and can't compile for mac OS. For now you can grab the scripts you want from the github link. They *should* work for r3.
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5331 on: March 14, 2014, 07:59:49 pm »

I'm uploading a (hopefully) working OS X r4 build at the moment. Stonesense is missing (due to how often it crashes), but I think everything else is there.

Edit: Here
« Last Edit: March 14, 2014, 08:02:33 pm by lethosor »
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.

yaymeh

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5332 on: March 15, 2014, 03:23:34 am »

My df crashes if I click on the df window while searching for a unit in the unit list.

No idea how to start investigating this problem... any hints?
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5333 on: March 15, 2014, 07:08:38 am »

What platform? I remember experiencing that before - I think it's a mousequery search plugin issue, but I can't remember if/how I fixed it.
« Last Edit: March 15, 2014, 04:09:45 pm by lethosor »
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.

yaymeh

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5334 on: March 15, 2014, 02:37:52 pm »

Linux x86/64.

Couldn't find anything weird with the event sent...
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5335 on: March 15, 2014, 03:27:20 pm »

It occurs even with mousequery disabled, so I think it's a bug in the search plugin (disabling the plugin gets rid of the bug, obviously, since there's no search option).
It occurs for me on OS X, both with r3 and r4. Evidently this isn't isolated to a single platform (although I'm unsure if it occurs on Windows or not). From the code, I don't see any reason why mouse events should trigger anything, which leads me to believe it's a problem with DFHack's input handling. I haven't noticed it anywhere else, which is strange, but I'll see if there are other places where it occurs.
Edit: Some findings:
* It happens with 2D, PARTIAL, and STANDARD print modes (not sure about others)
* It occurs in multiple places besides the unit list, including announcements and the stocks screen (but _not_ in Falconne's (?) [e]nhanced view)
* It does not occur with "modal" input boxes (e.g. Lua's gui.FramedScreen, tested with Putnam's hackWish script)
* It also doesn't occur with native DF input (e.g. filtering creatures in the arena, saving a macro)
Another edit: It looks like the search plugin uses a custom input field for searching, but I'm not sure if it's causing the problem or if it's caused by the input method it uses.
« Last Edit: March 15, 2014, 03:58:29 pm by lethosor »
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.

PLANKS

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5336 on: March 16, 2014, 03:57:54 am »

Noob question here. I've just installed DFhack R4 and I can't get my overlays to show. Like these: http://imgur.com/Fvh9Vo5.

I don't know if I'm doing it wrong or if I've forgotten the command.

I was previously running R1 I think and all I want is infiniteSky plugin.

Hope this was the right place to ask. Thanks.

Doktoro Reichard

  • Bay Watcher
  • Lunatic formerly known as Escaped
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5337 on: March 16, 2014, 10:40:30 am »

infiniteSky, although not documented on the readme files, is also available on R3, which might be easier than building and installing the R4 version.
Logged
I have to write something... well here goes:
"A dwarf isn't a dwarf unless he dies the most !!FUN!! of ways", Quote unknown, possibly Armok.

Doktoro Reichard is quite pleased with making a Great Carbonite Trap

Why shouldn't you write with a broken pencil? Because it's pointless!

molkemon

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5338 on: March 16, 2014, 11:24:16 am »

Is there a possibility to get a "cleanowned" script which clears owner information, but does not dump the item? I like to have big cloth stockpiles next to my trade depot and buyout caravans with tattered cloth. However, since the items get dumped first, it makes the process a bit annoying to micromanage as the dwarves will first put it into the dump (which can take quite a while), then I have to reclaim and then they put it in the stockpile.

Having only ownership removed should result in the dwarves filling up the appropriate stockpiles with the worn cloth instead. Please? :)
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5339 on: March 16, 2014, 02:15:53 pm »

infiniteSky, although not documented on the readme files, is also available on R3, which might be easier than building and installing the R4 version.

https://github.com/DFHack/dfhack/blob/master/NEWS#L125

Also try "help infiniteSky". New in r3. I did a release for an earlier version of the plugin, but it's bundled with DFHack now. Either r3 or r4 should be fine. I haven't made any changes since then.
Logged
Pages: 1 ... 354 355 [356] 357 358 ... 373