Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 298 299 [300] 301 302 ... 360

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

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.43.03-r1
« Reply #4485 on: July 10, 2016, 08:07:11 am »

Does anyone have the updated version of 'startdwarf.rb' for 43.03? It states "patch address not available" atm.

Code: [Select]
# patch start dwarf count
=begin

startdwarf
==========
Use at the embark screen to embark with the specified number of dwarves.  Eg.
``startdwarf 500`` would lead to a severe food shortage and FPS issues, while
``startdwarf 10`` would just allow a few more warm bodies to dig in.
The number must be 7 or greater.

=end

nr = $script_args[0].to_i

raise 'too low' if nr < 7

addr = df.get_global_address('start_dwarf_count')
raise 'patch address not available' if addr == 0
df.memory_patch(addr, [nr].pack('L'))
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.43.03-r1
« Reply #4486 on: July 10, 2016, 08:39:45 am »

It's not the script that needs updating (the script hasn't changed in a long time), it's the offset that's missing. I guess nobody remembered to find it. I think the script to find it is working again, though, so it shouldn't be too hard.
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.

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4487 on: July 11, 2016, 12:26:31 pm »

So while looking through the entity tables I came across unknown1b.diplomacy and I am wondering if anyone has done any research on these values. It appears that there is(are) value(s) that determine how two entities feel about eachother. I was hoping to be able to use this to create more indepth diplomacy, but I don't know how to check what effect changing these has on the game. Anyone have any experience?

Code: [Select]
[lua]# ~df.global.world.entities.all[22].unknown1b.diplomacy[3]
<historical_entity.T_unknown1b.T_diplomacy: 0x0d31f1c8>
group_id                 = 18
relation                 = 1
anon_1                   = 174
historic_events          = <vector<int32_t>: 0x0d31f1d4>
historic_events_collection       = <vector<int32_t>: 0x0d31f1e4>
anon_2                   = 0
Logged

wickys

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4488 on: July 11, 2016, 02:00:46 pm »

Has anyone found a way to make shells / horns / pearls / bones / skulls from certain creatures with the createitem command? Embarked on a barren embark without any creatures or fish and I wanna make bone/shell stuff.

Or even spawn animals itself.

I can't seem to use the spawnunit command because I don't know what caste is and anything I type in is invalid.
« Last Edit: July 11, 2016, 02:20:37 pm by wickys »
Logged

Alluvian_Est-Endrati

  • Bay Watcher
  • [ENGRAVERY:MISGUIDED]
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4489 on: July 11, 2016, 02:35:44 pm »

Has anyone found a way to make shells / horns / pearls / bones / skulls from certain creatures with the createitem command? Embarked on a barren embark without any creatures or fish and I wanna make bone/shell stuff.

Or even spawn animals itself.

I can't seem to use the spawnunit command because I don't know what caste is and anything I type in is invalid.

createitem should be able to produce creature-specific items. Have you checked the wiki for the command syntax: http://dwarffortresswiki.org/index.php/Utility:DFHack/createitem#Animal_products

For spawnunit (assuming the script is working properly) the caste is usually the gender. For example, the two castes for a pond turtle are MALE and FEMALE.
Logged
"I’m going to keep bloody gambling! Bloody, bloody gambling and drinking! Where’s my bloody drink? Anyone want to gamble for it?”

Send in the Clowns: &.&

wickys

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4490 on: July 11, 2016, 04:09:13 pm »

Yeah I did but the command is unclear to me.

item CREATURE_MAT:creature:material

It says.

What do I fill in item?

I know creature is CREATURE:COW for instance and material is BONE. But what is item?

I tried CORPSEPIECE but it said 'cannot create that type of item'.

I got to spawning animals now luckily but I'd rather get bones instead of animals who I then have to kill and butcher
Logged

Alluvian_Est-Endrati

  • Bay Watcher
  • [ENGRAVERY:MISGUIDED]
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4491 on: July 11, 2016, 06:24:12 pm »

My mistake, individual creature body parts cannot be created with createitem; such as if you wanted some quick bones for a strange mood. I thought you were aiming for items made out of specific creature materials. At the moment the best scenario would be to use spawnunit I believe.
Logged
"I’m going to keep bloody gambling! Bloody, bloody gambling and drinking! Where’s my bloody drink? Anyone want to gamble for it?”

Send in the Clowns: &.&

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4492 on: July 12, 2016, 12:02:51 am »

So I found the code responsible for parsing keybindings:
Code: (dfhack/library/Core.cpp) [Select]
if (keyspec.size() == 1 && keyspec[0] >= 'A' && keyspec[0] <= 'Z') {
        *psym = SDL::K_a + (keyspec[0]-'A');
        return true;
    } else if (keyspec.size() == 1 && keyspec[0] >= '0' && keyspec[0] <= '9') {
        *psym = SDL::K_0 + (keyspec[0]-'0');
        return true;
    } else if (keyspec.size() == 2 && keyspec[0] == 'F' && keyspec[1] >= '1' && keyspec[1] <= '9') {
        *psym = SDL::K_F1 + (keyspec[1]-'1');
        return true;
    } else if (keyspec.size() == 3 && keyspec.substr(0, 2) == "F1" && keyspec[2] >= '0' && keyspec[2] <= '2') {
        *psym = SDL::K_F10 + (keyspec[2]-'0');
        return true;
    } else if (keyspec == "Enter") {
        *psym = SDL::K_RETURN;
        return true;
    } else
