Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Modding tutorials?  (Read 723 times)

smokingwreckage

  • Bay Watcher
    • View Profile
Modding tutorials?
« on: February 21, 2010, 06:37:21 am »

Are there any? I have a few things I'd like to toy with to make DF work the way I want and/or to just get around some problems (as I see it) in the game.

Basically, I want more trade partners, bigger caravans, and some way to make ore type stones last longer.

Ideally I'd like to make ore tiles very slow to mine but drop multiple ore "rocks", if that's even possible... maybe I should try a custom smelter reaction? Make ore "rocks" spit out more bars, would that work?

I would be OK with more hostile civs, but don't really care to mess about with dozens of new ores and plants.... especially the ores.

Also, is there any way to make invaders drop semi-random items on death, for my DiabloII style amusement?
Logged

CaptApollo12

  • Bay Watcher
    • View Profile
Re: Modding tutorials?
« Reply #1 on: February 21, 2010, 04:41:09 pm »

try an existing mod like relentless assualt for your hostile civ needs.
Also try the wiki and look at existing mods to get your legs on modding.
Tis what im doing.
I don't want to mislead you though.
You could set the probability of an enemy showing up with an item as small, and then have that item do cool things like have high blocking or attack.
Logged
"MONTARON!  You are so AGGRAVATING!   'Tis disturbing to my demeanor..."

NecroRebel

  • Bay Watcher
    • View Profile
Re: Modding tutorials?
« Reply #2 on: February 21, 2010, 05:04:46 pm »

Are there any? I have a few things I'd like to toy with to make DF work the way I want and/or to just get around some problems (as I see it) in the game.
Not that I know of; most of us are largely self-taught. We try things, look around the forum for people who have already done similar things, and ask around to see what does and doesn't work. The wiki is also very helpful; once you know the syntax of various things, it's relatively simple to simply look through the tokens lists and find what it is you need to do what you want.

As Apollo said, looking at existing mods to figure out what needs to go into something helps massively. The vanilla raws are also decent, though they don't really do anything particularly special. Modders have really stretched the limits of what the game is capable of at the moment.

Quote
Basically, I want more trade partners, bigger caravans,
Adding trade partners means adding extra civilization entities, which can be very difficult to do successfully. However, there are many preexisting mods that add functional civs, so either using those directly or cannibalizing them for your own purposes can be a good way to get your feet wet.

Quote
and some way to make ore type stones last longer.

Ideally I'd like to make ore tiles very slow to mine but drop multiple ore "rocks", if that's even possible... maybe I should try a custom smelter reaction? Make ore "rocks" spit out more bars, would that work?
Doable, but it's a big job. You'd have to add a custom reaction for either each and every ore, or use the ore classes for the reactions. The second is easier, but has undesirable consequences, such as tetrahedrite being 100% certain to produce silver instead of 20%, and if you used it to make silver you wouldn't get copper at all. The first way doesn't have those problems, but you'd need many more reaction entries to cover every ore type.

Also, it's not possible to make ores slower to mine or less likely to drop things. It's one ore per wall dug out max, with fewer produced with lower miner skill. And since miner skill improves so rapidly, well, there's really no reliable way of decreasing stone drops.

Quote
I would be OK with more hostile civs, but don't really care to mess about with dozens of new ores and plants.... especially the ores.
All mods are modular to an extent, so if you wish to take the civs out without the plants or ores or non-sapient creatures you can; there can be errors involved, but if you know what you're doing it's not too bad. There are also mods that do just add civs without other things. Relentless Assault, for instance, adds a half-dozen or so new civs, most of which are hostile by default.

Quote
Also, is there any way to make invaders drop semi-random items on death, for my DiabloII style amusement?
Not really. ITEMCORPSE makes a creature drop a specific item instead of their actual body on death, but that's the same through the whole species, and invaders don't carry much besides weapons, armor, and clothing. For the most part, the stuff invaders bring isn't even valid for you to use, so that makes true "loot" from enemies difficult to mod in.
Logged
A Better Magma Pump Stack: For all your high-FPS surface-level magma installation needs!

