Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 122 123 [124] 125 126 ... 137

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

FantasticDorf

  • Bay Watcher
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1845 on: June 19, 2017, 07:12:41 am »

When building? Walls. After construction, though, doors connected to other doors will keep each other standing as if they were wall tiles, even if all proper walls get dug out or pulled down around them.
No. What coding gives doors that property.
Furniture in general are not in the raws in any way, shape or form, excepting instruments that can be placed.
Its the opaque coding in the background, it'd be nice to see inside it but whether Toady will ever release that slice of code in malleable raw form we can touch is unknown. You can modify your trap weapons though, i basically created a wooden mallet meat pulveriser trap by re-applying a spike trap to activate when pulled and slap anything ontop around a bit.

In this case it would also apply to grates with similar properties whether they are laid down on the floor or upright. Walls are required, its not describable or defined in any RAW form.
Logged

Atkana

  • Bay Watcher
  • [CURIOUSBEAST]
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1846 on: June 19, 2017, 08:29:39 am »

i need a playable boogeymen mod


This was a mod I didn't know I needed until I saw it mentioned, so I made something with DFhack. In theory it lets you play as any creature, but I designed it and it's sister script so you could play as the uniquely generated creatures of the world. The scripts are fairly basic but should do their job (I have ideas for a much fancier version if I ever learn how GUIs work).

Here's the first script. It reports the range of race IDs used for all the randomly generated creatures for the loaded world (including all the spoilers). Use it when you have a save loaded and take a note of the race ID you want to use - an ideal time to use it is on the very first screen for character creation during adventure mode, where you have to choose a race to play as.
Spoiler (click to show/hide)

The second script is the bit that actually changes what race you are. First, navigate through the character creation steps until you get to the page where you assign your skills and attributes. What you pick as a race on the first page doesn't really matter in terms of what you'll be physically, though it does effect what civilization you belong to (and subsequently your default ethics) - personally I'd pick human outsider as an option to not have any ties to a civilization. When you're on the skills and attributes page run the second script as explained in the notes near the top of the script. If it worked, you should see your race change in the top left of the Dwarf Fortress window and you're free to continue character creation as your normally would.

Spoiler (click to show/hide)

If something breaks/you have a question feel free to message me, I'll probably respond :P

overseer05-15

  • Bay Watcher
  • Personal Text
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1847 on: June 21, 2017, 08:12:09 am »

When building? Walls. After construction, though, doors connected to other doors will keep each other standing as if they were wall tiles, even if all proper walls get dug out or pulled down around them.
No. What coding gives doors that property.
It's hardcoded.
Logged
adult food like, I presume, steak and potatoes and tax forms,

My game giveaway

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1848 on: June 21, 2017, 10:41:15 pm »

When building? Walls. After construction, though, doors connected to other doors will keep each other standing as if they were wall tiles, even if all proper walls get dug out or pulled down around them.
No. What coding gives doors that property.

Furniture in general are not in the raws in any way, shape or form, excepting instruments that can be placed.

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1849 on: June 22, 2017, 06:58:49 am »

i need a playable boogeymen mod
This was a mod I didn't know I needed until I saw it mentioned, so I made something with DFhack. In theory it lets you play as any creature, but I designed it and it's sister script so you could play as the uniquely generated creatures of the world. The scripts are fairly basic but should do their job (I have ideas for a much fancier version if I ever learn how GUIs work).

