Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 88 89 [90] 91 92 ... 137

Author Topic: [MODDING] 0.43.x QUESTIONS THREAD  (Read 203930 times)

Enemy post

  • Bay Watcher
  • Modder/GM
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1335 on: August 14, 2016, 12:38:05 am »

Is there a practical difference between hearthpersons and fortress guards?
Logged
My mods and forum games.
Enemy post has claimed the title of Dragonsong the Harmonic of Melodious Exaltion!

CABL

  • Bay Watcher
  • Has a fetish for voring the rich
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1336 on: August 14, 2016, 02:16:05 am »

That is pretty messed up.

I sorta have to ask - what exactly spurred you to mod that in.

Read this thread, http://www.bay12forums.com/smf/index.php?topic=85359.0

I was kinda inspired by this thread and i started to think. Why milk only females? After all, males also have their own "milk".

P.S Seriously, read this thread, it's pure comedy gold!

Milking actually works, but i still want to know how to make alcohol from both CENSORED and milk.
« Last Edit: August 14, 2016, 03:53:13 am by CrocAndBearLover »
Logged
Pounded in the Butt by my own Government... oh wait, that's real life.

Much less active than I used to be on these forums, but I still visit them on occasion. Will probably resume my activity in full once Dwarf Fortress will be released on Steam.

Managrimm

  • Bay Watcher
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1337 on: August 14, 2016, 02:42:29 pm »

I'm trying to make an interaction that shoots fire and applies a syndrome to the target (not via the fire, just as part of the same interaction), but the syndrome never takes affect. Can anyone tell me what's going wrong?

Spoiler (click to show/hide)
Logged

Teneb

  • Bay Watcher
  • (they/them) Penguin rebellion
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1338 on: August 14, 2016, 04:13:48 pm »

Is there a practical difference between hearthpersons and fortress guards?
Unknown. They never show up in fortress mode, so we can't tell.
Logged
Monstrous Manual: D&D in DF
Quote from: Tack
What if “slammed in the ass by dead philosophers” is actually the thing which will progress our culture to the next step?

Enemy post

  • Bay Watcher
  • Modder/GM
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1339 on: August 14, 2016, 04:18:03 pm »

Is there a practical difference between hearthpersons and fortress guards?
Unknown. They never show up in fortress mode, so we can't tell.

Thanks.
Logged
My mods and forum games.
Enemy post has claimed the title of Dragonsong the Harmonic of Melodious Exaltion!

pikachu17

  • Bay Watcher
  • PADORU PADORU
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1340 on: August 16, 2016, 10:13:06 am »

That is pretty messed up.

I sorta have to ask - what exactly spurred you to mod that in.

Read this thread, http://www.bay12forums.com/smf/index.php?topic=85359.0

I was kinda inspired by this thread and i started to think. Why milk only females? After all, males also have their own "milk".

P.S Seriously, read this thread, it's pure comedy gold!

Milking actually works, but i still want to know how to make alcohol from both CENSORED and milk.
Actually male humans do have the equipment for making actual milk. they just lack the hormone that starts the reaction.
Logged
Sigtext!
dwarf 4tress from scratch
The Pikachu revolution!
Thank you NatureGirl19999 for the avatar switcher at http://signavatar.com

A warforged bard named Gender appears and says"Hello. I am a social construct."

CABL

  • Bay Watcher
  • Has a fetish for voring the rich
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1341 on: August 16, 2016, 10:42:00 am »

Okay, guys, let's stop derail this thread into "Dwarf Fortress XXX Porn Parody". Just tell me how to make reaction which requires both components (CENSORED and milk) and turns it into the alcohol. After i will get my answer, i'll promise to don't touch this thread for at least month.


EDIT: Maked my post more understandable.
« Last Edit: August 16, 2016, 11:37:28 am by CrocAndBearLover »
Logged
Pounded in the Butt by my own Government... oh wait, that's real life.

Much less active than I used to be on these forums, but I still visit them on occasion. Will probably resume my activity in full once Dwarf Fortress will be released on Steam.

scamtank

  • Bay Watcher
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1342 on: August 16, 2016, 11:53:00 am »

let me give you a hand, grossboy

