Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 330 331 [332] 333 334 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1003459 times)

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4965 on: December 12, 2013, 10:56:46 am »

thanks for the replies guys.

So is it possible to add the ability to change age? And if so, how hard is it to do?

I don't know ruby or lua at all, but I don't want to ask someone if they could do it or would kindly help me to, if it will take them hours to do so...
well it's just unit.age=100 or something or another though it's less and more the profession taking affect given you can have 50 year old 'babys' or 100 year old 'children' or 1 year old 'Peasant' you could just use empregnate on a dwarf and clone up an army that way.
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

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4966 on: December 12, 2013, 10:59:43 am »

About the "not tame" issue? It is really annoying not being able to wartrain spawned animals.

EDIT: Almost forgot why I came here in the first place...

I was looking through the scripts that come with Masterwork when I discovered "announcements" and "announcements2", both examples of... less than stellar codding.
Not to belittle anyone but... Well "inefficient" would be an excellent description.
And so I present "announce.lua" a simple script that takes two arguments, a message and a color.
Example: announce "Something happened!" COLOR_LIGHTRED
If no color is provided it defaults to white, the message is required :)
Code: [Select]

local args = {...}
if not args then qerror("Needs an argument.") end

-- Your message.
local text = args[1]

-- COLOR_BLACK
-- COLOR_BLUE
-- COLOR_GREEN
-- COLOR_CYAN
-- COLOR_RED
-- COLOR_MAGENTA
-- COLOR_BROWN
-- COLOR_GREY
-- COLOR_DARKGREY
-- COLOR_LIGHTBLUE
-- COLOR_LIGHTGREEN
-- COLOR_LIGHTCYAN
-- COLOR_LIGHTRED
-- COLOR_LIGHTMAGENTA
-- COLOR_YELLOW
-- COLOR_WHITE
local color_id = args[2]
if not color_id then color_id = "COLOR_WHITE" end

local color

-- Ugly, but it works
if color_id ==     "COLOR_BLACK" then color = COLOR_BLACK
elseif color_id == "COLOR_BLUE" then color = COLOR_BLUE
elseif color_id == "COLOR_GREEN" then color = COLOR_GREEN
elseif color_id == "COLOR_CYAN" then color = COLOR_CYAN
elseif color_id == "COLOR_RED" then color = COLOR_RED
elseif color_id == "COLOR_MAGENTA" then color = COLOR_MAGENTA
elseif color_id == "COLOR_BROWN" then color = COLOR_BROWN
elseif color_id == "COLOR_GREY" then color = COLOR_GREY
elseif color_id == "COLOR_DARKGREY" then color = COLOR_DARKGREY
elseif color_id == "COLOR_LIGHTBLUE" then color = COLOR_LIGHTBLUE
elseif color_id == "COLOR_LIGHTGREEN" then color = COLOR_LIGHTGREEN
elseif color_id == "COLOR_LIGHTCYAN" then color = COLOR_LIGHTCYAN
elseif color_id == "COLOR_LIGHTRED" then color = COLOR_LIGHTRED
elseif color_id == "COLOR_LIGHTMAGENTA" then color = COLOR_LIGHTMAGENTA
elseif color_id == "COLOR_YELLOW" then color = COLOR_YELLOW
elseif color_id == "COLOR_WHITE" then color = COLOR_WHITE
else qerror("Bad color.")
end

-- only works in fort/adv mode, not in main menu/startup.
if not dfhack.isMapLoaded() then
    qerror('Map is not loaded.')
end

dfhack.gui.showAnnouncement(text, color)
« Last Edit: December 12, 2013, 11:34:29 am by milo christiansen »
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

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4967 on: December 12, 2013, 11:54:10 am »

Code: [Select]

local args = {...}
if not args then qerror("Needs an argument.") end

-- Your message.
local text = args[1]