If something breaks/you have a question feel free to message me, I'll probably respond :P
I dug your idea and was able to see a much simpler route to your desired goal:
Code: (generventurated.lua) [Select]
--Use on the adventurer race selection screen to use generated creatures, and again on the entities screen to fill it out.
local vw = df.global.gview.view.child
local current
local gcas
local gent
if not df.viewscreen_setupadventurest:is_instance(vw) then
qerror("Kinda needed to do this before you finished setting up an adventurer.")
elseif df.viewscreen_setupadventurest:is_instance(vw) then
if vw.page==0 then
current = df.global.world.raws.creatures.all
for m, n in ipairs(current) do
if current[m].flags.GENERATED == true then
gcas = current[m].caste
for j, k in ipairs(gcas) do
gcas[j].flags.CAN_SPEAK = true
gcas[j].flags.CAN_LEARN = true
gcas[j].flags.CANOPENDOORS = true
gcas[j].flags.LOCAL_POPS_CONTROLLABLE = true
gcas[j].flags.OUTSIDER_CONTROLLABLE = true
gcas[j].flags.LOCAL_POPS_PRODUCE_HEROES = true
end
for v = #vw.race_ids, m-#vw.race_ids, m do
vw.race_ids:resize(#vw.race_ids+1)
vw.race_ids[v] = m
end
end
end
elseif vw.page==3 then
gent = df.global.world.entities.all
for q, r in ipairs(gent) do
if gent[q].type==0 then
vw.home_entity_ids:resize(#vw.home_entity_ids+1)
vw.home_entity_ids[#vw.home_entity_ids-1] = gent[q].id
end
end
end
end
Run it on the race choosing screen:
Spoiler (click to show/hide)

Run it on the entity screen after you pick your generated beastie:
Spoiler (click to show/hide)

Feel free to scrap or build off of it for a more gooey gui version, pretty neat idea all in all, and as always check out the dfhack thread and if you want to push some scripts to the main dfhack repo, fork yourself a copy of this: https://github.com/DFHack/scripts and hack away!
Logged

Rethi-Eli

  • Bay Watcher
  • I came for the LNP, I stayed for the RTDs.
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1850 on: June 22, 2017, 12:41:46 pm »

Never mind, problem has been solved. PTW
« Last Edit: June 22, 2017, 01:14:01 pm by Rethi-Eli »
Logged
In the end, the winner is the one with the most snake venom.

Atkana

  • Bay Watcher
  • [CURIOUSBEAST]
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1851 on: June 23, 2017, 07:42:14 am »

-snip-
I dug your idea and was able to see a much simpler route to your desired goal:
Code: (generventurated.lua) [Select]
--Use on the adventurer race selection screen to use generated creatures, and again on the entities screen to fill it out.
local vw = df.global.gview.view.child
local current
local gcas
local gent
if not df.viewscreen_setupadventurest:is_instance(vw) then
qerror("Kinda needed to do this before you finished setting up an adventurer.")
elseif df.viewscreen_setupadventurest:is_instance(vw) then
if vw.page==0 then
current = df.global.world.raws.creatures.all
for m, n in ipairs(current) do
if current[m].flags.GENERATED == true then
gcas = current[m].caste
for j, k in ipairs(gcas) do
gcas[j].flags.CAN_SPEAK = true
gcas[j].flags.CAN_LEARN = true
gcas[j].flags.CANOPENDOORS = true
gcas[j].flags.LOCAL_POPS_CONTROLLABLE = true
gcas[j].flags.OUTSIDER_CONTROLLABLE = true
gcas[j].flags.LOCAL_POPS_PRODUCE_HEROES = true
end
for v = #vw.race_ids, m-#vw.race_ids, m do
vw.race_ids:resize(#vw.race_ids+1)
vw.race_ids[v] = m
end
end
end
elseif vw.page==3 then
gent = df.global.world.entities.all
for q, r in ipairs(gent) do
if gent[q].type==0 then
vw.home_entity_ids:resize(#vw.home_entity_ids+1)
vw.home_entity_ids[#vw.home_entity_ids-1] = gent[q].id
end
end
end
end
Run it on the race choosing screen:
Spoiler (click to show/hide)

Run it on the entity screen after you pick your generated beastie:
Spoiler (click to show/hide)

Feel free to scrap or build off of it for a more gooey gui version, pretty neat idea all in all, and as always check out the dfhack thread and if you want to push some scripts to the main dfhack repo, fork yourself a copy of this: https://github.com/DFHack/scripts and hack away!

Awesome - that's way better than my version! (It also got me to update dfhack in order to use it, which had a bonus of solving a bunch of things I was having trouble working out :P). I initially did a bit of investigating down the flags path but obviously didn't science hard enough because I couldn't get them to work. Now I understand why I wasn't getting the "g: Become [another caste]" option with my method - because the other castes didn't have the right flags enabled.

As penance for my initial lack of science, I did some investigation to sort out the problem the script has with the flag changes not being saved.
The quick summary + solution:
If you want edits to a Generated creature to persist after a save+load, you must add the changes into the raws entry since changes to flags aren't saved (though you should still set the flags if you want the edits to be available for the play session the edits are made in).

The ramblings:
Spoiler (click to show/hide)

I'll leave it to you to figure out how to add entries to the raws entries with a script since my programming knowledge is fairly limited (I tried my best, but ran into problems trying to work out how to format a string containing square brackets properly :P)



Oh yeah, and just so this isn't all just dfhackery stuff outside of the dfhack thread I'll mention this for people in general: While the wiki doesn't mention it, [LOCAL_POPS_CONTROLLABLE], [OUTSIDER_CONTROLLABLE], and [LOCAL_POPS_PRODUCE_HEROES] are seemingly all caste-level tokens. The only one that really has any impact in adventure mode is the [OUTSIDER_CONTROLLABLE] token, which you can use to limit Outsider adventurers to only specific castes of a creature if you wanted to.

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1852 on: June 24, 2017, 04:26:17 am »

The controllable/heroes tokens let you start as that caste in a civilization.

Still playing with the idea of that script, I think I know how to make it work without needing to be run twice if I can just get it to change the screen right, but then I got sidetracked trying to get the "Forgotten Beast x60" list to find the string with their description and put the first part as the name.
« Last Edit: June 24, 2017, 04:27:56 am by Max™ »
Logged

scourge728

  • Bay Watcher
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1853 on: June 25, 2017, 12:37:17 pm »

So I tried to make a building that lets you turn metals into other metals, I build the building..... and none of the reactions show up
Spoiler (click to show/hide)

Spoiler (click to show/hide)

scamtank

  • Bay Watcher
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1854 on: June 25, 2017, 01:07:54 pm »

Are dwarf entities allowed to use those reactions?
Logged

scourge728

  • Bay Watcher
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1855 on: June 25, 2017, 01:34:29 pm »

Yes.... wait a minute, do the reaction names in the entity have to be in caps?

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1856 on: June 25, 2017, 07:16:13 pm »

Yes.... wait a minute, do the reaction names in the entity have to be in caps?

You would be very surprised at what doesn't need to be in caps.

Rethi-Eli

  • Bay Watcher
  • I came for the LNP, I stayed for the RTDs.
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1857 on: June 25, 2017, 09:55:36 pm »

When in DF modding, do as the vanilla files do
Logged
In the end, the winner is the one with the most snake venom.

Dorsidwarf

  • Bay Watcher
  • [INTERSTELLAR]
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1858 on: June 26, 2017, 02:05:21 am »

How do you select a specific bodypart and apply a tissue to it?

If I have a creature with feathers, but I want it's feet to be scaled instead, how would I do that?
Logged
Quote from: Rodney Ootkins
Everything is going to be alright

BlackFlyme

  • Bay Watcher
  • BlackFlyme cancels Work: Interrupted by bird.
    • View Profile
Re: [MODDING] 0.43.x QUESTIONS THREAD
« Reply #1859 on: June 26, 2017, 07:36:19 am »

[TISSUE_LAYER:BY_CATEGORY:FOOT:SCALE]
Logged
Pages: 1 ... 122 123 [124] 125 126 ... 137