Bay 12 Games Forum

Please login or register.

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

Author Topic: DFHack 0.34.11 r3  (Read 1453037 times)

TheOnlySolitaire

  • Bay Watcher
  • [BRAG_ON_KILL]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4950 on: December 11, 2013, 06:26:33 pm »

Hi, another ''spawnunit'' question:

Can I specify age and gender?
Specifically, being able to spawn children/young is what I want - but can it be done?

How exactly would I type out said command into dfhack? (I do not understand ruby or lua, so reading the file isn't often helpful...)

PS: if the above isn't possible, can I modify age using the gm-editor?

Thanks in advance
Logged

BlackFlyme

  • Bay Watcher
  • BlackFlyme cancels Work: Interrupted by bird.
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4951 on: December 11, 2013, 06:33:49 pm »

Hi, another ''spawnunit'' question:

Can I specify age and gender?
Specifically, being able to spawn children/young is what I want - but can it be done?

How exactly would I type out said command into dfhack? (I do not understand ruby or lua, so reading the file isn't often helpful...)

PS: if the above isn't possible, can I modify age using the gm-editor?

Thanks in advance

I don't know about age, but you can select a caste by entering the caste number beside the creature ID. The very first caste is always number 0.

For example, entering 'spawnunit ROC 0' will spawn a female, while entering a 1 will spawn a male.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4952 on: December 11, 2013, 06:43:29 pm »

No age; the age should be exact moment of adulthood though.

Thundercraft

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4953 on: December 11, 2013, 07:24:27 pm »

No age; the age should be exact moment of adulthood though.

Hmm... So, in the case of spawning new dwarves, all the spawned dwarves will be exactly 12 years old and even share the same birthday (the month and day they were "spawned")?

Isn't it possible to script a random number generator with lua?
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4954 on: December 11, 2013, 08:04:12 pm »

It already is somewhat random AFAIK; they're all born at 15 years old, actually, on my version all creatures are, which is... a problem, to say the least, I just realized how stupid that is.

Yeah, it's random. They have random deathdays, at least.

TheOnlySolitaire

  • Bay Watcher
  • [BRAG_ON_KILL]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4955 on: December 12, 2013, 06:40:41 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...
Logged

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4956 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 #4957 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 #4958 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 #4959 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 #4960 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 #4961 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 #4962 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 #4963 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 #4964 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
Pages: 1 ... 329 330 [331] 332 333 ... 373