DrawLots
Lottery plugin to specify winning weight for Unreal Engine.
Have you ever had trouble processing a lottery? This plugin allows you to draw lots according to the probability of winning.
Table of Contents
- Prepare Lottery Data
- Preparing the lottery data as an index
- Preparing the lottery data as an object
- Drawing lots
Prepare the lottery data
First, prepare the lottery data in variables.
DrawLotsIndex to register only the probability of winning and get the index. There are two types of lottery data: DrawLotsObject, which registers the probability of winning and an object to draw the lottery.
Prepare by index
- Add
DrawLotsIndexto the variable. - Compile.
- Add the required number of winning items to
DrawLotsIndexofDetails. - set the probability of winning.

Prepare the object as an object
- Add
DrawLotsObjectto the variable - Compile.
- Add the required number of winning items to
DrawLotsObjectinDetails. - Set the probability of winning.
- Set the winning items.

Draw lots

- create a node referring to Blueprint
- use function
DrawLotsIndexto draw the variable `DrawLotsIndex- return the winning array number
- return
-1if the lottery cannot be drawn, e.g. if you set all probabilities to 0 - disable
consecutiveto prevent the same number from being drawn consecutively 1. use the variableDrawLotsIndex
- use function
DrawLotsObjectto draw the variableDrawLotsObject- return the winning item
- return
nullptrif the item cannot be drawn, e.g. if you set all probabilities to 0 - if consecutive is disabled, the same item will not be drawn consecutively