Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 341 342 [343] 344 345 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1459073 times)

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5130 on: January 19, 2014, 03:33:11 pm »

createitem does not accept unit id afaik.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #5131 on: January 19, 2014, 03:38:59 pm »

Ah, yeah. Its a ruby script, not a lua. I should have checked that, before driving myself crazy. -.- I just wanted caste-specific reactions... only a special caste can create items/use the workshop. It would have worked. ^^
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 :::

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5132 on: January 19, 2014, 04:46:26 pm »

It wouldn't be hard to make a lua script that would do what you want. I already have one for weapons, this will create a weapon of a specified type and inorganic.

Code: [Select]
args = {...}

local unit = df.unit.find(tonumber(args[1]))
local mat = args[3]
local mat_type = dfhack.matinfo.find(mat).type
local mat_index = dfhack.matinfo.find(mat).index

local item_index = df.item_type['WEAPON']
local item_subtype = 'nil'

for i=0,dfhack.items.getSubtypeCount(item_index)-1 do
  local item_sub = dfhack.items.getSubtypeDef(item_index,i)
  if item_sub.id == args[2] then
  item_subtype = item_sub.subtype
end
end

if item_subtype == 'nil' then
  print("No weapon of that type found")
  return
end

local item=df['item_weaponst']:new() --incredible
item.id=df.global.item_next_id
df.global.world.items.all:insert('#',item)
df.global.item_next_id=df.global.item_next_id+1
item:setSubtype(item_subtype)
item:setMaterial(mat_type)
item:setMaterialIndex(mat_index)
item:categorize(true)
item.flags.removed=true
item:setSharpness(1,0)
item:setQuality(0)
dfhack.items.moveToGround(item,{x=unit.pos.x,y=unit.pos.y,z=unit.pos.z})

Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #5133 on: January 19, 2014, 04:55:15 pm »

What I am trying to do is make this one guy (you only get one of his kind) to lead his minions on raids. He commandeers them and has to do the reactions. Its tools I want to use. I could make unique weapons for this, as well, with some unique inorganics.

The arguments for you script are "WEAPON" "SUBTYPE" "MATERIAL" "LOCATION" ?
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 r3
« Reply #5134 on: January 19, 2014, 05:17:33 pm »

Ah, yeah. Its a ruby script, not a lua. I should have checked that, before driving myself crazy. -.- I just wanted caste-specific reactions... only a special caste can create items/use the workshop. It would have worked. ^^

createitems is a ruby script. createitem is a C++ plugin.

Roses

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5135 on: January 19, 2014, 05:23:13 pm »

What I am trying to do is make this one guy (you only get one of his kind) to lead his minions on raids. He commandeers them and has to do the reactions. Its tools I want to use. I could make unique weapons for this, as well, with some unique inorganics.

The arguments for you script are "WEAPON" "SUBTYPE" "MATERIAL" "LOCATION" ?

[SYN_CLASS:script][SYN_CLASS:\UNIT_ID][SYN_CLASS:ITEM_WEAPON_DAGGER_LONG][SYN_CLASS:IRON] will make an iron dagger.

Its possible to change it to tools as well, would just need to change a few lines. (actually I think the only thing you would need to change is 'WEAPON' to 'TOOL' and 'item_weaponst' to 'item_toolst'. Although I am not positive about that)
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #5136 on: January 19, 2014, 05:49:36 pm »

[SYN_CLASS:script][SYN_CLASS:\UNIT_ID][SYN_CLASS:ITEM_WEAPON_DAGGER_LONG][SYN_CLASS:IRON] will make an iron dagger.

Its possible to change it to tools as well, would just need to change a few lines. (actually I think the only thing you would need to change is 'WEAPON' to 'TOOL' and 'item_weaponst' to 'item_toolst'. Although I am not positive about that)
I will give it a try tomorrow. :) Thanks for the help. Either one is fine, as long as I can create items from units. I might even be able to use this on pets.

Prisoner pet.
Pasture prisoner on workshop.
Run: "Search prisoner"
Has a small chance of activating this interaction on the prisoner.
Has a cannot-target-if-already-affected tag, so only works once per prisoner.
When activated, drops item.

Yeah for strip searches. I think normal people would be very confused when they read this.

EDIT: WORKS :)
« Last Edit: January 20, 2014, 08:36:57 am by Meph »
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 :::

