Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Modding questions  (Read 1004 times)

Zambaku

  • Bay Watcher
    • View Profile
Modding questions
« on: August 09, 2013, 11:57:08 am »

Well, I managed to get my first successful fortress and I got bored with it after a while so I figured I'd add some new things to keep me interested.
First thing I wished for is more weapons so I have a question about a club:

My setup is as following:
Code: [Select]
[ITEM_WEAPON:ITEM_WEAPON_CLUB]
[NAME:club:clubs]
[SIZE:800]
[SKILL:MACE]
[TWO_HANDED:37500]
[MINIMUM_SIZE:32500]
[MATERIAL_SIZE:3]
[ATTACK:BLUNT:20:200:bash:bashes:NO_SUB:2000]


How do I go about making it so it can be made from not only metals but also wood?
Logged

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Modding questions
« Reply #1 on: August 09, 2013, 12:14:12 pm »

you can have it made from wood in vanilla reactions by adding [RANGED:MACE:NULL] (note create a ammo type with the ID NULL, it doesn't have to exist in game, just in code)

Now since it counts as a ranged weapon you can also be made in the bowers shop as wood and bone
Logged

scamtank

  • Bay Watcher
    • View Profile
Re: Modding questions
« Reply #2 on: August 09, 2013, 12:23:26 pm »

Aside from that little detour (holy shit Hugo), you really can't without a special "Make wooden club" reaction somewhere. Ordinary melee weapons can only be made from metals that have [ITEMS_WEAPON]. [TRAINING] weapons can only be made from wood, but I don't know whether the carpentry shop poofs up new reactions to cater for training stuff besides axes, swords and spears.

I think that's why I abandoned my own idea for training clubs and mallets, I can't remember anymore. Elves would bring you wooden ones, though. They have an entity tag that lets them make traditionally metallic armor and weaponry from wood.
Logged

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Modding questions
« Reply #3 on: August 09, 2013, 12:39:04 pm »

I thought [TRAINING] just removed the edge so it's a blunt weapon. And even then he would have to copy the club and make a [CLUB_TRAINING] weapon with the [TRAINING] tag then enable both to his civ.

so he can now make a club in the forge  and a wood club(training) in the carpenters, And if he uses a custom reaction, he must either make a new workshop just for it or use one of the following: KILN, SMELTER, TANNER, KITCHEN, QUERN, MILLSTONE, STILL, CRAFTSMAN, SOAP_MAKER, SCREW_PRESS

then enable said reaction in his entity.

Going to old route that was popular in 40d, that I Mentioned before. The ammo can look just like this:

Code: [Select]
[ITEM_AMMO:NULL]
[NAME:null:null]
[CLASS:NULL]
[SIZE:1]
[ATTACK:EDGE:2:2000:stab:stabs:NO_SUB:1000]

drop that in with his club, bam only thing he needs to do now is enable the ITEM_WEAPON_CLUB in his entity and now he can make all metal weapon clubs, and even wood and bone versions if he likes.

Least amount of effort, for the maximum amount of use.
Logged

Grimlocke

  • Bay Watcher
  • *kobold noises*
    • View Profile
Re: Modding questions
« Reply #4 on: August 09, 2013, 12:44:00 pm »

Are you certain the dummy ammo entry is needed?

I currentely have a querterstaff added to my weapons, that uses the ranged tag, so far without any crashes or error reports. (I did use NONE instead of NULL, if that makes any difference).

The mod hasnt been tested much outside of the arena yet, so possible this is why I havnt noticed any problems.
Logged
I make Grimlocke's History & Realism Mods. Its got poleaxes, sturdy joints and bloomeries. Now compatible with DF Revised!

scamtank

  • Bay Watcher
    • View Profile
Re: Modding questions
« Reply #5 on: August 09, 2013, 12:53:08 pm »

I thought [TRAINING] just removed the edge so it's a blunt weapon.

No, no. They can definitely have edges, I just tested it with (large tower-cap daggers). The usual training weapons are just completely neutered with BLUNT on all attacks and massive contact areas that turn them into harmless spanking bats.

I personally gave them the original contact areas so that you could beat kobolds and other small wildlife to death with them in an emergency.
Logged

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Modding questions
« Reply #6 on: August 09, 2013, 12:53:58 pm »

I normally just add in null stuff just in case. Being a programmer and all I try to prevent errors with dummies lol

EDIT:
@Scam
He would still need to make two Club weapon objects lol.
Logged

Zambaku

  • Bay Watcher
    • View Profile
Re: Modding questions
« Reply #7 on: August 09, 2013, 03:22:54 pm »

Thanks for the help =) But I'm still having issues and I don't know what's wrong, I can't make the clubs but they appear in the arena.

