Skip to content

shun126/DrawLots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DrawLots

Unreal Engine Supported Versions license release downloads stars

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
  • Draw 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

  1. Add DrawLotsIndex to the variable.
  2. Compile.
  3. Add the required number of winning items to DrawLotsIndex of Details.
  4. set the probability of winning.

DrawLotsIndex

Prepare the object as an object

  1. Add DrawLotsObject to the variable
  2. Compile.
  3. Add the required number of winning items to DrawLotsObject in Details.
  4. Set the probability of winning.
  5. Set the winning items.

DrawLotsObject

Draw lots !

DrawLots-BP

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

👾 Authors

ko-fi

Sponsor this project

 

Contributors