Code: [Select]
[REACTION:BREW_TROG]
[NAME:A name, for a reaction]
[BUILDING:STILL:NONE]
[REAGENT:milk:150:LIQUID_MISC:NONE:CREATURE_MAT:TROGLODYTE:MILK]
[REAGENT:milk pail:1:NONE:NONE:NONE:NONE]
[CONTAINS:milk]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:unspeakable:150:LIQUID_MISC:NONE:CREATURE_MAT:TROGLODYTE:CENSORED]
[REAGENT:spooge tank:1:NONE:NONE:NONE:NONE]
[CONTAINS:unspeakable]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[REAGENT:barrel/pot:1:NONE:NONE:NONE:NONE]
[EMPTY]
[FOOD_STORAGE_CONTAINER]
[PRESERVE_REAGENT]
[DOES_NOT_DETERMINE_PRODUCT_AMOUNT]
[PRODUCT:100:5:DRINK:NONE:GET_MATERIAL_FROM_REAGENT:CENSORED:ALCOHOL_MAT]
[PRODUCT_TO_CONTAINER:barrel/pot]
[PRODUCT_DIMENSION:150]
[SKILL:BREWING]

there's a suggestion, see if it works right
Logged

Teneb

  • Bay Watcher
  • (they/them) Penguin rebellion
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1343 on: August 17, 2016, 07:20:08 pm »

Is there a way to ensure an entity always has access to specific boulders, like with metal bars? I'm thinking no, but I'd rather ask.
Logged
Monstrous Manual: D&D in DF
Quote from: Tack
What if “slammed in the ass by dead philosophers” is actually the thing which will progress our culture to the next step?

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1344 on: August 17, 2016, 07:32:07 pm »

