• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • The Eevee Expo Game Jam has concluded! 🎉 Head on over to the game jam forum to play through the games.
    Don't forget to come back September 21st to vote for your favorites!
  • Reminder: AI-generated content is not allowed on the forums per the Rules and Regulations. Please contact us if you have any questions!
Prize Wheels

Resource Prize Wheels N/A

Hello Tech Skylanders 1518, I really liked your plugin and I noticed that the files do not have a version of the roulette wheel with graphics in the HGSS style if you allow me I designed one to use in my game and I would like to share it with you if you are interested.


(I used the roulette provided in the plugin files as a basis)
wheeltile HGSS.png
 
Hello Tech Skylanders 1518, I really liked your plugin and I noticed that the files do not have a version of the roulette wheel with graphics in the HGSS style if you allow me I designed one to use in my game and I would like to share it with you if you are interested.


(I used the roulette provided in the plugin files as a basis)
View attachment 14480
This looks awesome, thank you so much!! The shading came out really nice! I've added it to the download link and added you to the credits!
 
This looks awesome, thank you so much!! The shading came out really nice! I've added it to the download link and added you to the credits!

No problem, thanks for the compliment, this roulette wheel that I designed has a support to give it the feeling that it's on the ground but if you want it to appear to be suspended, just erase the supports with an editing program if you're too busy, I can do it myself this.
 
Pokemon_Wheel.png


Back when this was released and I saw the Pokémon wheel variant I was immediately reminded of Neon Colosseum from Pokémon Battle Revolution. The gimmick there was that you spun a wheel containing both your and your opponent's Pokémon and whatever you landed on became a part of your team, so you could end up with a team of yours, your opponent's, or a mix of both. It was a fascinating gimmick because it basically made it that the stronger your team was than the opponent's team, the more difficult it became if you didn't land on the right Pokémon.

I wonder if that gimmick could be recreated with this script alone and some default Essentials functionality, or if it's so complex it would require its own script to make.
 
To add quantity to prizes:
Expand Collapse Copy
#center_origins command from Marin's Scripting Utilities.
#If you have that script, you can delete this section
class Sprite
  def center_origins
    return if !self.bitmap
    self.ox = self.bitmap.width / 2
    self.oy = self.bitmap.height / 2
  end
end



#.degrees command, to convert degrees to radians
class Numeric
   def degrees
     self * Math::PI / 180
   end
end

def pbWheel(wheeldata)
  PrizeWheelScene.new(wheeldata)
end




