Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: Kise on October 17, 2017, 03:05:21 pm

Title: Compatibility fix and question.
Post by: Kise on October 17, 2017, 03:05:21 pm
Hello. I have a problem with script for mouse control and little visual improving script, that makes the cursor scroll smoothly. The problem is, that cursor doesn't follow the mouse with this script. Here's demo - https://ufile.io/u2g13

And the question - is it be possible to create a script that would generate smooth outline around an object? ( as an addon for Mousie )
Title: Re: Compatibility fix and question.
Post by: KK20 on October 17, 2017, 03:45:31 pm
You needed to set the variable that allowed the window cursor to slide to its destination in X frames.

  #--------------------------------------------------------------------------
  # * Track the position of the mouse cursor
  #--------------------------------------------------------------------------
  def mouse_cursor(index)
    return if @index == index
    @scroll_wait -= 1 if @scroll_wait > 0
    row1 = @index / @column_max
    row2 = index / @column_max
    bottom = self.top_row + (self.page_row_max - 1)
    if row1 == self.top_row and row2 < self.top_row
      return if @scroll_wait > 0
      @index = [@index - @column_max, 0].max
      @cursor_duration = [7 - @cursor_speed, 1].max
      @scroll_wait = 4
    elsif row1 == bottom and row2 > bottom
      return if @scroll_wait > 0
      @index = [@index + @column_max, @item_max - 1].min
      @cursor_duration = [7 - @cursor_speed, 1].max
      @scroll_wait = 4
    else
      @index = index
      @cursor_duration = [7 - @cursor_speed, 1].max
    end
    $game_system.se_play($data_system.cursor_se)
  end


Not sure about the other question. I feel like I've seen it somewhere before.
EDIT: Thinking about it, it would probably be too much effort to be worth it. You would need to generate a new charset graphic every time then alter the Sprite_Character class to somehow draw another sprite and layer the two together. Because using Bitmap#blt multiple times could get slow, a DLL would be recommended. So it's already a lot of work just for one little thing.

I say just use Sprite#flash or RPG::Sprite#blink_on/_off and be done with it.
Title: Re: Compatibility fix and question.
Post by: Kise on October 17, 2017, 05:50:22 pm
Thank you kindly. :)