-- COLOR_BLACK
-- COLOR_BLUE
-- COLOR_GREEN
-- COLOR_CYAN
-- COLOR_RED
-- COLOR_MAGENTA
-- COLOR_BROWN
-- COLOR_GREY
-- COLOR_DARKGREY
-- COLOR_LIGHTBLUE
-- COLOR_LIGHTGREEN
-- COLOR_LIGHTCYAN
-- COLOR_LIGHTRED
-- COLOR_LIGHTMAGENTA
-- COLOR_YELLOW
-- COLOR_WHITE
local color_id = args[2]
if not color_id then color_id = "COLOR_WHITE" end

local color

color=_G[color_id]

-- only works in fort/adv mode, not in main menu/startup.
if not dfhack.isMapLoaded() then
    qerror('Map is not loaded.')
end

dfhack.gui.showAnnouncement(text, color)

this should work too...

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4968 on: December 12, 2013, 12:11:44 pm »

Ah, cool! I suck at lua and know next to nothing about the DFHack internals, so no surprise it could be improved upon. I'll just steal that for use in my "Better Dorfs/Libs/DFHack/Announcements" Rubble addon :)

(That addon allows you to make reaction products to show an announcement by just calling "{DFHACK_ANNOUNCMENT;Rubble is AWSOME!;COLOR_BLUE}", the material is automatically generated and shared by all calls that have the same arguments.)
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

VerdantSF

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4969 on: December 12, 2013, 12:35:40 pm »

I have no bit. coal or lignite on the map but plenty of trees, However I can import fuel periodicly. I'd like to have a quotum of coal bars that prefers to make coal out of bit. coal or lignite but only when that is not in stock burn wood to fulfill the quotum.