Is there a way to ensure an entity always has access to specific boulders, like with metal bars? I'm thinking no, but I'd rather ask.
You can DFHack it into the resources list (checking first, of course, that it's not already there).  The following does something similar for specific domesticated creatures and it references known rock types.  I don't know offhand where metals are stored, but it should be relatively close to where the rocks and animals are.

Code: (tesb-add-pets.lua) [Select]
-- Adds specific castes of pets to each civ of an Entity type
-- Intended for Pet Rocks, but would work on Awakened Stones as well
-- Caste is available if the civ has access to the associated layer stone

-- Made by Dirst for the Earth Strikes Back mod
-- Based on AddPetToCiv

local utils=require 'utils'

local args = utils.processArgs({...}, validArgs)

validArgs = validArgs or utils.invert({
 'help',
 'entity',
 'race',
 'sort'
})

if args.help then
print([[tesb-add-pets.lua
Adds specific castes to each civ based on discovered minerals
Based on AddPetToCiv.lua
arguments
    -help
        print this help message
    -entity <ENTITY_ID>
        The raw id of the target entity, e.g. MOUNTAIN
    -race <CREATURE_ID>
        The raw id of a creature, e.g. TESB_PET_ROCK
-sort
Sorts the castes alphabetically (by ID) before adding
]])
return
end


function insertPet(civ_id,creature,caste)
local exists=false
civ = df.global.world.entities.all[civ_id]
-- Original AddPetToCiv targets all civs belonging to the same ENTITY raw
-- This version allows each instanced civ to have its own list
for k,v in pairs(civ.resources.animals.pet_races) do
local checkrace = df.creature_raw.find(v)
local checkcaste = checkrace.caste[civ.resources.animals.pet_castes[k]]
if checkrace.creature_id == creature and checkcaste.caste_id == caste then exists=true end
end
if exists==true then
else
--the civ doesn't have the creature as a pet
--add the creature as a pet
local racenum=-1
local castenum=-1
for k,v in pairs(df.global.world.raws.creatures.all) do
if v.creature_id==creature then
racenum=k
for kk,vv in pairs(v.caste) do
if vv.caste_id==caste then castenum=kk end
end
break
end
end
if racenum > -1 and castenum > -1 then
civ.resources.animals.pet_races:insert('#',racenum)
civ.resources.animals.pet_castes:insert('#',castenum)
--print("Inserted "..creature..":"..caste.." in civ "..dfhack.TranslateName(df.global.world.entities.all[civ_id].name))
else
-- Invalid caste.  Print a message and do NOT increment the pet count.
print(creature..":"..caste.." not found in the raws")
exists = true
end
end
return not exists
end

--Find race's common name
for k,v in ipairs(df.global.world.raws.creatures.all) do
  if v.creature_id == args.race then
    raceSingle = df.creature_raw.find(k).name[0]
racePlural = df.creature_raw.find(k).name[1]
    break
  end
end


-- List of layer stones that coincide with Pet Rock castes
stone_list = { "ANDESITE", "BASALT", "CHALK", "CHERT", "CLAYSTONE",
"CONGLOMERATE", "DACITE", "DIORITE", "DOLOMITE", "GABBRO", "GNEISS",
"GRANITE", "LIMESTONE", "MARBLE", "MUDSTONE", "PHYLLITE", "QUARTZITE",
"RHYOLITE", "ROCK_SALT", "SANDSTONE", "SCHIST", "SHALE", "SILTSTONE",
"SLATE" }

caste_list = {}

-- Lists indexed by material ID numbers
for mat = 1, #stone_list do
local index = dfhack.matinfo.find(stone_list[mat]).index
caste_list[index] = stone_list[mat]
end

-- Identify appropriate castes for each instanced civ of the correct entity type
for k,civ in pairs(df.global.world.entities.all) do
local pet_list = {}
if civ.type==0 and civ.entity_raw.code==args.entity then
for kk,mat in pairs(civ.resources.stones) do
if caste_list[mat] then
pet_list[1 + #pet_list] = caste_list[mat]
end
end
if args.sort then table.sort(pet_list) end
local pet_count = 0
-- Pets aren't valid until successfully inserted, so maintaining a count of successes
for kk,pet_caste in ipairs(pet_list) do
if insertPet(civ.id,args.race,pet_caste) then pet_count = pet_count + 1 end
end
if pet_count > 1 then
print("Added "..pet_count.." kinds of "..racePlural.." to "..dfhack.TranslateName(df.global.world.entities.all[civ.id].name)..".")
elseif pet_count == 1 then
print("Added 1 kind of "..raceSingle.." to "..dfhack.TranslateName(df.global.world.entities.all[civ.id].name)..".")
end
end
end
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Teneb

  • Bay Watcher
  • (they/them) Penguin rebellion
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1345 on: August 17, 2016, 07:52:25 pm »

Is there a way to ensure an entity always has access to specific boulders, like with metal bars? I'm thinking no, but I'd rather ask.
You can DFHack it into the resources list (checking first, of course, that it's not already there).  The following does something similar for specific domesticated creatures and it references known rock types.  I don't know offhand where metals are stored, but it should be relatively close to where the rocks and animals are.

Code: (tesb-add-pets.lua) [Select]
-- Adds specific castes of pets to each civ of an Entity type
-- Intended for Pet Rocks, but would work on Awakened Stones as well
-- Caste is available if the civ has access to the associated layer stone

-- Made by Dirst for the Earth Strikes Back mod
-- Based on AddPetToCiv

local utils=require 'utils'

local args = utils.processArgs({...}, validArgs)

validArgs = validArgs or utils.invert({
 'help',
 'entity',
 'race',
 'sort'
})

if args.help then
print([[tesb-add-pets.lua
Adds specific castes to each civ based on discovered minerals
Based on AddPetToCiv.lua
arguments
    -help
        print this help message
    -entity <ENTITY_ID>
        The raw id of the target entity, e.g. MOUNTAIN
    -race <CREATURE_ID>
        The raw id of a creature, e.g. TESB_PET_ROCK
-sort
Sorts the castes alphabetically (by ID) before adding
]])
return
end


function insertPet(civ_id,creature,caste)
local exists=false
civ = df.global.world.entities.all[civ_id]
-- Original AddPetToCiv targets all civs belonging to the same ENTITY raw
-- This version allows each instanced civ to have its own list
for k,v in pairs(civ.resources.animals.pet_races) do
local checkrace = df.creature_raw.find(v)
local checkcaste = checkrace.caste[civ.resources.animals.pet_castes[k]]
if checkrace.creature_id == creature and checkcaste.caste_id == caste then exists=true end
end
if exists==true then
else
--the civ doesn't have the creature as a pet
--add the creature as a pet
local racenum=-1
local castenum=-1
for k,v in pairs(df.global.world.raws.creatures.all) do
if v.creature_id==creature then
racenum=k
for kk,vv in pairs(v.caste) do
if vv.caste_id==caste then castenum=kk end
end
break
end
end
if racenum > -1 and castenum > -1 then
civ.resources.animals.pet_races:insert('#',racenum)
civ.resources.animals.pet_castes:insert('#',castenum)
--print("Inserted "..creature..":"..caste.." in civ "..dfhack.TranslateName(df.global.world.entities.all[civ_id].name))
else
-- Invalid caste.  Print a message and do NOT increment the pet count.
print(creature..":"..caste.." not found in the raws")
exists = true
end
end
return not exists
end

--Find race's common name
for k,v in ipairs(df.global.world.raws.creatures.all) do
  if v.creature_id == args.race then
    raceSingle = df.creature_raw.find(k).name[0]
racePlural = df.creature_raw.find(k).name[1]
    break
  end
end


-- List of layer stones that coincide with Pet Rock castes
stone_list = { "ANDESITE", "BASALT", "CHALK", "CHERT", "CLAYSTONE",
"CONGLOMERATE", "DACITE", "DIORITE", "DOLOMITE", "GABBRO", "GNEISS",
"GRANITE", "LIMESTONE", "MARBLE", "MUDSTONE", "PHYLLITE", "QUARTZITE",
"RHYOLITE", "ROCK_SALT", "SANDSTONE", "SCHIST", "SHALE", "SILTSTONE",
"SLATE" }

caste_list = {}

-- Lists indexed by material ID numbers
for mat = 1, #stone_list do
local index = dfhack.matinfo.find(stone_list[mat]).index
caste_list[index] = stone_list[mat]
end

-- Identify appropriate castes for each instanced civ of the correct entity type
for k,civ in pairs(df.global.world.entities.all) do
local pet_list = {}
if civ.type==0 and civ.entity_raw.code==args.entity then
for kk,mat in pairs(civ.resources.stones) do
if caste_list[mat] then
pet_list[1 + #pet_list] = caste_list[mat]
end
end
if args.sort then table.sort(pet_list) end
local pet_count = 0
-- Pets aren't valid until successfully inserted, so maintaining a count of successes
for kk,pet_caste in ipairs(pet_list) do
if insertPet(civ.id,args.race,pet_caste) then pet_count = pet_count + 1 end
end
if pet_count > 1 then
print("Added "..pet_count.." kinds of "..racePlural.." to "..dfhack.TranslateName(df.global.world.entities.all[civ.id].name)..".")
elseif pet_count == 1 then
print("Added 1 kind of "..raceSingle.." to "..dfhack.TranslateName(df.global.world.entities.all[civ.id].name)..".")
end
end
end
Unfortunately, I'm not versed in lua (only java) or df data structures. Still, thanks.
Logged
Monstrous Manual: D&D in DF
Quote from: Tack
What if “slammed in the ass by dead philosophers” is actually the thing which will progress our culture to the next step?

Managrimm

  • Bay Watcher
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1346 on: August 20, 2016, 02:48:18 am »

Is it possible to DFHack different creature castes into having different tiles?
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1347 on: August 20, 2016, 04:28:37 am »

Yes, 100%. I don't think TWBT does, and the process is pretty complicated, but I know for a fact that it can be done.

Managrimm

  • Bay Watcher
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1348 on: August 20, 2016, 01:09:19 pm »

Yes, 100%. I don't think TWBT does, and the process is pretty complicated, but I know for a fact that it can be done.

Do you know if anyone is working on anything like that? Unfortunately the "pretty complicated" part probably means I won't be able to slap anything together since I don't know any programming languages.
Logged

Teneb

  • Bay Watcher
  • (they/them) Penguin rebellion
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1349 on: August 20, 2016, 02:54:31 pm »

I suspect the answer may be yes, since you can have multiple I_SOURCE and I_EFFECT, but can an interaction have more than one I_TARGET?

EDIT: Might as well throw an example out here.
Spoiler: Would this work? (click to show/hide)

EDIT2: Never mind my question, it is possible. Don't know what would happen if I set all of them to have the same target id, but probably something buggy.

Instead, let me change my question: Can a region have more than one regional interaction?
« Last Edit: August 20, 2016, 03:13:12 pm by Teneb »
Logged
Monstrous Manual: D&D in DF
Quote from: Tack
What if “slammed in the ass by dead philosophers” is actually the thing which will progress our culture to the next step?
Pages: 1 ... 88 89 [90] 91 92 ... 137