return false;
Looks like it only takes alphanumerics, function keys, and enter. How hard would it be to extend this to, let's say, all these SDL-supported keys?

Are there a lot of assumptions in the other code, or should any SDL key be handled just fine?
« Last Edit: July 12, 2016, 12:04:39 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)?

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4493 on: July 14, 2016, 04:41:27 pm »

I'm looking for a way to specify not just an x,y,z in a given fort, but an x,y,z in the given world (basically I want to be able to check if a spot is the correct spot across the whole world, not just an embark site). I know there is df.global.world.map.region_x(y,z), but is that what I want to reference?
Logged

mifki

  • Bay Watcher
  • works secretly...
    • View Profile
    • mifki
Re: DFHack 0.43.03-r1
« Reply #4494 on: July 14, 2016, 07:14:36 pm »

I'm looking for a way to specify not just an x,y,z in a given fort, but an x,y,z in the given world (basically I want to be able to check if a spot is the correct spot across the whole world, not just an embark site). I know there is df.global.world.map.region_x(y,z), but is that what I want to reference?

What do you mean "correct spot"?

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4495 on: July 14, 2016, 09:31:29 pm »

So I found the code responsible for parsing keybindings:
Code: (dfhack/library/Core.cpp) [Select]
if (keyspec.size() == 1 && keyspec[0] >= 'A' && keyspec[0] <= 'Z') {
        *psym = SDL::K_a + (keyspec[0]-'A');
        return true;
    } else if (keyspec.size() == 1 && keyspec[0] >= '0' && keyspec[0] <= '9') {
        *psym = SDL::K_0 + (keyspec[0]-'0');
        return true;
    } else if (keyspec.size() == 2 && keyspec[0] == 'F' && keyspec[1] >= '1' && keyspec[1] <= '9') {
        *psym = SDL::K_F1 + (keyspec[1]-'1');
        return true;
    } else if (keyspec.size() == 3 && keyspec.substr(0, 2) == "F1" && keyspec[2] >= '0' && keyspec[2] <= '2') {
        *psym = SDL::K_F10 + (keyspec[2]-'0');
        return true;
    } else if (keyspec == "Enter") {
        *psym = SDL::K_RETURN;
        return true;
    } else
return false;
Looks like it only takes alphanumerics, function keys, and enter. How hard would it be to extend this to, let's say, all these SDL-supported keys?

Are there a lot of assumptions in the other code, or should any SDL key be handled just fine?
Coming up with names and translating them all would be tedious. There's probably some way we could make it easier, though, but relying on stuff like SysRq, Help, and Pause to be available probably isn't a good idea.
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.

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4496 on: July 14, 2016, 09:44:28 pm »

I'm looking for a way to specify not just an x,y,z in a given fort, but an x,y,z in the given world (basically I want to be able to check if a spot is the correct spot across the whole world, not just an embark site). I know there is df.global.world.map.region_x(y,z), but is that what I want to reference?

What do you mean "correct spot"?

Like imagine you have a spot in an embark at x,y,z. You then retire the fort and start an adventurer. How can you find that exact spot?
Logged

John D

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4497 on: July 14, 2016, 10:57:24 pm »

It's not the script that needs updating (the script hasn't changed in a long time), it's the offset that's missing. I guess nobody remembered to find it. I think the script to find it is working again, though, so it shouldn't be too hard.

Has anybody who knows what script to use to find the offset looked that up yet?
Logged

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4498 on: July 14, 2016, 11:20:44 pm »

Coming up with names and translating them all would be tedious. There's probably some way we could make it easier, though, but relying on stuff like SysRq, Help, and Pause to be available probably isn't a good idea.
I was thinking of making a pair of arrays and using the names as shown on the page. The init would remain the same, except that "Enter" refers to numpad enter, not return. It's not a very long list with what's already handled.

Well, then only the ones on the page that intersect with DF.

Already handled keys omitted. We can remove entries as we confirm DF doesn't support them. (I probably spent way longer making this table that it would've taken to code..)
« Last Edit: July 15, 2016, 12:08:20 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)?

Thundercraft

  • Bay Watcher
    • View Profile
Re: DFHack 0.43.03-r1
« Reply #4499 on: July 15, 2016, 12:44:11 am »

What do you mean "correct spot"?

Like imagine you have a spot in an embark at x,y,z. You then retire the fort and start an adventurer. How can you find that exact spot?

If all you need is to find out the exact x,y,z of your embark site (or any other location, really), then why not use the Whereami script from Dirst's Accessibility Utility?

Quote:
whereami.lua
This script reports your current location as X, Y, Z coordinates and a very terse description of the tile such as "SOIL WALL" or "POOL FLOOR".
whereami will also report if the current location is recorded as a bookmark.
Logged
Pages: 1 ... 298 299 [300] 301 302 ... 360