Professional Documents
Culture Documents
documentation
Tool for monetization, retention and daily bonus
─
Integration
Settings
Saving/Loading
3
Integration
1) To migrate asset to your project - right click on LuckySpin folder, choose “Migrate...”,
press OK, choose your project’s content folder, press OK.
4
Go to GiveReward function. Here you will need to change the logic inside the green block.
Now here are placed the logic of adding some coins to demo player. Probably you have
your own player controller with abilities to change coins, gems, lives or something else.
This is done as a function for more flexibility because you can want to do something else at
this step.
5
Then go to TakeTurnCost function. Here you will need to change the logic inside the green
block. Now here are placed the logic of taking 300 coins from demo player. Probably you
have your own player controller with abilities to taking coins, lives, gems or something else
for a turn.
This is done as a function for more flexibility because you can want to take coins or
something else accordingly current player state, health, the day of the week, etc.
Settings
A widget “WBP_LuckySpin” has some settings (public variables):
FreeTurnsEnabled - Can players make the spin for FREE from time to time?
You can add new points or change the positions of existing points to change the animation
of the sectors. Now the duration of the animation is 4 seconds. If you want to change this
time, you need to do two things:
- move the last point on the curve from 4.00 to desired X value. Y value in the last
point should be 1.00
- open “Widgets/WBP_LuckySpin” and change the “MaxRotationTime” variable’s
default value from 4 to the desired value in seconds.
8
You can imagine this as a long line consist of parts with different lengths accordingly to
probability |----------|----------|----------|-|
3) On the next step, we go through this line and check in this part our random number is.
Visualization as the line is showing that you can set as high probability as you want for
cheap items to decrease the chance of expensive items.
It is a fairly clear and easy way to calculate this. Though you should remember that
“Random integer in range” is not truly random function and this asset may not be suitable
for serious casino games without additional work.
11
Saving/Loading
Saving/loading system implemented like described here:
https://docs.unrealengine.com/en-us/Gameplay/SaveGame/Blueprints