Bay 12 Games Forum

Dwarf Fortress => DF Modding => Topic started by: Chrispy on March 16, 2008, 10:15:00 am

Title: Itemcorpse and gems
Post by: Chrispy on March 16, 2008, 10:15:00 am
I'm trying to mod the Kobolds and Goblins to drop a random gem on death, and I'm confused on how I would go about doing this.  I think I could put multiple ITEMCORPSE tag in entity_default for each creature, but I don't know what format to put it in.  I also don't like how will pick any with equal probability.

So... any helpers?   :D

By the by, is there any way I could make it so that the probability of a drop is rare as well?  Maybe something like [BACKPACK:ITEM_GEM:RARE]?

Title: Re: Itemcorpse and gems
Post by: Sean Mirrsen on March 16, 2008, 10:42:00 am
[ITEMCORPSE:GEM:NO_SUBTYPE:STONE:NO_MATGLOSS] could do it, but since not all stones have gems, it might lead to glitches.

There is also no way to make itemcorpse select from several entries, and no way to keep both the corpse and the itemcorpse.

Title: Re: Itemcorpse and gems
Post by: Chrispy on March 16, 2008, 04:59:00 pm
I thought I read that if there are multiple ITEMCORPSE entries, that the game will choose from one of them?  This is what I was referencing.
http://www.bay12games.com/cgi-local/ultimatebb.cgi?ubb=get_topic&f=13&t=000473

It's from only 2 weeks ago, so I hope the game hasn't changed that much in that time.   :p

Title: Re: Itemcorpse and gems
Post by: Sean Mirrsen on March 17, 2008, 02:11:00 am
It always uses the last item on the list, simply because there is no "array" that holds the multiple entries, but rather only one variable, and as the parser reads through the creature definition, the variable gets updated, finally ending up as the last item on the list.

In my magic weaponry mod, I have a list of 640 weapon entries attached to a creature. What is the statistical probability that a RNG, however biased, will select the last item in that list 20 times in a row?

Title: Re: Itemcorpse and gems
Post by: Chrispy on March 17, 2008, 02:45:00 am
That (randomly) sucks.  Oh well, c'est la vie.