Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

3 Pages V  < 1 2 3 >  
Closed TopicStart new topic
> Screen Resolution Script v0.4, RGSS2/RPG Maker VX
ccoa
post Jan 30 2008, 05:55 AM
Post #21


Storm Goddess
Group Icon

Group: Revolutionary
Posts: 989
Type: Scripter
RM Skill: Masterful




Thanks. That's going to be a tricky one to fix without VX. It may have to wait until it's released.


__________________________
Go to the top of the page
 
+Quote Post
   
deadlydan
post Jan 30 2008, 04:15 PM
Post #22


Level 5
Group Icon

Group: Member
Posts: 71
Type: Event Designer
RM Skill: Masterful




Well, i have some code i can share if you want, but the problem is, it only works with one resolution, 480x320, here's the script i currently used, basically converted an RMXP script i found.

CODE
module Setup
  RESOLUTION = [Graphics.width.to_f, Graphics.height.to_f]
  def self.x_value
    return RESOLUTION[0] / 544
  end
  
  def self.y_value
    return RESOLUTION[1] / 416
  end
  
  def self.c_value
    return ( ( RESOLUTION[0]  / 544 ) + ( RESOLUTION[1]  /  416 ) ) / 2
  end

  def self.h_value
    return RESOLUTION[0]
  end

  def self.v_value
    return RESOLUTION[1]
  end

  def self.variance
    return ( ( ( RESOLUTION[0] /  544 ) + ( RESOLUTION[1]  /  416 ) ) / 2 ) - 1
  end

end

class Spriteset_Map
  
  alias resolution_initialize initialize
  def initialize
    @viewport1 = Viewport.new ( 0, 0, Setup.h_value, Setup.v_value )
    @viewport2 = Viewport.new ( 0, 0, Setup.h_value, Setup.v_value )
    @viewport3 = Viewport.new ( 0, 0, Setup.h_value, Setup.v_value )
    resolution_initialize
  end
  
end

class Game_Map

  def scroll_down ( distance )
    if loop_vertical?
      @display_y += distance
      @display_y %= @map.height + 3 * ( 256 * Setup.y_value )
      @parallax_y += distance
    else
      last_y = @display_y
      @display_y = [@display_y + distance, (height + 3 - 13)  *  ( 256 * Setup.y_value ) ].min
      @parallax_y += @display_y - last_y
    end
  end

  def scroll_right ( distance )
    if loop_horizontal?
      @display_x += distance
      @display_x %= @map.width + 2 * ( 256 * Setup.h_value )
      @parallax_x += distance
    else
      last_x = @display_x
      @display_x = [@display_x + distance, (width + 2 - 17)  *  ( 256 * Setup.x_value ) ].min
      @parallax_x += @display_x - last_x
    end
  end
  
  def start_scroll ( direction, distance, speed )
    @scroll_direction = direction
    @scroll_rest = distance * ( 256 *  Setup.c_value )
    @scroll_speed = speed
  end
  
end

