RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[VX] Advance Scroll System Error

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 75
RMRK Junior
Hi folks,
I use the script "Advance scroll system" and get an error (picture below) every time when I
try a command (e.g. scroll(RIGHT, 50, 7)) in Parallel Process or Autorun.
In Action Button, for example, it works fine.
The error appears in new projects with no scripts, too.


Game_Interpreter is an original VX-script, but I think you know this already :).

Code: [Select]
#===============================================================
# ? [VX] ? Advance Scroll System ? ?
# * Scroll with speed like 2.5 or 1.6, and/or in diagonal direction~ *
#--------------------------------------------------------------
# ? by Woratana [woratana@hotmail.com]
# ? Thaiware RPG Maker Community
# ? Released on: 25/05/2008
# ? Version: 1.0
#--------------------------------------------------------------

#==================================================================
# ** HOW TO USE **
#-----------------------------------------------------------------
# To start scroll, call script:
#  scroll(direction, distance, speed)
#
# * direction: Scroll direction
# ** You can use these words for direction:
# ** DOWNLEFT, DOWN, DOWNRIGHT, LEFT, RIGHT, UPLEFT, UP, UPRIGHT
#
# * distance: Scroll Distance (1 for 1 tile)
#
# * speed: Scroll Speed, it can be any positive number (3, 2.3, 4.5, ...)
#
# For example:
#  scroll(UPLEFT, 10, 2.5)
# will scroll in UP-LEFT diretion for 10 tiles, with speed 2.5
#==================================================================

class Game_Map
  def update_scroll
if @scroll_rest > 0 # If scrolling
  distance = 2 ** @scroll_speed # Convert to distance
  case @scroll_direction
  when 1  # Down-Left
scroll_down(distance)
scroll_left(distance)
  when 2  # Down
scroll_down(distance)
  when 3  # Down-Right
scroll_down(distance)
scroll_right(distance)
  when 4  # Left
scroll_left(distance)
  when 6  # Right
scroll_right(distance)
  when 7  # Up-Left
scroll_up(distance)
scroll_left(distance)
  when 8  # Up
scroll_up(distance)
  when 9 # Up-Right
scroll_up(distance)
scroll_right(distance)
  end
  @scroll_rest -= distance   # Subtract scrolled distance
end
  end
end

class Game_Interpreter
  DOWNLEFT = 1
  DOWN = 2
  DOWNRIGHT = 3
  LEFT = 2
  RIGHT = 6
  UPLEFT = 7
  UP = 8
  UPRIGHT = 9
 
  def scroll(direction, distance, speed)
@params[0], @params[1], @params[2] = direction, distance, speed.to_f
command_204
  end
end

I'm happy about every help! ;D
« Last Edit: July 03, 2011, 08:54:07 AM by Lysop »

*
Rep:
Level 82
GIAW 14: 1st Place (Easy Mode)2013 Project of the Year2013 Best RPG Maker User (Programming)2013 Most Promising ProjectParticipant - GIAW 11Bronze - GIAW 10
Line 1676 through 1689 of the Game_Interpreter code is dealing with parsing of scripts within an event. I can't seem to recreate the error, everything works fine for me. Perhaps copy and paste lines 1676 through 1689 of command_355 in the Game_Interpreter? It might have somehow gotten changed, that's about all I can think of.

UPDATED 05-29-14


IS YOUR PROJECT OPTIMIZED?
UPDATED 07/04/15 - v2.5

RPG MAKER TOOLBOX
UPDATED 07/04/15 - v1.5

**
Rep: +0/-0Level 75
RMRK Junior
With command_355 is everything ok.
I think the problem is when the parallel process reaches the end of the event page.

If you make an event like this (parallel process):

scroll(UPLEFT, 10, 8)
wait: 200

The error appears in my case when 200 frames are over.

*
Rep:
Level 82
GIAW 14: 1st Place (Easy Mode)2013 Project of the Year2013 Best RPG Maker User (Programming)2013 Most Promising ProjectParticipant - GIAW 11Bronze - GIAW 10
Perhaps you could upload a project to this thread that you are having the error in? I still can't reproduce the error.

UPDATED 05-29-14


IS YOUR PROJECT OPTIMIZED?
UPDATED 07/04/15 - v2.5

RPG MAKER TOOLBOX
UPDATED 07/04/15 - v1.5

**
Rep: +0/-0Level 75
RMRK Junior
http://www.2shared.com/file/zDvs1Ra9/Project1.html

It would be really curious if it works when you use it. :-\

*
Rep:
Level 82
GIAW 14: 1st Place (Easy Mode)2013 Project of the Year2013 Best RPG Maker User (Programming)2013 Most Promising ProjectParticipant - GIAW 11Bronze - GIAW 10
Ok, I'm getting the error now. It looks like when the code within the event is getting eval'd, the returned values are over-writing the script for some reason. I could mess around with it more, but I think it would be better if you just used this script instead of that other one. They do exactly the same thing and this script won't cause any errors  :

Code: [Select]
#==============================================================================
# Scroll
#==============================================================================
# Author  : OriginalWij
# Version : 1.0
#==============================================================================

#==============================================================================
# To use:
#   call: $game_map.start_scroll(direction, distance, speed)
#     direction: 7 = up-left,   8 = up,   9 = up-right
#                4 = left                 6 = right
#                1 = down-left, 2 = down, 3 = down-right
#     distance:  distance to scroll (in tiles)
#     speed:     speed to scroll (can exceed default limit & can be a decimal)
#==============================================================================

#==============================================================================
# What this does:
#   allows diagonal map scrolling and decimal scrolling speeds
#==============================================================================

#==============================================================================
# Game_Map
#==============================================================================

class Game_Map
  #--------------------------------------------------------------------------
  # Update Scroll                                                       [Mod]
  #--------------------------------------------------------------------------
  alias ow_scroll_game_map_update_scroll update_scroll unless $@
  def update_scroll
    ow_scroll_game_map_update_scroll
    if @scroll_rest > 0
      distance = 2 ** @scroll_speed
      case @scroll_direction
      when 1 # Down-Left
        scroll_down(distance)
        scroll_left(distance)
      when 3 # Down-Right
        scroll_down(distance)
        scroll_right(distance)
      when 7 # Up-Left
        scroll_up(distance)
        scroll_left(distance)
      when 9 # Up-Right
        scroll_up(distance)
        scroll_right(distance)
      end
    end
  end
end

UPDATED 05-29-14


IS YOUR PROJECT OPTIMIZED?
UPDATED 07/04/15 - v2.5

RPG MAKER TOOLBOX
UPDATED 07/04/15 - v1.5

**
Rep: +0/-0Level 75
RMRK Junior
Oh ok! This script works perfectly! :D
Thank you for your fantastic help. I'm happy with this new script!
It implements that what I want, thanks! ;D

(why didn't I located it?)