Author Topic: Random Loot?  (Read 685 times)

Offline OriginalNWN

  • Newbie
  • *
  • Posts: 24
Random Loot?
« on: May 23, 2016, 10:38:35 AM »
Is there a way to create a randomized loot drop? Example: Party kills a white dragon and gets a random +2 item drop.

Offline Nol Drek

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2157
    • Nol Drek's Web Site
Re: Random Loot?
« Reply #1 on: May 23, 2016, 07:38:01 PM »
Yes. You will probably need to use up a Quest Item for each random loot drop. Let's say there are "N" items that could randomly drop.

Code: [Select]
CHAIN (if party doesn't have special item: Quest 1)
    SPECIAL ITEM (give item to party: Quest 1)
    GIVE TREASURE (random percent chance: 100/N %) Item #N
    chain if event doesn't happen
        GIVE TREASURE (random percent chance: 100/(N-1) %) Item #N-1
        chain if event doesn't happen
        ...
            GIVE TREASURE (random percent chance: 50 %) Item #2
            chain if event doesn't happen
                GIVE TREASURE (always happens) Item #1
"Into the Drachensgrab Mountains!"

http://www.noldrek.com

Offline OriginalNWN

  • Newbie
  • *
  • Posts: 24
Re: Random Loot?
« Reply #2 on: May 24, 2016, 12:33:08 PM »
Interesting! So from what I gather from your post (Still a noob to this whole thing). I could add as many items as I wished, I would just need to string it out quite a bit and keep the summed value of drop % to 100%. so random drop of 20 different items would have drop chance of 5% each?

Anything stopping me from setting it up where 1 item drops 90% of the time but a better item drops 10% of the time?

Offline ProphetSword

  • Mod Designer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2894
  • FRUA Lives!
    • Lands of Adventure
Re: Random Loot?
« Reply #3 on: May 24, 2016, 01:53:47 PM »
Quote
Anything stopping me from setting it up where 1 item drops 90% of the time but a better item drops 10% of the time?

Nothing will stop you from doing that.

Quote
I could add as many items as I wished, I would just need to string it out quite a bit and keep the summed value of drop % to 100%. so random drop of 20 different items would have drop chance of 5% each?

You could do that, but you should understand that it won't be weighted the same as a random table roll.  For example, this is what a table might look like:

01-20 - Item 1
21-40 - Item 2
41-60 - Item 3
61-80 - Item 4
81-100 - Item 5

But, in FRUA, it would look like this:

20% chance - Item 1
20% chance - Item 2
20% chance - Item 3
20% chance - Item 4
Default Item - Item 5

You will tend to see Item 5 more frequently, versus an equal distribution, due to the fact that each node has an 80% chance of failure.  So, keep that in mind when planning it all out.
LANDS OF ADVENTURE: An Old-School Style CRPG

More Information Here: http://landsadventure.blogspot.com/

Offline OriginalNWN

  • Newbie
  • *
  • Posts: 24
Re: Random Loot?
« Reply #4 on: May 24, 2016, 03:45:12 PM »
Ah, this makes sense to me. Thank you for the help!

Offline Nol Drek

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2157
    • Nol Drek's Web Site
Re: Random Loot?
« Reply #5 on: May 24, 2016, 07:38:17 PM »
As Ben said, you can make some items more likely than others by changing the probabilities to whatever you want.

For an equal probability of receiving each item, it would look like this:

20% chance - Item 1
25% chance - Item 2
33.3333% chance - Item 3
50% chance - Item 4
100% chance - Item 5

Where each link in the chain only triggers if the previous event did NOT occur.

The probability of receiving Item 2 = 0.80 * 0.25 = 0.20
The probability of receiving Item 3 = 0.80 * 0.75 * 0.3333 = 0.20
The probability of receiving Item 4 = 0.80 * 0.75 * 0.6667 * 0.50 = 0.2
The probability of receiving Item 5 = 0.80 * 0.75 * 0.6667 * 0.50 * 1.00 = 0.2

With N items, it would look like this:

100%/N chance - Item 1
100%/(N-1) chance - Item 2
100%/(N-2) chance - Item 3
...
100%/2 chance - Item N-1
100%/1 chance - Item N
"Into the Drachensgrab Mountains!"

http://www.noldrek.com

Offline ProphetSword

  • Mod Designer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2894
  • FRUA Lives!
    • Lands of Adventure
Re: Random Loot?
« Reply #6 on: May 24, 2016, 08:10:11 PM »
This is helpful information that should probably go in the FAQ section...

Any chance you'd want to make a post about it, Nol?  I'd be happy to make it a Sticky.

At this point, you should just write a handbook of helpful FRUA stuff.  I swear everything you post when it comes to FRUA help is pure gold.
LANDS OF ADVENTURE: An Old-School Style CRPG

More Information Here: http://landsadventure.blogspot.com/

Offline steve_mcdee

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 1945
Re: Random Loot?
« Reply #7 on: May 25, 2016, 02:58:17 AM »
Hey Nol (or Ben, or anyone)

I wondered whether it is possible to use "Combat Treasure" events rather than "Give Treasure" event, to set the last Combat Treasure event in the chain to "chain always happens"), and then to chain a Combat at the end of the chain? Would that work to make it so that the treasure drops as loot from the combat event?


Offline ProphetSword

  • Mod Designer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2894
  • FRUA Lives!
    • Lands of Adventure
Re: Random Loot?
« Reply #8 on: May 25, 2016, 06:32:10 AM »
When you use a Combat Treasure event, whatever is in that event will appear in the loot of the next combat on that level, even if it doesn't happen immediately. So, I see no reason why it wouldn't work.
LANDS OF ADVENTURE: An Old-School Style CRPG

More Information Here: http://landsadventure.blogspot.com/

Offline Nol Drek

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2157
    • Nol Drek's Web Site
Re: Random Loot?
« Reply #9 on: May 25, 2016, 06:54:52 PM »
This is helpful information that should probably go in the FAQ section...

Any chance you'd want to make a post about it, Nol?  I'd be happy to make it a Sticky.

At this point, you should just write a handbook of helpful FRUA stuff.  I swear everything you post when it comes to FRUA help is pure gold.

Posted in the FAQ here in case you want to use a "Wand of Viscous Globs" on it:
http://ua.reonis.com/index.php?topic=3319.0
"Into the Drachensgrab Mountains!"

http://www.noldrek.com

 

anything