Club code:
Code: [Select]
[ITEM_WEAPON:ITEM_WEAPON_CLUB]
[NAME:club:clubs]
[SIZE:800]
[SKILL:MACE]
[TWO_HANDED:37500]
[MINIMUM_SIZE:32500]
[MATERIAL_SIZE:1]
[ATTACK:BLUNT:15:150:bash:bashes:NO_SUB:2000]
[RANGED:MACE:NONE]


Entity code:
Code: [Select]
[ITEM_WEAPON_CLUB]
« Last Edit: August 09, 2013, 03:45:05 pm by Zambaku »
Logged

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Modding questions
« Reply #8 on: August 09, 2013, 03:35:19 pm »

new items = new world
Logged

Zambaku

  • Bay Watcher
    • View Profile
Re: Modding questions
« Reply #9 on: August 10, 2013, 04:11:42 am »

Awesome, got it working now  :D

Now, another question this time about plants.

I made a new plant called a slime cap and the idea was that it would give fat so I could make soap.

Is it as simple as just adding :     [USE_MATERIAL_TEMPLATE:FAT:FAT_TEMPLATE] ?

Code: [Select]
[code][PLANT:MUSHROOM_CAP_SLIME]
[NAME:slime cap][NAME_PLURAL:slime caps][ADJ:slime cap]

Every plant needs a structural material so that the game knows how it behaves when it's alive.

Here the material is added to the plant, using a template from the material file.
[USE_MATERIAL_TEMPLATE:STRUCTURAL:STRUCTURAL_PLANT_TEMPLATE]
[MATERIAL_VALUE:2]

