Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 67 68 [69] 70 71 ... 244

Author Topic: DFHack 50.13-r5  (Read 870718 times)

Atomic Chicken

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.09-r1
« Reply #1020 on: April 29, 2018, 08:38:51 am »

I'm having some smaller questions about scripting.

1. Is there a way to get the year of embark? You can get the current year, but I didn't find a way to check how many years the fort already exist

2. How can I get the 'name' of a creature that doesn't have a normal name?

3. How can I get the name of my fort?

Thanks in advance! :D

1) This would probably work for your purpose.
Code: [Select]
fortressAgeTicks = df.global.ui.fortress_age*10
fortressAgeDays = df.global.ui.fortress_age*10/1200
fortressAgeYears = df.global.ui.fortress_age*10/403200

2) Your question is a little unclear. I'm assuming that by 'creature name' you're referring to, for example, 'dwarf', as opposed to 'Urist Tunzedot'.
Code: [Select]
creatureName = df.creature_raw.find(unit.race).caste[unit.caste].caste_name[0]
3)
Code: [Select]
fortressName = dfhack.TranslateName(df.world_site.find(df.global.ui.site_id).name)
fortressNameInEnglish = dfhack.TranslateName(df.world_site.find(df.global.ui.site_id).name,true)
Logged
As mentioned in the previous turn, the most exciting field of battle this year will be in the Arstotzkan capitol, with plenty of close-quarter fighting and siege warfare.  Arstotzka, accordingly, spent their design phase developing a high-altitude tactical bomber. 

Kazimuth

  • Bay Watcher
  • [ARTIFICIAL_HIVEABLE]
    • View Profile
    • github
Re: DFHack 0.44.09-r1
« Reply #1021 on: April 30, 2018, 02:18:50 am »

I'm working on a mod that spawns a bunch of creatures of a custom race using DFHack, and I was hoping I could keep the creatures from fighting each other, while allowing them to fight other units. Does anyone know if there's some way to do this, either via raw editing or dfhack scripting?

Edit: using [OPPOSED_TO_LIFE] + [NOT_LIVING] works, but it's not ideal, because I'd prefer my creatures be animals instead of undead. i could probably also make an entity for the creatures i'm making, but again, i'd prefer for them to behave like animals instead.

Edit 2: actually i was wrong, [OPPOSED_TO_LIFE] + [NOT_LIVING] doesn't actually work :/
« Last Edit: April 30, 2018, 03:00:00 am by Kazimuth »
Logged
I'm not sure this was a good idea

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.09-r1
« Reply #1022 on: April 30, 2018, 08:48:55 am »

I'm working on a mod that spawns a bunch of creatures of a custom race using DFHack, and I was hoping I could keep the creatures from fighting each other, while allowing them to fight other units. Does anyone know if there's some way to do this, either via raw editing or dfhack scripting?

Edit: using [OPPOSED_TO_LIFE] + [NOT_LIVING] works, but it's not ideal, because I'd prefer my creatures be animals instead of undead. i could probably also make an entity for the creatures i'm making, but again, i'd prefer for them to behave like animals instead.

Edit 2: actually i was wrong, [OPPOSED_TO_LIFE] + [NOT_LIVING] doesn't actually work :/

Check out reading from Reply #995 or so, I seem to remember there being a discussion about this
Logged

Kazimuth

  • Bay Watcher
  • [ARTIFICIAL_HIVEABLE]
    • View Profile
    • github
Re: DFHack 0.44.09-r1
« Reply #1023 on: April 30, 2018, 01:19:13 pm »

Ah, thanks! Guess I should lurk more.
Logged
I'm not sure this was a good idea

ancistrus

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.09-r1
« Reply #1024 on: May 01, 2018, 04:37:00 pm »

Hi, can someone help me with tiletypes? I have successfully changed some tiles to undiscovered and to subterranean, but I cant seem to make a working aquifer.
I used "paint aquifer 1", then range 10:10:1, then enter. The soil shows as damp now. But when I dig into it, it doesnt produce any water.

Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.09-r1
« Reply #1025 on: May 01, 2018, 08:39:26 pm »

One thing that comes to mind is the "special" subcommand for things like that, but I'm not seeing anything particularly aquifer-related there. I would try using the "probe" command on a "working" aquifer tile, save its output, then use it on yours and try to address as many differences as you can (obviously coordinates won't match, but flags and other things probably should).
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.

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: DFHack 0.44.09-r1
« Reply #1026 on: May 02, 2018, 02:39:55 am »

IIRC, aquifers need a bunch of stuff besides just tile types to work. There needs to be a water level set somewhere, and I think the map chunks may have a flag too.

Anyway, just setting the tiletype won't be enough.
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.09-r1
« Reply #1027 on: May 02, 2018, 09:19:17 am »

Hi, can someone help me with tiletypes? I have successfully changed some tiles to undiscovered and to subterranean, but I cant seem to make a working aquifer.
I used "paint aquifer 1", then range 10:10:1, then enter. The soil shows as damp now. But when I dig into it, it doesnt produce any water.

Have you tried looking at the drain-aquifer script and doing the steps in reverse?
Logged