class PrizeWheelScene

  def pbUpdate
    pbUpdateSpriteHash(@sprites)
  end


  def initialize(wheeldata)
    @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
    wheeldata = WheelData.const_get(wheeldata)
    @respin = (wheeldata[:respin]) ? wheeldata[:respin] : WheelData::DEFAULT_RESPIN
    @cost=(wheeldata[:cost]) ? wheeldata[:cost] : 0
    @costcoins = (wheeldata[:costcoins]) ? wheeldata[:costcoins] : WheelData::DEFAULT_COSTCOINS
    @prizecoins = (wheeldata[:prizecoins]) ? wheeldata[:prizecoins] : WheelData::DEFAULT_PRIZECOINS
    @prizes=wheeldata[:prizes]
    @sprites = {}
    @bg        = (wheeldata[:bg]) ? wheeldata[:bg] : WheelData::DEFAULT_BACKGROUND
    @wheel     = (wheeldata[:wheel]) ? wheeldata[:wheel] : WheelData::DEFAULT_WHEEL
    @radius    = (wheeldata[:radius]) ? wheeldata[:radius] : WheelData::DEFAULT_RADIUS
    @minspins  = (wheeldata[:minspins]) ? wheeldata[:minspins] : WheelData::DEFAULT_MINSPINS
    @spinsfx   = (wheeldata[:spinsfx]) ? wheeldata[:spinsfx] : WheelData::DEFAULT_SPINSFX
    @winsfx    = (wheeldata[:winsfx]) ? wheeldata[:winsfx] : WheelData::DEFUALT_WINSFX
    @level     = (wheeldata[:level]) ? wheeldata[:level] : WheelData::DEFAULT_LEVEL
    raise _INTL("Invalid level. (exceeds maximum level)") if @level > Settings::MAXIMUM_LEVEL
    @prizespin=0
    @angle=[72,36,0,313,287,251,216,180,144,108]
    @xyangle=[198,234,270,306,340,16,52,90,126,162]
    @sprites["bg"] = Sprite.new(@viewport)
    @sprites["bg"].bitmap = Bitmap.new("Graphics/Pictures/#{@bg}")
    @sprites["downarrow"] = AnimatedSprite.new("Graphics/Pictures/downarrow",8,28,40,2,@viewport)
    @sprites["downarrow"].x = (Graphics.width/2)-15
    @sprites["downarrow"].y = 10
    @sprites["downarrow"].z = 5
    @sprites["downarrow"].play
    @sprites["wheel"] = Sprite.new(@viewport)
    @sprites["wheel"].bitmap = Bitmap.new("Graphics/Pictures/#{@wheel}")
    @sprites["wheel"].center_origins
    @sprites["wheel"].x=Graphics.width/2
    @sprites["wheel"].y=Graphics.height/2
    for i in 0...10
      raise _INTL("Not enough prizes.") if !@prizes[i]
      display = @prizes[i]
      display = @prizes[i][0] if @prizes[i].is_a?(Array)
      if display.is_a?(Symbol) && !GameData::Item.try_get(display) &&
                                  !GameData::Species.try_get(display)
        raise _INTL("#{display} is not an item or species.")
      end
      if display.is_a?(Integer)
        @sprites["prize#{i}"] = Sprite.new(@viewport)
        if @prizecoins == true
          @sprites["prize#{i}"].bitmap = Bitmap.new("Graphics/Items/COINCASE")
        else
          @sprites["prize#{i}"].bitmap = Bitmap.new("Graphics/Pictures/Money")
        end
        @sprites["prize#{i}"].center_origins
      elsif display.is_a?(String)
        @sprites["prize#{i}"] = Sprite.new(@viewport)
        @sprites["prize#{i}"].bitmap = Bitmap.new("Graphics/#{display}")
        @sprites["prize#{i}"].center_origins
      elsif GameData::Item.try_get(display)
        @sprites["prize#{i}"]=ItemIconSprite.new(0,0,nil,@viewport)
        @sprites["prize#{i}"].item = display
        @sprites["prize#{i}"].ox=24
        @sprites["prize#{i}"].oy=24
      elsif GameData::Species.try_get(display)
        @sprites["prize#{i}"]=PokemonSpeciesIconSprite.new(display,@viewport)
        @sprites["prize#{i}"].shiny = false
        @sprites["prize#{i}"].ox=32
        @sprites["prize#{i}"].oy=32
      end
      @sprites["prize#{i}"].angle = @angle[i]
      @sprites["prize#{i}"].x=(Graphics.width/2) + Math.cos(@xyangle[i].degrees)*@radius
      @sprites["prize#{i}"].y=(Graphics.height/2) + Math.sin(@xyangle[i].degrees)*@radius
    end
    main
  end

  def main
    loop do
      Graphics.update
      Input.update
      pbUpdate
      if Input.trigger?(Input::C)
        confirmtext="Spin the wheel?"
        confirmtext="Spin the wheel for $#{@cost}?" if @cost > 0
        confirmtext="Spin the wheel for #{@cost} coins?" if @costcoins == true
        if pbConfirmMessage("#{confirmtext}")
            if @costcoins == true && $player.coins<=@cost
               pbMessage(_INTL("You don't have enough coins..."))
                break
            elsif @costcoins == false && $player.money<=@cost
                pbMessage(_INTL("You don't have enough money..."))
                break
            end
          $player.coins-=@cost if @costcoins == true
          $player.money-=@cost if @costcoins == false
          spins=rand(360)
          spins+=360*(@minspins)
          spun=0
          click=true
          loop do
            pbUpdate
            @sprites["wheel"].angle -= 5
            @prizespin+=5
            for i in 0...10
              @sprites["prize#{i}"].angle -= 5
              @sprites["prize#{i}"].x= (Graphics.width/2) + Math.cos((@xyangle[i]+@prizespin).degrees)*@radius
              @sprites["prize#{i}"].y= (Graphics.height/2) + Math.sin((@xyangle[i]+@prizespin).degrees)*@radius
            end
            spun+=5
            Graphics.update
            if click==true
              pbSEPlay(@spinsfx[0],@spinsfx[1],@spinsfx[2])
              click=false
            else
              click=true
            end
            if spun >= spins
              prize = 0
              prizey = []
              for i in 0...10
                prizey[i] = @sprites["prize#{i}"].y
              end
              winner = prizey.min
              for i in 0...10
                if @sprites["prize#{i}"].y == winner
                  prize = i
                end
              end
              prize = @prizes[prize]
              pbSEPlay(@winsfx[0], @winsfx[1], @winsfx[2])
              if prize.is_a?(Integer)
                if @prizecoins == true
                  pbMessage("You won #{prize} coins!")
                  $player.coins += prize
                else
                  pbMessage("You won $#{prize}!")
                  $player.money += prize
                end
              elsif prize.is_a?(Array)
                prize_item = prize[0]
                prize_quantity = prize[1] || 1
                pbReceiveItem(prize_item, prize_quantity)
                pbMessage(_INTL("You received {1}x {2}!", prize_quantity, GameData::Item.get(prize_item).name))
              end
              pbUpdate
              @spun = true if @respin == false
              break
            end
          end
        end
      end
      if Input.trigger?(Input::B) || @spun == true
        break
      end
    end
    pbFadeOutAndHide(@sprites) {pbUpdate}
    dispose
  end

  def dispose
    pbDisposeSpriteHash(@sprites)
    @viewport.dispose
  end