class Game_Character

  alias resolution_initialize initialize
  def initialize
    resolution_initialize
    @move_speed = 4 + ( Setup.variance * 2 )
  end
  
  def moving?
    return ( @real_x != @x * ( 256 * Setup.x_value ) or @real_y != @y * ( 256 * Setup.y_value ) )  
  end

  def moveto(x, y)
    @x = x % $game_map.width
    @y = y % $game_map.height
    @real_x = @x * ( 256 * Setup.x_value )
    @real_y = @y * ( 256 * Setup.y_value )
    @prelock_direction = 0
    straighten
    update_bush_depth
  end
  
  def screen_x
    return ( $game_map.adjust_x ( @real_x ) + 8007 )  / 8 - 1000 + ( 16  * Setup.x_value )
  end

  def screen_y
    y = ( $game_map.adjust_y ( @real_y ) + 8007 )  / 8 - 1000 + ( 32  * Setup.y_value )
    y -= 4 unless object?
    if @jump_count >= @jump_peak
      n = @jump_count - @jump_peak
    else
      n = @jump_peak - @jump_count
    end
    return y - (@jump_peak * @jump_peak - n * n) / 2
  end
  
  def update_animation
    speed = @move_speed + (dash? ? 1 : 0)
    if @anime_count > 18 - speed * ( 2 - ( Setup.variance * 2 ) )
      if not @step_anime and @stop_count > 0
        @pattern = @original_pattern
      else
        @pattern = (@pattern + 1) % 4
      end
      @anime_count = 0
    end
  end
  
  def update_jump
    @jump_count -= 1
    @real_x = ( @real_x * @jump_count + @x * ( 256  * Setup.x_value ) )  /  ( @jump_count + 1 )
    @real_y = ( @real_y * @jump_count + @y * ( 256 * Setup.y_value) )  /  ( @jump_count + 1 )
    update_bush_depth
  end
  
  def update_move
    distance = 2 ** @move_speed
    distance *= 2 if dash?
    @real_x = [@real_x - distance, @x * ( 256  * Setup.x_value )].max if @x * ( 256  * Setup.x_value ) < @real_x
    @real_x = [@real_x + distance, @x * ( 256  * Setup.x_value )].min if @x * ( 256  * Setup.x_value ) > @real_x
    @real_y = [@real_y - distance, @y * ( 256 * Setup.y_value)].max if @y * ( 256 * Setup.y_value) < @real_y
    @real_y = [@real_y + distance, @y * ( 256 * Setup.y_value)].min if @y * ( 256 * Setup.y_value) > @real_y
    update_bush_depth unless moving?
    if @walk_anime
      @anime_count += 1.5
    elsif @step_anime
      @anime_count += 1
    end
  end
  
end


class Game_Player < Game_Character
  
  CENTER_X = ( ( ( 544 / 2 ) * Setup.x_value ) - 48) * 8
  CENTER_Y = ( ( ( 416  / 2  ) * Setup.y_value ) - 48) * 8
  
  def center ( x, y )
    display_x = x * ( 256  * Setup.x_value ) - CENTER_X
    unless $game_map.loop_horizontal?
      max_x = ( $game_map.width - 17 ) * ( 256  * Setup.x_value )
      display_x = [0, [display_x, max_x].min].max
    end
    display_y = y * ( 256  * Setup.y_value ) - CENTER_Y
    unless $game_map.loop_vertical?
      max_y = ( $game_map.height - 13 ) * ( 256  * Setup.y_value )
      display_y = [0, [display_y, max_y].min].max
    end
    $game_map.set_display_pos ( display_x, display_y )
  end
  
end


The problem code that makes it only one resolution is this:
CODE
  def scroll_down ( distance )
    if loop_vertical?
      @display_y += distance
      @display_y %= @map.height + 3 * ( 256 * Setup.y_value )
      @parallax_y += distance
    else
      last_y = @display_y
      @display_y = [@display_y + distance, (height + 3 - 13)  *  ( 256 * Setup.y_value ) ].min
      @parallax_y += @display_y - last_y
    end
  end

  def scroll_right ( distance )
    if loop_horizontal?
      @display_x += distance
      @display_x %= @map.width + 2 * ( 256 * Setup.h_value )
      @parallax_x += distance
    else
      last_x = @display_x
      @display_x = [@display_x + distance, (width + 2 - 17)  *  ( 256 * Setup.x_value ) ].min
      @parallax_x += @display_x - last_x
    end
  end


I did a quick fix for the resolution i was in, the width + 2 for scrolling right, and height + 3 for scrolling down, the problem is, i tried to calculate a formula for this, but it doesn't seem constant with different resolutions, this script works absolutely fine for 480x320 (GBA res)

Screenshot of it in action:



This post has been edited by deadlydan: Jan 30 2008, 04:18 PM


__________________________
Go to the top of the page
 
+Quote Post
   
Melkor Qc
post Jan 31 2008, 03:38 PM
Post #23


Level 2
Group Icon

Group: Member
Posts: 17
Type: Artist
RM Skill: Masterful




About a week ago, I found a Resolution Script on a french site; I tried it and it really sets VX resolution to 640x480 without any black bars; so yes it's possible.

This post has been edited by Melkor Qc: Jan 31 2008, 03:39 PM


__________________________
~ I am decent
Go to the top of the page
 
+Quote Post
   
Dang_Khoa
post Feb 4 2008, 02:07 AM
Post #24


Level 1
Group Icon

Group: Member
Posts: 7
Type: None
RM Skill: Undisclosed




