# Set chances of multiple outputs for input parameter.

**URL:** <https://forums.unrealengine.com/t/set-chances-of-multiple-outputs-for-input-parameter/2398510>\
**Category:** Blueprint\
**Tags:** math, unreal-engine, Blueprint, question\
**Created:** [March 18, 2025, 3:39pm UTC](https://forums.unrealengine.com/t/set-chances-of-multiple-outputs-for-input-parameter/2398510 "2025-03-18T15:39:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![GreenOk.1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GreenOk.1](https://forums.unrealengine.com/u/GreenOk.1)\
**Post date:** [March 18, 2025, 3:39pm UTC](https://forums.unrealengine.com/t/set-chances-of-multiple-outputs-for-input-parameter/2398510/1 "2025-03-18T15:39:32Z")

</div>

Hello everyone! I got stuck with some maths and it’s implementation in my project, looking forward to hear some advices.

I’m currently trying to make a trading system with vendors in my project.  
Using a slide bar, players can choose the desired price (“current price”) between 1 (“priceMIN”) and the default vendor price (“priceMAX”).

I managed to add the correct formula, which detects the percentage of “current price” between “priceMIN” and “priceMAX”.

Now I would like to detect the chances of successful and unsuccessful trading, so if player lowers the price for too much - vendor will be more likely to refuse selling an item or move the trading process to the next “round” with different min\max prices. Any ideas of how may i approach this with UE tools?

Here is a table of approximate chance values I wish to set, depending on percentage of “current price” - the value I get with my first formula:  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/optimized/4X/3/8/d/38d121036292bc9c36e8fba029fdf0a61b9d2950_2_690x50.png)

% of price - the % of “current price” in between “priceMIN” and “priceMAX”;  
% chance to succes - chance for vendor to accept the trade and sell player an item;  
% chance to trade - chance for vendor to move the deal on the next trading rounds with new “piceMIN” and “priceMAX”;  
% chance to fail - chance for vendor to refuse the deal.

---

<div class="post-metadata">

**Author:** ![Mind-Brain](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mind-brain/32/906573_2.png) [@Mind-Brain](https://forums.unrealengine.com/u/Mind-Brain)\
**Post date:** [March 18, 2025, 10:29pm UTC](https://forums.unrealengine.com/t/set-chances-of-multiple-outputs-for-input-parameter/2398510/2 "2025-03-18T22:29:12Z")

</div>

Hey @GreenOk.1!

Here’s how I’d go about it:  
First, make a Curve Vector

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/8/2/68264d8151a4415319f6890cdcb84dd3072b2867.png)  
Then add values.  
Time is your % of price on the curve (ranging 0 to 1 for 100%)  
X is Fail % for each time, and Y is FAIL PLUS Trade % for each time. This creates ranges. Z can be 0 because it’ll always be from whatever Y is up to 100, giving you your success % threshold.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/1/9/81946c179bf17d08384b44a6b97df59176563470.png)

Hope this helps!

---

<div class="post-metadata">

**Author:** ![GreenOk.1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GreenOk.1](https://forums.unrealengine.com/u/GreenOk.1)\
**Post date:** [March 19, 2025, 8:10am UTC](https://forums.unrealengine.com/t/set-chances-of-multiple-outputs-for-input-parameter/2398510/3 "2025-03-19T08:10:24Z")

</div>

Gonna try this today, thank you!

---

<div class="post-metadata">

**Author:** ![GreenOk.1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GreenOk.1](https://forums.unrealengine.com/u/GreenOk.1)\
**Post date:** [March 19, 2025, 9:51am UTC](https://forums.unrealengine.com/t/set-chances-of-multiple-outputs-for-input-parameter/2398510/4 "2025-03-19T09:51:33Z")

</div>

Finaly it works. Interesting solution, I’m gonna keep this one, but I accidentally inverted my curve vector, so I had to change greater equal bool to less equal bool 🙂  
Thank you very much, you are breathtaking!

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [April 18, 2025, 9:51am UTC](https://forums.unrealengine.com/t/set-chances-of-multiple-outputs-for-input-parameter/2398510/5 "2025-04-18T09:51:36Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
