Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Itemcorpse and gems  (Read 1209 times)

Chrispy

  • Bay Watcher
    • View Profile
Itemcorpse and gems
« 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]?

Logged
Quote from: Toady
"This suggestion is very broad."
≡«+large yellow diamond+»≡
On the item is an exceptionally designed image of a diamond in yellow diamond.

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: Itemcorpse and gems
« Reply #1 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.

Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

Chrispy

  • Bay Watcher
    • View Profile
Re: Itemcorpse and gems
« Reply #2 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

Logged
Quote from: Toady
"This suggestion is very broad."
≡«+large yellow diamond+»≡
On the item is an exceptionally designed image of a diamond in yellow diamond.

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: Itemcorpse and gems
« Reply #3 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?

Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

Chrispy

  • Bay Watcher
    • View Profile
Re: Itemcorpse and gems
« Reply #4 on: March 17, 2008, 02:45:00 am »

That (randomly) sucks.  Oh well, c'est la vie.
Logged
Quote from: Toady
"This suggestion is very broad."
≡«+large yellow diamond+»≡
On the item is an exceptionally designed image of a diamond in yellow diamond.