D_E

  • Bay Watcher
    • View Profile
Re: Modding tutorials?
« Reply #3 on: February 21, 2010, 06:52:16 pm »

As has already been said, the pages you want to look at on DFwiki are the ones about tokens.  Just about everything in DF is just a list of tokens that collectively describe whatever it is.

DF wiki does have several (at least 2) tutorials on modding.
http://df.magmawiki.com/index.php/Modding_Guide
http://df.magmawiki.com/index.php/User:Deon#How_to

----------------------------------
It wouldn't be that hard to make smelter rxns to make one ore into multiple bars etc, it would just involve a lot of copy-pasting once you had it working for one type of ore.
----------------------------------
More trade partners is fairly easy: you just need more friendly entities.  Fastest way to make more entities is just to copy-paste the one most like what you have in mind, and then go through making changes to the tokens with the aid of the DF wiki entity-token page.  Copy-pasting makes sure you don't forget something important.
----------------------------------

If you wish, you can make more of the stuff enemies bring valid for you to use through modding.

You can make their armor usable by changing their CREATURE definitions so that they are the same size and shape as the dwarfs (size 6 with the STOUT tag).  Weapons are already usable by you, as long as they use one of the skills you can set on your military dwarfs (ax, sword, mace, hammer, spear, and crossbow, I believe).  You can give them a greater variety of weapons and armor by adding whatever you want to item_weapons and item_armor -style files and then changing their entity definitions so that they make the new weapons.

Because you can't really control rarity -except possibly by adding redundant entries- and because you get attacked by so MANY enemies, if you do this you'll very quickly end up swimming under seas of dropped enemy items, including lots of the best stuff.

Idea:  I believe what they enemies chose to wear is semi-random, so by combining new clothing with smelter rxns you may be able to create, say, a bunch of "shirt with pouches" and have smelter reactions that let you turn these in to a normal shirt and whatever item you decide was in the pouch.

Edit:  Er.  Actually you can control rarity, at the entity level.  I don't know how rare RARE is, though.
« Last Edit: February 21, 2010, 07:00:59 pm by D_E »
Logged
Mods I've done:
Zelda mod-mod, Beta in the Wild DF 47.04
Illithid Empire mod DF 31.25 (update canceled)
Spotter's Guide to Illithids (Genesis mod-mod) genesis 3.19a4 (update canceled)

smokingwreckage

  • Bay Watcher
    • View Profile
Re: Modding tutorials?
« Reply #4 on: February 22, 2010, 02:07:28 am »

Well I have tried a few simple changes and it resulted in crashes during worldgen. So, next, take my well-trusted 40d11-or-so and back it up. The backup will be a test-bed. I'll probably start by trying to make Civ Forge work at all, then prune it back....
Logged

D_E

  • Bay Watcher
    • View Profile
Re: Modding tutorials?
« Reply #5 on: February 22, 2010, 06:50:16 pm »

What changes have you tried?  I don't think I've ever gotten a worldgen crash.
Logged
Mods I've done:
Zelda mod-mod, Beta in the Wild DF 47.04
Illithid Empire mod DF 31.25 (update canceled)
Spotter's Guide to Illithids (Genesis mod-mod) genesis 3.19a4 (update canceled)

Fedor

  • Bay Watcher
    • View Profile
Re: Modding tutorials?
« Reply #6 on: February 23, 2010, 12:27:04 am »

Your desire to have ore last longer might be possible to fulfill.

One way to do it would be to
1) make ore much, much heavier, so hauling it takes longer.
2) each ore, when smelted, becomes a number of slag units
3) each slag unit can then be processed into metal.  Make this more or less labor-intensive to suit your tastes.
Logged
Fedor Andreev is a citizen of the Federated Endeavor. He is a member of the Wandering Minds.