Bay 12 Games Forum

Please login or register.

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

Author Topic: What is the [ITEMCORPSE] syntax?  (Read 1535 times)

Nakar

  • Bay Watcher
    • View Profile
What is the [ITEMCORPSE] syntax?
« on: November 22, 2006, 03:28:00 pm »

Suppose I've created a steam-powered golem with mace hands and I want it to drop a bronze mace or two when defeated.

The tag [ITEMCORPSE:WEAPON:WEAPON_MACE:BRONZE:NO_RACEGLOSS]

is how I THOUGHT it was supposed to work, but every time I kill the creature in-game it drops a bronze whip instead. I then tried ITEM_WEAPON_MACE, but that did the same. I thought I had the syntax down for this, but apparently I don't. Works fine with NO_SUBTYPE for items that don't differentiate, but I can't seem to get it working with weapons, armor, toys, etc.

Likewise, is there any ITEMQUANTITY modifier tag? ITEMQUALITY seems to function fine, but I can't determine if there's a way to, say, make a Giant Magma Man drop a stack of 5 Ash.

EDIT: Apparently from the custom monster thread it doesn't interpret the subtype string at all.   :(

Guess it's okay if it just returns the first item on the list, then? So if I actually WANTED bronze whips, this would be handy.

[ November 22, 2006: Message edited by: Nakar ]

DOUBLE EDIT: Apparently it DOES return the first item on the list. If I swap Whip and Battle Axe in item_weapon.txt it will cause battle axes to drop instead of whips. Are there any negative consequences to doing this? Will all whips in the game suddenly switch places with battle axes? Or does it not matter at all what order the items are in the file after the world/fort have been created?

[ November 22, 2006: Message edited by: Nakar ]

Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: What is the [ITEMCORPSE] syntax?
« Reply #1 on: November 22, 2006, 03:42:00 pm »

This is Bug 14 on the reported bugs list.  It's not really a bug, in the sense that I just haven't implemented it yet -- no monsters in the game use the subtype variable, but I'm treating it like a bug in the sense that I'll fix it sooner than some of the other bloats that want to be added.
Logged
The Toad, a Natural Resource:  Preserve yours today!

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: What is the [ITEMCORPSE] syntax?
« Reply #2 on: November 22, 2006, 03:43:00 pm »

Did you remake the world after you did the swap?  Old saves should use the raw objects in the same order they were created in, regardless of how you fiddle with the files.
Logged
The Toad, a Natural Resource:  Preserve yours today!

Nakar

  • Bay Watcher
    • View Profile
Re: What is the [ITEMCORPSE] syntax?
« Reply #3 on: November 22, 2006, 03:53:00 pm »

quote:
Originally posted by Toady One:
<STRONG>Did you remake the world after you did the swap?  Old saves should use the raw objects in the same order they were created in, regardless of how you fiddle with the files.</STRONG>

I did not. Swapping the variables immediately swapped the weapons dropped in the save. Same world, same save (I'm ctrl-alt-deleting it as I test it; the save is backed up so I'm not concerned if it corrupts). I haven't tested what happens if I kill the creatures, get the battle axes, then swap whips and battle axes back again after saving and reloading. But it does seem you can get any item in a subtype list right now by manually altering the order of items in the raw files.

Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: What is the [ITEMCORPSE] syntax?
« Reply #4 on: November 22, 2006, 04:02:00 pm »

Yeah, I justed tested this.  That's very odd.  Though I figured there'd be more complaints by now if that part of the code isn't working.  I'm going to do some further tests to see what's going on.
Logged
The Toad, a Natural Resource:  Preserve yours today!

Nakar

  • Bay Watcher
    • View Profile
Re: What is the [ITEMCORPSE] syntax?
« Reply #5 on: November 22, 2006, 04:10:00 pm »

quote:
Originally posted by Toady One:
<STRONG>Yeah, I justed tested this.  That's very odd.  Though I figured there'd be more complaints by now if that part of the code isn't working.  I'm going to do some further tests to see what's going on.</STRONG>

I just went and swapped whips and axes back again and all axes turned into whips (and vice-versa). So that seems to have some effect.

Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: What is the [ITEMCORPSE] syntax?
« Reply #6 on: November 22, 2006, 04:32:00 pm »

All of this behavior is fixed now, and ITEMCORPSE supports subtypes for any item type in the item raws.
Logged
The Toad, a Natural Resource:  Preserve yours today!