splinterz

  • Bay Watcher
    • View Profile
    • Dwarf Therapist Branch
Re: DFHack 0.34.11 r3
« Reply #5137 on: January 20, 2014, 12:10:23 pm »

i've seen comments in dfhack about calculating the size of a creature from their age, what's that about?

i thought that the size of a creature could be read from body_size_info.size_cur, or calculated by taking the caste's body size, and then applying the appearance modifiers?

Bo-Rufus CMVII

  • Bay Watcher
    • View Profile
Armories (Re: DFHack 0.34.11 r3)
« Reply #5138 on: January 20, 2014, 12:24:19 pm »

I posted this in another forum, but didn't draw the attention of anyone who knows the answer.

I think I understand the use of the weapon rack for the squad, and can get them to store several of their weapons in it, but I'm not clear on the armor stands, cabinets, and chests mentioned at https://github.com/peterix/dfhack for holding individual equipment.

Do you create a big "armory/barracks" with the weapon rack, then armor stands for each dwarf inside and assign them to the individual dwarves?  Do the cabinets and chests go in their rooms, or under the "umbrella" of their armor stand?

What's the usual setup to take advantage of all the dfhack fixups?

Also... If their schedule specifies no uniform when inactive, do they still "own" their uniform when they're off duty?
Logged

Togre

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5139 on: January 20, 2014, 04:33:33 pm »

I am a complete newb at using dfhack.  All I really want to change in the growth bug.  I have the LNP, but I don't think I'm actually using it--I never copied/renamed folders.  That's okay--I just want my dwarfs and creature to grow to full size.

Okay, I've been reading and trying stuff, let's see if I mess things up or not.

I want to install/use Putnam's fix to the growth problem.

I have created a text file called init.lua and placed it in the df/raw folder and in the folder of my saves.  The content of the text file is
Spoiler (click to show/hide)


I've done this based on reading post #3955
Spoiler (click to show/hide)

and post #4006
Spoiler (click to show/hide)


Question:  Will this fix the growth bug?  If not, how can I do that?  Thanks
« Last Edit: January 20, 2014, 05:26:09 pm by Togre »
Logged
"Hey guys, you know how I've been repeatedly injuring you over and over again for the purpose of training up a team of high skilled doctors? Yeah well we didn't actually need to do that."

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: DFHack 0.34.11 r3
« Reply #5140 on: January 20, 2014, 06:27:41 pm »

Is there a way of storing a single abstract variable in a fort that persists when the game is reloaded?  (Basically merit points for good behavior)

So far I've been trying to do it by creating an invisible custom metal bar that stores the variable as its DIMENSION value, but I was wondering if there's a simpler, more elegant way.  (The number must be capable of being very large).

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5141 on: January 20, 2014, 06:28:39 pm »

You could use general refs

or you could use this

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: DFHack 0.34.11 r3
« Reply #5142 on: January 20, 2014, 08:42:59 pm »

Is there any way to make dead civ members not spawn ghosts in the first place? (I have skeleton civ members, makes no sense that they must be buried/spawn ghosts)
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 :::

DrKillPatient

  • Bay Watcher
  • The yak falls infinitely
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #5143 on: January 20, 2014, 08:50:44 pm »

Hello! I've got DFHack running mostly properly on OSX Mavericks, but Stonesense has some issues. Upon open it via DFHack in the terminal, DF and SS run together for just a moment — I can see my map load — and then both crash. Strangely, it only occurs when I set a different PRINT_MODE in my init.txt. Unfortunately, as I have a Retina display, I can't use PRINT_MODE:2D (I use STANDARD). What can I do here?
« Last Edit: January 20, 2014, 09:12:54 pm by DrKillPatient »
Logged
"Frankly, if you're hanging out with people who tell you to use v.begin() instead of &v[0], you need to rethink your social circle."
    Scott Meyers, Effective STL

I've written bash scripts to make using DF easier under Linux!

IndigoFenix

  • Bay Watcher
  • All things die, but nothing dies forever.
    • View Profile
    • Boundworlds: A Browser-Based Multiverse Creation and Exploration Game
Re: DFHack 0.34.11 r3
« Reply #5144 on: January 21, 2014, 02:51:44 am »

You could use general refs

or you could use this

How would I use this?  Can you give a simple example?  Just a script that saves and recalls a variable.
Pages: 1 ... 341 342 [343] 344 345 ... 373