Here the material is marked as the structural material (this could be below the edible tags which come next).  In general, you can use LOCAL_PLANT_MAT|<token>, PLANT_MAT|<plant>|<token>, CREATURE_MAT|<creature>|<token> or INORGANIC|IRON (though the game might hiccup for a while specifically on plants that aren't structurally plants).
[BASIC_MAT:LOCAL_PLANT_MAT:STRUCTURAL]

We also modify it a bit to make the plant edible.  Any token material can be used here to modify the material that was created from the template.
[EDIBLE_VERMIN]
[EDIBLE_RAW]
[EDIBLE_COOKED]

[PICKED_TILE:6][PICKED_COLOR:5:0:0]
[GROWDUR:300][VALUE:2]

Next we establish an alcohol material in much the same way as the structural material.

[USE_MATERIAL_TEMPLATE:DRINK:PLANT_ALCOHOL_TEMPLATE]
The material template is just called "alcohol" so we need to give it a proper name.
[STATE_NAME_ADJ:ALL_SOLID:frozen slime wine]
[STATE_NAME_ADJ:LIQUID:slime wine]
[STATE_NAME_ADJ:GAS:boiling slime wine]
We also set a few more numbers to distinguish the alcohol from the template.
[MATERIAL_VALUE:2]
[DISPLAY_COLOR:5:0:0]
[EDIBLE_RAW]
[EDIBLE_COOKED]
[PREFIX:NONE]
[DRINK:LOCAL_PLANT_MAT:DRINK]

The seed material and information is established in a similar fashion.  Other plants (including trees) add materials in the same way, though trees cannot be used at this time with seeds/thread/drink etc.  They just use the TREE tag to obtain a wood material (they also have a structural material for their live form).

[USE_MATERIAL_TEMPLATE:SEED:SEED_TEMPLATE]
[MATERIAL_VALUE:1]
[EDIBLE_VERMIN]
[EDIBLE_COOKED]
[SEED:slime cap spawn:slime cap spawn:4:0:1:LOCAL_PLANT_MAT:SEED]
[SPRING][SUMMER][AUTUMN][WINTER]
[FREQUENCY:100]
[CLUSTERSIZE:5]
[PREFSTRING:rounded tops]
[WET][DRY]
[BIOME:SUBTERRANEAN_WATER]
[UNDERGROUND_DEPTH:1:3]
[SHRUB_TILE:58]
[DEAD_SHRUB_TILE:58]
[SHRUB_COLOR:5:0:0]
[DEAD_SHRUB_COLOR:0:0:1]
[/code]
Logged

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Modding questions
« Reply #10 on: August 10, 2013, 12:59:44 pm »

Why not give it:

Code: [Select]
[USE_MATERIAL_TEMPLATE:OIL:PLANT_OIL_TEMPLATE]
[STATE_NAME_ADJ:ALL_SOLID:frozen slime]
[STATE_NAME_ADJ:LIQUID:slime]
[STATE_NAME_ADJ:GAS:boiling slime]
[PREFIX:NONE]
[MATERIAL_VALUE:5]
[EDIBLE_COOKED]
[USE_MATERIAL_TEMPLATE:SOAP:PLANT_SOAP_TEMPLATE]
[STATE_NAME_ADJ:ALL_SOLID:slime soap]
[STATE_NAME_ADJ:LIQUID:melted slime soap]
[STATE_NAME_ADJ:GAS:n/a]
[PREFIX:NONE]
[MATERIAL_VALUE:5]
[USE_MATERIAL_TEMPLATE:STRUCTURAL:STRUCTURAL_PLANT_TEMPLATE]
[MATERIAL_VALUE:2]
[MATERIAL_REACTION_PRODUCT:PRESS_LIQUID_MAT:LOCAL_PLANT_MAT:OIL]
[EDIBLE_VERMIN]

now you can press the harvested plant to make oil which can be used to make soap.
Logged

Zambaku

  • Bay Watcher
    • View Profile
Re: Modding questions
« Reply #11 on: August 11, 2013, 05:33:50 am »

Ahh, didn't know you could do that. Awesome, thank you!


Another question, I'm experimenting with a tileset and I want the dorfs to have flesh colored faces but their colors turn out strange. How do I achieve a flesh color for every dorf?

Logged

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Modding questions
« Reply #12 on: August 11, 2013, 01:26:06 pm »

You could make up simple sprites of a standard Dwarf/Goblin/Elf/Kobold

then enable graphics and have a file that sets each race to use their single sprite. Because you can say USE_AS_IS or ADD_COLOR to the sprites and the ADD_COLOR adds the tile color (profession, etc) to all the grey scale on the sprite.

Only workaround that I know, but I'm not a graphics modder. Altho trying to dabble in it.
Logged

Suds Zimmerman

  • Bay Watcher
    • View Profile
Re: Modding questions
« Reply #13 on: August 11, 2013, 05:07:28 pm »

As Hugo said, you need to use graphics for this. I'd download a graphics set so you can get a handle for how the files work and manually add both the profession colour and the flesh colour to each dorf sprite. Be sure to use AS_IS:DEFAULT, as was mentioned. So, something like [MINER:DORFS:0:0:AS_IS:DEFAULT] (and so on, for every profession token.)
Logged
You don't need a weatherman to know which way the wind blows
DORFAMUNDA - NECROMUNDA DF MOD

Zambaku

  • Bay Watcher
    • View Profile
Re: Modding questions
« Reply #14 on: August 12, 2013, 12:18:23 pm »

Ah, cool! Many thanks! =)
Logged
Pages: [1] 2