• 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!
Mining Game Mouse Function

Resource Mining Game Mouse Function 2023-03-30

TechSkylander1518 submitted a new resource:

Mining Game Mouse Function - Lets the player use the mouse like a stylus for the mining minigame.

View attachment 16895
Just what it says on the tin!​

Can be downloaded as a plugin here or added directly to the scripts.
Ruby:
if Input.trigger?(Input::UP) || Input.repeat?(Input::UP)
And replace it with this:
Ruby:
      if System.mouse_in_window
        if Input.mouse_x.between?(0,BOARD_WIDTH*32) && Input.mouse_y.between?(64,64+BOARD_HEIGHT*32) #Mouse is on board
          x = Input.mouse_x/32
          y =...

Read more about this resource...
 

systeromen_

Novice
Member
Joined
Jan 26, 2021
Posts
45
If I had any suggestions, it would be this:


Ruby:
        if Input.trigger?(Input::MOUSERIGHT)
              pbSEPlay("Mining tool change")
              newmode = (@sprites["cursor"].mode + 1) % 2
              @sprites["cursor"].mode = newmode
              @sprites["tool"].src_rect.set(newmode * 68, 0, 68, 100)
              @sprites["tool"].y = 254 - (144 * newmode)
        end

Just adding an option to right click to change the tool in use, I was using it, and I found myself right clicking a lot to try and do so, so at least to me it feels quite natural.
 

Shadow56bomb

Cooltrainer
Member
Joined
Oct 15, 2022
Posts
156
[Pokémon Essentials version 21.1]
[v21.1 Hotfixes 1.0.2]

Script error in event 4 (coords 21,12), map 50 (Route 7)
Exception: NoMethodError
Message: undefined method `mouse_in_window' for System:Module

***Full script:
pbMiningGame

Backtrace:
[Mining Game Mouse] Mining Game Mouse.rb:41:in `block in pbMain'
[Mining Game Mouse] Mining Game Mouse.rb:5:in `loop'
[Mining Game Mouse] Mining Game Mouse.rb:5:in `pbMain'
Minigame_Mining:631:in `pbStartScreen'
Minigame_Mining:643:in `block in pbMiningGame'
MessageConfig:575:in `pbFadeOutIn'
Minigame_Mining:640:in `pbMiningGame'
(eval):1:in `execute_script'
Interpreter:138:in `eval'
Interpreter:138:in `execute_script'
 
Back
Top