Nakar

  • Bay Watcher
    • View Profile
Re: What is the [ITEMCORPSE] syntax?
« Reply #7 on: November 22, 2006, 04:41:00 pm »

quote:
Originally posted by Toady One:
<STRONG>All of this behavior is fixed now, and ITEMCORPSE supports subtypes for any item type in the item raws.</STRONG>

One more odd issue:

On a lark, I played around with Adamantine weapons and armor with this. They drop just like any other item does, and dwarves will happily use adamantine weapons created by "an unknown artisan" (as it will say if the weapon just drops off a critter), but they don't seem to want to put on adamantine armor. I've never managed to get a suit of it forged legitimately, and the only suits I've seen in use were by adventurers (who presumably can manually don them).

Is this a strange feature of the ITEMCORPSE thing, that dwarves will not wear armor that wasn't actually made by a known smith, or is there some kind of dwarven aversion to using adamantine armor?

The armor itself is ungodly expensive (I'm running an economy), something like $250,000. Do dwarven soldiers have to PAY for their own equipment? Will they not use gear that's out of their price range? I suppose I can test this with Steel or Iron plate easily enough.

Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: What is the [ITEMCORPSE] syntax?
« Reply #8 on: November 22, 2006, 04:52:00 pm »

They don't have a "race maker" variable, so it'll likely be the default.  Unfortunately, I think it'll list the armor without makers (which it doesn't know how to handle) without a size adjective, but it'll actually be sized for like...  chipmunks or something.  The [ITEMCORPSE] needs some kind of modifier for item size in the cases where the item takes a size, and a sensible default when one isn't provided.
Logged
The Toad, a Natural Resource:  Preserve yours today!

Nakar

  • Bay Watcher
    • View Profile
Re: What is the [ITEMCORPSE] syntax?
« Reply #9 on: November 22, 2006, 04:56:00 pm »

quote:
Originally posted by Toady One:
<STRONG>They don't have a "race maker" variable, so it'll likely be the default.  Unfortunately, I think it'll list the armor without makers (which it doesn't know how to handle) without a size adjective, but it'll actually be sized for like...  chipmunks or something.  The [ITEMCORPSE] needs some kind of modifier for item size in the cases where the item takes a size, and a sensible default when one isn't provided.</STRONG>

Size issue? Interesting. Perhaps I'll abandon and take an adventurer in to see what happens if he tries to wear the plate. Any word on quantity, as well? Or perhaps incorporating quality/quantity into the [ITEMCORPSE] tag itself?

Logged

axus

  • Bay Watcher
  • Axe Murderer
    • View Profile
Re: What is the [ITEMCORPSE] syntax?
« Reply #10 on: November 22, 2006, 05:03:00 pm »

Having a descriptive adjective for the size value would be nice in the description.  Dwarf-sized, human-sized, elephant-sized...
Logged

Zed Xionova

  • Bay Watcher
    • View Profile
Re: What is the [ITEMCORPSE] syntax?
« Reply #11 on: December 04, 2006, 09:33:00 am »

Sorry to bump up such an old topic, but what do I do if I want defeated creatures, (such as vermin and the like) to drop adamantine ore? It's not in any of the matglosses or anything, and I haven't been able to find a creature to base ore dropping off of. Is it even possible?
Logged

Syndlig

  • Escaped Lunatic
    • View Profile
Re: What is the [ITEMCORPSE] syntax?
« Reply #12 on: December 04, 2006, 09:49:00 am »

[ITEMCORPSE:ORE:NO_SUBTYPE:ADAMANTINE:NO_SUBTYPE]

This ought to work.  I never actually could get my dwarves to kill the creature to test it out, but it never showed an error in errorlog.txt, so Im making the assumption that it's probably correct (or close to).

Logged

Zed Xionova

  • Bay Watcher
    • View Profile
Re: What is the [ITEMCORPSE] syntax?
« Reply #13 on: December 04, 2006, 10:25:00 am »

Well, I tried it and I still get the basic firefly, dragonfly, etc. corpses. Also, the other ways I tried it didn't leave anything in the errorlog either, so I don't think that's a very good indication.
Logged

Abyssal Squid

  • Bay Watcher
    • View Profile
Re: What is the [ITEMCORPSE] syntax?
« Reply #14 on: December 05, 2006, 10:41:00 am »

Did you leave the [SMALL_REMAINS] tag?
Logged
Pages: [1] 2