QUOTE (Melkor Qc @ Feb 1 2008, 05:45 AM) *
About a week ago, I found a Resolution Script on a french site; I tried it and it really sets VX resolution to 640x480 without any black bars; so yes it's possible.


Could you please post it here?
Go to the top of the page
 
+Quote Post
   
ccoa
post Feb 4 2008, 07:09 AM
Post #25


Storm Goddess
Group Icon

Group: Revolutionary
Posts: 989
Type: Scripter
RM Skill: Masterful




...Mine does that. sleep.gif


__________________________
Go to the top of the page
 
+Quote Post
   
Diedrupo
post Feb 4 2008, 10:12 AM
Post #26


Level 10
Group Icon

Group: Revolutionary
Posts: 150
Type: Event Designer
RM Skill: Undisclosed




QUOTE (Melkor Qc @ Jan 31 2008, 04:45 PM) *
About a week ago, I found a Resolution Script on a french site; I tried it and it really sets VX resolution to 640x480 without any black bars; so yes it's possible.


Uh the black bars go away if you set the resolution to 640x480 simply because that's the max resolution of RMVX. You start getting black bars if you make any kind of resolution lower than that. You don't need a special script for it.
Go to the top of the page
 
+Quote Post
   
dragonheartman
post Feb 14 2008, 12:40 PM
Post #27


Level 2
Group Icon

Group: Member
Posts: 26
Type: Scripter
RM Skill: Undisclosed




Wow, very nice script. The fact that RGSS2 allows you to change the screen resolution makes me want to use VX.


__________________________
rm2k3 junkie / developing starless umbra
Go to the top of the page
 
+Quote Post
   
ccoa
post Feb 14 2008, 12:42 PM
Post #28


Storm Goddess
Group Icon

Group: Revolutionary
Posts: 989
Type: Scripter
RM Skill: Masterful




There's a screen resolution script for XP, too. sweat.gif It's just more complicated in RGSS, but that doesn't really matter to the end user, only the scripter.


__________________________
Go to the top of the page
 
+Quote Post
   
Chipnyu
post Feb 19 2008, 12:14 PM
Post #29



Group Icon

Group: Member
Posts: 3
Type: Developer
RM Skill: Advanced




Now I haven't scripted in a while, but when I tried out your script, I got this error:

???? 'scriptname' ? 117 ??? Type Error ????????

undefined superclass 'Scene_Base'

...What is this?
Go to the top of the page
 
+Quote Post
   
ccoa
post Feb 19 2008, 01:08 PM
Post #30


Storm Goddess
Group Icon

Group: Revolutionary
Posts: 989
Type: Scripter
RM Skill: Masterful




Are you trying to use this in XP? sweat.gif


__________________________
Go to the top of the page
 
+Quote Post
   
Yuu
post Feb 25 2008, 08:23 AM
Post #31


Level 1
Group Icon

Group: Member
Posts: 7
Type: Developer
RM Skill: Skilled




i thinks is a nice script but i am a noob =(...where i need put this script?after what?
Go to the top of the page
 
+Quote Post
   
ccoa
post Feb 25 2008, 08:54 AM
Post #32


Storm Goddess
Group Icon

Group: Revolutionary
Posts: 989
Type: Scripter
RM Skill: Masterful




Insert a new section right before the section titled Main. Paste it there.


__________________________
Go to the top of the page
 
+Quote Post
   
Yuu
post Feb 25 2008, 10:43 AM
Post #33


Level 1
Group Icon

Group: Member
Posts: 7
Type: Developer
RM Skill: Skilled




Oh thanks! ^^ and...i have this in my main:
QUOTE
#==============================================================================
# ■ Main
#------------------------------------------------------------------------------
#  各クラスの定義が終わった後、ここから実際の処理が始まります。
#==============================================================================

unless Font.exist?("UmePlus Gothic")
print "UmePlus Gothic フォントが見つかりません。"
exit
end

begin
Graphics.freeze
$scene = Scene_Title.new
$scene.main while $scene != nil
Graphics.transition(30)
rescue Errno::ENOENT
filename = $!.message.sub("No such file or directory - ", "")
print("ファイル #{filename} が見つかりません。")
end


in what part i need put this ?

QUOTE
Graphics.resize_screen(WIDTH, HEIGHT)
Go to the top of the page
 
+Quote Post
   
ERZENGEL
post Feb 25 2008, 10:50 AM
Post #34


Level 8
Group Icon

Group: Revolutionary
Posts: 127
Type: None
RM Skill: Undisclosed




After begin is the best place wink.gif
Go to the top of the page
 
+Quote Post
   
ccoa
post Feb 25 2008, 11:11 AM
Post #35


Storm Goddess
Group Icon

Group: Revolutionary
Posts: 989
Type: Scripter
RM Skill: Masterful




No, no, no, no. Not in Main, above Main. Right click in the editor on Main and select Insert. That will insert a new section in the script editor. Paste this script in that new section.


__________________________
Go to the top of the page
 
+Quote Post
   
Yuu
post Feb 25 2008, 03:49 PM
Post #36


Level 1
Group Icon

Group: Member
Posts: 7
Type: Developer
RM Skill: Skilled




yeah i understand....its ok, works fine thank you =) !!

