Jump to content

Spin The Wheel/Wheel Of Fortune Event


Recommended Posts

Hello Intersect! @Dashplant requested a spin the wheel event tutorial so here it is.




You will need three variables, they are:
CanSpinWheelOfFortune = Boolean
WheelOfFortuneNPCState = Integer
WheelSpinChoices = Integer
These names are not that important as long as you can remember them and select them from the event editor. Name them what you wish!




You will need a total of 5 images:
One image is that animation, it is a combination of the other 4 images together to create an animation.
Then split the animation into 4 single images, and save in your animations folder as well. These will be for when the wheel of fortune is static and waiting to be played and also for when stop the wheel and it lands on a choice.
For the purpose of this tutorial and ease, I created a 4 prize wheel of fortune but you could have it be as many slots and prizes as you wish.


Below are the images I used, feel free to use these to build your event and test!

The animation graphic:

ee5f09f37d92b500a7b0a8fa613d33d6.pngWheel stopped animation.

These are the settings used to create the animation within intersects animation editor:


Then of course the individual files for each frame of the animation, these you will save in your animation folder as single frames. That way You can have an image for the wheel of fortune when its not spinning and for each option it can land on. Images are below:

69eb31dd49a1cdcc1c001c76b0800090.pngWheel stopped 1

36f8e20ee72b73135050f075ce424cd1.pngWheel stopped 2

a8726da59e57ea83285c048c43595f8e.pngWheel stopped 3

55d1ce44384456466272c13ed826e915.pngWheel stopped 4 - These files are all one frame animations with default settings. You don't want these to animate so nothing needs to be done.


Creating the NPC Event:

Okay, so now lets create a npc event who will sell you the ability to use the wheel of fortune for a turn. Create an event, give it s sprite and name it whatever you would like then give it 2 pages. Both pages will have spawn conditions lets add them.

Spawn Conditions:

The first pages spawn condition will be Variable "WheelOfFortuneNPCState" is equal to 0. The second page will be the same variable is equal to 1. This will trigger weather the npc should be offering the player to spin the wheel, or if the player has already purchased it, he will tell them to go over and spin the wheel. This can be done with a Boolean variable as well, not sure why I chose integer but it could be useful if you want the npc to have more than 2 states.

So our conditions are created, both pages will be triggered by the action button and have the same sprite for its image. I kept the name visible so it appeared to be an npc.

Page 1:

Ok so we start off with the "Show Options" command and add in two options.

The text offer should be something like "Try your hand at the wheel of fortune for 50 Gold?" (Note: you can change any items and amounts at your free will)

Then add in two options:  "Yes" & "No"

Leave no blank, if the player selects no, then the window will exit and nothing happens.

Under your "Yes" option you will add in a "Change Player Items" command and take 50gp from player

Under this you will set player variable WheelOfFortuneNPCState to 1 (this changes the npcs text when a player interacts with them to "Go over and spin the wheel").

Also Set player variable CanSpinWheelOfFortune to True (This tells the wheel of fortune event that you are able to interact with it and begin playing)

Then of course "Show Text" command to show a confirmation message from your npc. Something like "Thanks for the 50 Gold now go over to the wheel and try your luck!"

Finally under "Items Not Given/Taken" show a small message like "Sorry, it looks like you don't have 50 gold to play!"



Page 2:

This is simple, use a "Show Text" condition and write something like "Head over the the wheel and give it a spin!". That's it! (This will remind the player to go spin the wheel if they try to speak with your npc while they have purchased a game of wheel of fortune)


Your NPC Event Is All Setup!

Now, on to the Wheel of fortune event itself!


Wheel Of Fortune Event:

Here are some page specs for the event:

Create another event near the npc and add 7 pages to it, and name the event "Spin Me!" Pages 1-3 will be triggered by the action button and ages 4-7 will be auto run events. All pages will have "Hide Name" selected as true accept for page 2.


Now to set the images for these events you will not be using tilesets only animations, so make sure all images are in the animations folder and setup as animations, even if there only 1 frame. So, pages 1,2 and 4 will be set to the wheel stopped 1 image. Page 3 will be set to the wheel animation. Page 5 will be set to wheel stopped 2 image, page 6 set to wheel stopped 3 image and page 7 set to wheel stopped 4 image. We are essentially creating the many different "States" of the wheel of fortune game.

Setting up the pages:

You should have all the pages properties setup accept for the spawn conditions and actually event commands/content. Lets add that stuff now.


Page 1:

The first page will have no spawn conditions, this will be the default state that occurs when a player interacts with the wheel of fortune game without paying the fee to play. You simply add a "Show Text" command here and write something like "Nothing happens"



Page 2:

Spawn conditions: Player Variable "CanSpinWheelOfFortune" is equal to True.  This basically says we will not run this event until "CanSpinWheelOfFortune" equals true. Which if you remember in the npc event, we set this variable to true when we paid him the 50G. Now within the contents of this event we will simply add one command Set Player variable "WheelSpinChoices" to 1 when the action button is triggered. So for a bit of an explanation, "WheelSpinChoices" is the variable we use to track the state of the wheel. 1, will play the animation and 2-5 will display one of the four frames. Essentially stopping the wheel dead in its tracks and giving a reward based on the variable 2-5. So, sense we walked up to the wheel and used the action button the game begins and we move on to the next page.



Page 3:

Spawn Conditions: Player Variable "WheelSpinChoices" is set to 1.

The event contents in this page will be Set Player Variable "WheelSpinChoices" to Random Number 2-5

So select the radio button "Random" instead of choosing a static number for your variable and select 2-5

As I stated previously "WheelSpinChoices" 2,3,4,5 will represent the four possible prizes the wheel can land on.

The trigger for this page is action button, so the wheel is spinning and when the player uses the action button on the wheel it will pick a random number 2-5 and decide which prize the player receives.



Page 4:

Spawn Conditions: Player Variable "WheelSpinChoices" is set to 2.

Event Contents:

Wait 1,200 ms - I put in a small wait so when the spinner landed on the picture the player could see the image before the screen popped up giving the reward. This kind of assures the player there actually receiving the correct item.

Then: Show Text "Congratulations! You've won 5x bones! Play again soon!"

Then "Change Player Items" Give Item Bones x 5

When the item was taken successfully then we will reset all the variables so the whole game resets and the player can play again

Set Player Variable CanSpinWheelOfFortune to False

Set Player Variable WheelSpinChoices to 0

Set Player Variable WheelOfFortuneNPCState to 0

Now for items now given/taken:

Show Text "Sorry, your inventory seems to be too full to accept your prize!"




That's basically it guys, for the remaining three pages you make the spawn conditions 1 variable higher for each page. You will also change the item given to correspond with the wheel image and the "Show Text" prize message to reflect the item given.


One side note: When the wheel of fortune is available for the player to spin we show the event name "Spin Me!" to alert the player it is usable. You can also choose to display an animation for this, or even add a light bulb to your wheel of fortune that is red when you haven't paid and turns green when you can spin! The possibility's are endless.


Below is a few awful quality videos showing off the system:





Congratulations, you've made it through the tutorial!


Let me know your thoughts in the comments, if this worked, if i forgot something or if you have a better way or new ideas for this event/mini game!




Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...