Not sure if there is a way in Workflow, but you might be able to work around it with stockpile distance.  Most workshops tend to pull from the closest available stockpile of reagents (kitchens are a big exception depending on items in containers or not).  If your log stockpile is further away from the wood furnace (let's just arbitrarily say 10 tiles) than your bituminous coal & lignite pile (adjacent), then the wood should only be used when the closer pile is empty.

Ξlectɍonaughtƴ

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4970 on: December 12, 2013, 01:31:00 pm »

I have no bit. coal or lignite on the map but plenty of trees, However I can import fuel periodicly. I'd like to have a quotum of coal bars that prefers to make coal out of bit. coal or lignite but only when that is not in stock burn wood to fulfill the quotum.

Not sure if there is a way in Workflow, but you might be able to work around it with stockpile distance.  Most workshops tend to pull from the closest available stockpile of reagents (kitchens are a big exception depending on items in containers or not).  If your log stockpile is further away from the wood furnace (let's just arbitrarily say 10 tiles) than your bituminous coal & lignite pile (adjacent), then the wood should only be used when the closer pile is empty.

Thanks for the reply, but I'm affraid that won't work considering charcoal and coke are made at different workshops. Wood Burner and Smelter respectively. If it were the same shop I'd think your suggestion would work.

If the functionality is not in the current version of Workflow, is this the place to request that functionality?
Logged

PeridexisErrant

  • Bay Watcher
  • Dai stihˇ, Hrasht.
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4971 on: December 12, 2013, 03:45:10 pm »

Would it work to set different constraints for each job? If I remember correctly, I've done something like this before:

If coke below 100, burn wood.
If coke below 1000, use bit coal / lignite.
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

Ξlectɍonaughtƴ

  • Escaped Lunatic
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4972 on: December 12, 2013, 04:03:02 pm »

Would it work to set different constraints for each job? If I remember correctly, I've done something like this before:

If coke below 100, burn wood.
If coke below 1000, use bit coal / lignite.

Do you have an example of that configuration? It seems I can only specify output material, not Input material. Do I need to use the job-material utility for that?
Logged

VerdantSF

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4973 on: December 13, 2013, 12:53:17 pm »

Thanks for the reply, but I'm affraid that won't work considering charcoal and coke are made at different workshops. Wood Burner and Smelter respectively. If it were the same shop I'd think your suggestion would work.

Whoops, I spaced out on that!  I'm using the gui add-on for Workflow atm.  I'm trying to figure out a set of constraints for PeridexisErrant's suggestion, but not having much luck so far.

*Edit* Not sure how to do separate constraints for coke from bit/lig and charcoal from coal.  Both are listed as coal.  Hmmm... there might be a way by using the foreign vs. locally made tags.  Since the bit/lignite is brought in through trade, I wonder if the foreign tag carries through to the final product?  I don't think so, but I'm not 100% sure.
« Last Edit: December 13, 2013, 01:17:53 pm by VerdantSF »
Logged

PeridexisErrant

  • Bay Watcher
  • Dai stihˇ, Hrasht.
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4974 on: December 13, 2013, 05:45:39 pm »

Apologies - I just went and checked my old fort, and it wasn't working the way I thought for coke (which explains where my logs kept disappearing to).  The similar trick is to set high thresholds for green glass, and lower for stone (eg pots); that way if the glass furnaces are bottlenecked for some reason the fort doesn't grind to a halt and tantrum. 

You might be able to stick something together with the Stockflow plugin, I guess. 
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

greycat

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4975 on: December 14, 2013, 02:18:54 pm »

I keep getting these errors in the tty console:
Code: [Select]
/usr/local/src/LFR/hack/scripts/itemsyndrome.lua:32: attempt to index local 'material' (a nil value)
stack traceback:
/usr/local/src/LFR/hack/scripts/itemsyndrome.lua:32: in function 'getMaterial'
/usr/local/src/LFR/hack/scripts/itemsyndrome.lua:269: in function 'checkAndAddSyndrome'
/usr/local/src/LFR/hack/scripts/itemsyndrome.lua:304: in function </usr/local/src/LFR/hack/scripts/itemsyndrome.lua:303>
This is with LFR 0.21a ASCII Edition and self-compiled DFHack from git, as described earlier in this thread.  The errors don't appear to cause the game to crash or misbehave (at least not in any obvious way), and they only appear once in a while, at times that don't follow any pattern I can see.
Logged
Hell, if nobody's suffocated because of it, it hardly counts as a bug! -- StLeibowitz

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4976 on: December 14, 2013, 03:39:57 pm »

DAMMIT, how many times do I have to fix that?

...

Use this version.

Thundercraft

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4977 on: December 16, 2013, 11:50:58 pm »

Recently, the breeding from egg-laying invader mounts thread caught my attention. It talked about the obstacles involved, with the main one being:

Invader mounts can be trained/tamed once, and only once, after which they disappear off your animal list. They will revert to wild status eventually and can't be retrained, but gain all the benefits of having been part of your fort: loyalty cascade if you kill them with soldiers and immunity to traps (not to lever or otherwise triggered upright spikes though), plus they remain an enemy iirc so instead of running away and hopefully off the map, they'll attack your dorfs.

Questions:
Shouldn't it be possible to use a DFHack script to at least change the hostility of said invader mounts, if not make them a permanent part of your fort?

What about the old "Toggle hostile" script from DFusion?

I did a search in the dfusion folder from the lastest (r3) release, but I could not find a script containing the name "hostile". Also, I can't find a mention of such a script in the DFHack readme.

Was "Toggle hostile" not ported over? Is DFHack still missing a lot of DFusion scripts? For that matter, would it even work in Fort mode? (Originally for Adventure mode.) Would it work on a hostile invader mount?
« Last Edit: December 16, 2013, 11:53:38 pm by Thundercraft »
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4978 on: December 16, 2013, 11:52:06 pm »

Yes to all of that, right now.

Making enemies allies is not difficult at all. You just need to muck around with their entity links and allegiances.

Thundercraft

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4979 on: December 17, 2013, 12:04:04 am »

Yes to all of that, right now.

Interesting. Though, I had assumed Toggle Hostile would not work properly for this purpose without a lot of changes.

Making enemies allies is not difficult at all. You just need to muck around with their entity links and allegiances.

Simple, perhaps, for those familiar with the inner workings of DF and DFHack.

I take it, then, there are not any scripts already written to do this? Perhaps something similar that I could study and apply to a different use? Or maybe some documentation? I could not find a mention of "entity links" or "allegiences" in the Readme. (Though, I also understand that the Readme desperately needs updating. Over a year old?)
Logged
Pages: 1 ... 330 331 [332] 333 334 ... 373