• Hi, Guest!
    Some images might be missing as we move away from using embedded images, sorry for the mess!
    From now on, you'll be required to use a third party to host images. You can learn how to add images here, and if your thread is missing images you can request them here.
    Do not use Discord to host any images you post, these links expire quickly!
Prize Wheels

Resource Prize Wheels N/A

D

Deleted member 9190

Guest
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!
 
D

Deleted member 9190

Guest
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.
 

Zygoat

Mimikyu enjoyer
Member
Joined
Dec 21, 2020
Posts
161
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.
 

Jukes

Cooltrainer
Member
Joined
Jul 15, 2023
Posts
100
Is there any way to allow for multiple items as a prize?
 

Jukes

Cooltrainer
Member
Joined
Jul 15, 2023
Posts
100
To add quantity to prizes:
#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:
  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]
      ]
}
 

xDracolich

Novice
Member
Joined
Jun 2, 2019
Posts
23
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.
 

Thomwell

Novice
Member
Joined
Mar 8, 2024
Posts
24
Hello, your plugin is amazing. I would like to know if it can be used normally in ess21.1?
 
Back
Top