Where to paste script

● ARCHIVED · READ-ONLY
Started by Humming 6 posts View original ↗
  1. Sorry for bothering you guys again, but I'm having some trouble with resizing my game.

    I found this script,

       

    Spoiler
    #===============================================================================

    #  *  Resize RMVX  by Leon_Westbrooke  -  v. 1.1

    #-------------------------------------------------------------------------------

    #  This script allows you to resize the game window for your RMVX game.

    #  

    #  Instructions:  Fill out the module's values for WIDTH and HEIGHT.  

    #

    #  Notes:

    #       All other menus will have to be rewritten to fill the screen completely.

    #       You can do this, or search for any scripts that use a larger/smaller

    #       display size.  I will be writing some scripts for 640x480 display; mainly

    #       because I prefer that size.

    #

    #       The max size is 640x480.

    #  

    #  Overwritten Methods:

    #       Game_Player

    #         center(x, y)

    #       Game_Map

    #         setup_scroll

    #         scroll_down(distance)

    #         scroll_right(distance)

    #===============================================================================

     

    #-------------------------------------------------------------------------------

    #  *  RESIZE module

    #-------------------------------------------------------------------------------

    module RESIZE

      #-----------------------------------------------------------------------------

      # Sets width of the window.

      #-----------------------------------------------------------------------------

      WIDTH = 640

      #-----------------------------------------------------------------------------

      # Sets height of the window.

      #-----------------------------------------------------------------------------

      HEIGHT = 480

    end

    #-------------------------------------------------------------------------------

    # END RESIZE module

    #-------------------------------------------------------------------------------

     

     

    #-------------------------------------------------------------------------------

    #  *  Game_Player class

    #-------------------------------------------------------------------------------

    class Game_Player

      #-----------------------------------------------------------------------------

      #  CENTER_X and CENTER_Y are recalculated with a variable instead of integer.

      #-----------------------------------------------------------------------------

      CENTER_X = (RESIZE::WIDTH / 2 - 16) * 8

      CENTER_Y = (RESIZE::HEIGHT / 2 - 16) * 8

     

     

      #--------------------------------------------------------------------------

      # * Set Map Display Position to Center of Screen

      #      x : x-coordinate

      #      y : y-coordinate

      #--------------------------------------------------------------------------

      def center(x, y)

            display_x = x * 256 - CENTER_X                                  # Calculate coordinates

            unless $game_map.loop_horizontal?                                # No loop horizontally?

              max_x = ($game_map.width - (RESIZE::WIDTH / 32)) * 256                        # Calculate max value

              display_x = [0, [display_x, max_x].min].max    # Adjust coordinates

            end

            display_y = y * 256 - CENTER_Y                                  # Calculate coordinates

            unless $game_map.loop_vertical?                            # No loop vertically?

              max_y = ($game_map.height - (RESIZE::HEIGHT / 32)) * 256                 # Calculate max value

              display_y = [0, [display_y, max_y].min].max    # Adjust coordinates

            end

            $game_map.set_display_pos(display_x, display_y)   # Change map location

      end

    end

     

    #-------------------------------------------------------------------------------

    # END Game_Player class

    #-------------------------------------------------------------------------------

    class Game_Map

      def setup_scroll

            @scroll_direction = 2

            @scroll_rest = 0

            @scroll_speed = 4

            @margin_x = (width - (RESIZE::WIDTH / 32)) * 256 / 2      # Screen non-display width /2

            @margin_y = (height - (RESIZE::HEIGHT / 32)) * 256 / 2   # Screen non-display height /2

      end

     

      #--------------------------------------------------------------------------

      # * Scroll Down

      #      distance : scroll distance

      #--------------------------------------------------------------------------

      def scroll_down(distance)

            if loop_vertical?

              @display_y += distance

              @display_y %= @map.height * 256

              @parallax_y += distance

            else

              last_y = @display_y

              @display_y = [@display_y + distance,

              (height - (RESIZE::HEIGHT / 32)) * 256].min

              @parallax_y += @display_y - last_y

            end

      end

      #--------------------------------------------------------------------------

      # * Scroll Right

      #      distance : scroll distance

      #--------------------------------------------------------------------------

      def scroll_right(distance)

            if loop_horizontal?

              @display_x += distance

              @display_x %= @map.width * 256

              @parallax_x += distance

            else

              last_x = @display_x

              @display_x = [@display_x + distance,

              (width - (RESIZE::WIDTH / 32)) * 256].min

              @parallax_x += @display_x - last_x

            end

      end

    end

     

     

    #-------------------------------------------------------------------------------

    #  Resizes game.

    #-------------------------------------------------------------------------------

    Graphics.resize_screen(RESIZE::WIDTH, RESIZE::HEIGHT)

    #-------------------------------------------------------------------------------

    #  END Resize

    #-------------------------------------------------------------------------------

    And tried pasting it into the script editor,

    Spoiler
    Aaaand got this.

    Spoiler

    I have no idea what I'm doing, so I can't pinpoint the problem. Did I paste it into the wrong area? 
  2. You are supposed to paste your script in the Materials section of the  Scripts. (There is an "Insert Here" in that area.)

    Just scroll down the list of scripts and you'll find it.
  3. Yeah, I'm also a newbie at scripts so I don't know if it is all scripts or just most, but you would put them in the "Materials" section, just above "Main". Both of which are at the bottom of that list on the left.

    *EDIT
    Ninja'd... :p
  4. Most scripts begin with an instruction where to place it in the comments at the beginning - for ace that is the place below materials, where it reads "insert here".


    The script you've listed however has an additional problem: it's a script for VX, not for VX Ace - which means that it will fit nowhere in the Ace engine and never work there...


    I suggest going to the master script list for Ace and look for an alternative - Yanfly's core script for example can resize the game.


    If you don't have the link to the master script list, look into the tutorial in my signature, it's linked there.
  5. Thank you all so much! Again, sorry for being such a noob. After seeing how complicated programming actually is, I have so much respect for programmers now. haha
  6. This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.