end


Array should now look like this:
Expand Collapse Copy
  Wheel = {
    :background => "hatchbg",
    :wheel      => "prizewheel",
    :radius     => -110,
    :minspins   => 3,
    :respin     => false,
    :cost       => 10,
    :costcoins  => true,
    :prizecoins => false,
    :spinsfx    => ["battle ball shake",80,150],
    :winsfx     => ["mining reveal full",100,100],
    :level      => 20,
    :prizes     => [
      [:GREATBALL, 5],
      [:NETBALL, 4],
      [:FRIENDBALL, 3],
      [:NESTBALL, 2],
      [:ULTRABALL, 1],
      [:LEVELBALL, 6],
      [:FASTBALL, 3],
      [:POKEBALL, 4],
      [:HEALBALL, 5],
      [:MASTERBALL, 1]
      ]
}
 
I get this error when calling the script, what could I do?
View attachment 24111
TechSkylander already said it best, but I thought I'd clarify anyway.

I would highly recommend updating your game to one of the newest updates. Since you're 5 updates behind, there's gonna be a lot of things to update, and it will 100% take a while (I say as someone who recently went from v17.1 to v21.1), but v21.1 is much better, easier to work with, and you're guaranteed that any and all scripts should be usable with your game.

Yes, it's gonna take a hot while to update because if you've added a bunch of things to your game, you will need to move those over manually to the new version, and a lot of things look and work entirely different now, making things a tad bit more confusing - like the entire way Pokémon, moves, abilities, and items are written in the .txt-files are completely different, among other things - but it's gonna be more worth it in the end.
 
Hello, your plugin is amazing. I would like to know if it can be used normally in ess21.1?
 
hey for your earlier versions (18.1-2 maybe all but that for sure)
you can update your prize wheel code with this script to get the money to show the ammount as well as the weird money image

its near line 69 find this spot

Ruby:
Expand Collapse Copy
@sprites["prize#{i}"] = Sprite.new(@viewport)
if @prizecoins == true
  @sprites["prize#{i}"].bitmap = Bitmap.new("Graphics/Items/COINCASE")
else
  @sprites["prize#{i}"].bitmap = Bitmap.new("Graphics/Pictures/Money")
end
@sprites["prize#{i}"].center_origins

change it to this

Code:
Expand Collapse Copy
@sprites["prize#{i}"] = Sprite.new(@viewport)
bitmap = Bitmap.new(64, 64)

if @prizecoins == true
  icon = RPG::Cache.load_bitmap("Graphics/Items/", "COINCASE")
  label = "#{@prizes[i]}C"
else
  icon = RPG::Cache.load_bitmap("Graphics/Pictures/", "Money")
  label = "$#{@prizes[i]}"
end

bitmap.blt(0, 0, icon, Rect.new(0, 0, 64, 64))

bitmap.font.size = 20
bitmap.font.color = Color.new(255, 255, 255)
bitmap.draw_text(0, 40, 64, 24, label, 1)

@sprites["prize#{i}"].bitmap = bitmap
@sprites["prize#{i}"].center_origins

you can edit the size and fonts ect but there you go -InTheLight
 
Last edited:
Not sure if this has already been implemented, but I think this plugin would be amazing with the sound of the spinning wheel on the Price is Right (RIP Bob Barker)
 
Back
Top