Atomic Chicken

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.09-r1
« Reply #1028 on: May 02, 2018, 12:28:30 pm »

Hi, can someone help me with tiletypes? I have successfully changed some tiles to undiscovered and to subterranean, but I cant seem to make a working aquifer.
I used "paint aquifer 1", then range 10:10:1, then enter. The soil shows as damp now. But when I dig into it, it doesnt produce any water.

Code: [Select]
if df.global.cursor.x < 0 then qerror('The cursor must first be placed on the screen!') end
local blockFlags = dfhack.maps.getTileBlock(pos2xyz(df.global.cursor)).flags
blockFlags.update_liquid = true
blockFlags.update_liquid_twice = true
blockFlags.update_temperature = true
blockFlags.designated = true
blockFlags.has_aquifer = true
blockFlags.check_aquifer = true

Save as a .lua file in hack\scripts.
Use by pointing the cursor at the tile you converted into an aquifer and entering the script's name into the console.
Logged
As mentioned in the previous turn, the most exciting field of battle this year will be in the Arstotzkan capitol, with plenty of close-quarter fighting and siege warfare.  Arstotzka, accordingly, spent their design phase developing a high-altitude tactical bomber. 

ancistrus

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.09-r1
« Reply #1029 on: May 02, 2018, 12:46:46 pm »

Thanks Chicken, it worked.
Logged

thefriendlyhacker

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.09-r1
« Reply #1030 on: May 03, 2018, 03:29:34 am »

I have a couple of scripting questions:

1. Does anyone know how to fix/work around the "intelligent pets can't take jobs" thing.  I tried a syndrome transforming them into something that isn't a pet, but then they get treated as some sort of weird visitor (no labors, can't join military, can be assigned to tavern/library, occupy long term resident bedrooms), and I couldn't find any flags or such in gm-editor that could be changed to make the game think they are just normal citizens.  Any ideas?

2. Do fort aligned units (including mercs and pets) *always* have the same civid as each other i.e. can I write a script assuming that something has the appropriate civid if and only if they are a friendly fort unit (excluding special cases like syndromes giving opposed_to_life, which I think I know how to exclude)?
Logged
Fallout Equestria Redux - that's right, it's back

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.44.09-r1
« Reply #1031 on: May 03, 2018, 03:43:51 am »

for 2 you just want to use dfhack.units.isCitizen(unit), which checks if the unit's group_id is the fort's group_id and checks a whole lot of flags as well.
« Last Edit: May 03, 2018, 03:46:16 am by Putnam »
Logged

PatrikLundell

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.09-r1
« Reply #1032 on: May 03, 2018, 03:45:52 am »

1. Dwarf Therapist... As far as I understand there is nothing blocking a script from assigning jobs, only the vanilla DF UI. The developers of Dwarf Manipulator didn't want to support Gremlins (the only vanilla case of this issue) when asked, but I don't think it was on technical grounds. It doesn't matter to me though, as I use DT anyway...

2. Dwarven merchants, diplomats, and own civ visitors definitely have the same civ id. However, there are visitor and resident flags, and I think there are merchant and diplomat ones as well. Those flags can help you weed out the ones that shouldn't be included. Once members of the fortress animals and naturalized citizens should all have your civ id, though, so that should be a mandatory but not sufficient criterion. I'm not sure if residents have taken on your civ id, but think they have (but you should definitely check yourself).

And Putnam provided a much better alternative for 2 while I wrote this...
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.44.09-r1
« Reply #1033 on: May 03, 2018, 09:34:13 am »

hey, I tried running a custom plugin, but apparently I have the wrong dfhack version.

Warning: Plugin twbt compiled for DFHack 0.44.09-r1-2-g0ea35a6e, running DFHack 0.44.09-r1-0-gb6311ec6

Where can I find this elusive r1-2-g0ea35a6e version? I tried downloading the newest version from github, but it's still r1-0.
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 :::

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.44.09-r1
« Reply #1034 on: May 03, 2018, 09:40:52 am »

Short version: the plugin was built against a dev build of DFHack (not a release). It's probably fine. Your options: ignore the warning, complain to Mifki, rebuild TWBT, and/or rebuild DFHack.

"0.44.09-r1-2-g0ea35a6e" means "2 commits after 0.44.09-r1", where "0ea35a6e" is (part of) the commit hash - see https://github.com/dfhack/dfhack/commits/develop. And it's just a warning - your plugin works fine. The way to get rid of the warning is to get a version of the plugin built against the right DFHack commit, which probably doesn't exist, but it doesn't particularly matter in this case. The warning is there to provide a diagnostic in case there is a compatibility issue between a DFHack release and later commits, but that doesn't happen very often.

In theory, you could also build DFHack commit 0ea35a6e yourself, but that's probably more effort than rebuilding TWBT.

For reference, the error you'd see if the plugin was built for the wrong version entirely is:
Code: [Select]
Plugin twbt was not built for this version of DFHack.
Plugin: (something), DFHack: 0.44.09-r1
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.
Pages: 1 ... 67 68 [69] 70 71 ... 244