i have now my fullscreen without any black bars wink.gif

This post has been edited by Yuu: Feb 25 2008, 03:53 PM
Go to the top of the page
 
+Quote Post
   
MISTER BIG T
post Feb 26 2008, 09:48 AM
Post #37


Level 6
Group Icon

Group: Member
Posts: 77
Type: Event Designer
RM Skill: Masterful




Can this make resolution larger, like 1280x1024?


__________________________


Guy: Who's the big girl?
Me: That's not girl! That's me!
Go to the top of the page
 
+Quote Post
   
ccoa
post Feb 26 2008, 10:09 AM
Post #38


Storm Goddess
Group Icon

Group: Revolutionary
Posts: 989
Type: Scripter
RM Skill: Masterful




According to people who have used it, it apparently maxes out at 640x480. I'll look into resolving this once Enterbrain gets off their collective asses and releases VX already.


__________________________
Go to the top of the page
 
+Quote Post
   
Daray
post Feb 27 2008, 05:36 AM
Post #39


Level 1
Group Icon

Group: Member
Posts: 9
Type: Developer
RM Skill: Advanced




First, sorry for my bad english. Location is Germany but i try to handle my description wink.gif . So thx for that script, i love it. The window size is smaller than 640 pixel and it looks better that way. All works fine, but theres one problem with the battle windows (scene). First i tried the rmvx battleback. At 640 pixel the wave is inside this resolution, so i think the reason for the enterbrain 466 pixel resolution is to hide the wave below the black border.
One solution is to set the wave from 8 to 0, result is standing still picture but looks crap.
The second one i tried is the actual map as battleback. Not useful for sideview battle system, in most cases the enemy or your party appear on tiles like wall, trees etc.
Last but not least i will use the rmxp battlebacks, there 50 of them in the rtp and they look okay so far. Problem is the resolution of 640 x 320. I stretched them to 640 x 480 but looks bad also. So i switched back to the height of 320. But then the background of the battle windows is black. Is it possible to make a sniplet of code which can implement a background picture below the battleback with the resolution of 460 x 160 to fill the screen?
Next problem is a bit difficult to describe. In case the windows in the battle scene switched, the target window overlays the status window. At the resolutio of 640 theres now on the right side a transparency effect of about 30 pixel i think, where you can see the mana bar of the status window below shining trough when the target window appears.

I hope i described it right, and yes i know easiest way to handle the background is using a 640 x 480 battleback. But i try using the ones from the rmxp rtp. And i cant find the problem of the tranparency effect between the status and the target window in the battle.

So thx for help and any suggestions od feedback, greetings Daray.


__________________________
Go to the top of the page
 
+Quote Post
   
ccoa
post Feb 27 2008, 06:36 AM
Post #40


Storm Goddess
Group Icon

Group: Revolutionary
Posts: 989
Type: Scripter
RM Skill: Masterful




This is really getting too difficult to troubleshoot blind this way. I'm sorry, but I probably can't help anyone until VX is released. It's just too much of a pain to try to track down bugs in code you can't run.


__________________________
Go to the top of the page
 
+Quote Post
   

3 Pages V  < 1 2 3 >
Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 20th May 2013 - 09:18 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker