Scroll Map Lock

Hello everyone!

In my game, the map scrolls away from the player, directing attention towards an evil guy.

That person riles the player up, and the player lunges forward in an attempt to attack the evil guy. Unfortunately, the evil guy hits the player back... Bringing the map with them.

See, I want the map to stay locked onto the evil guy. If the player moves, I don't want the map to move with them.

Is there a way to lock the screen onto the evil character and keep it there, even if the player moves? Please tell me ^-^
Hello! Yes! Here it is. <— Link deactivated. Apparently the ravages of time have made it spooky.
Hello! Yes! —-
You're a life saver! I actually already use a bunch of your scripts already, I can't believed I missed this one (^-^; ) Thanks a lot!

Just a question. How do I disable the smooth scrolling camera? I know that's the whole point of the script, but I only need it for the lock screen part and some other features. Just not the smooth camera that follows your character ^-^

I understand you can use a script call, but I'd like for it to not be there at all ^-^
You're welcome!

Search for the following in Enhanced Camera: 

DECELERATION_VALUE = 38Change 38 to 1. That should remove the deceleration effect. 🙂
You're welcome!

Search for the following in Enhanced Camera: 

DECELERATION_VALUE = 38Change 38 to 1. That should remove the deceleration effect. 🙂
The camera is slightly to the right, rather than being centered on the player ;_;
That's weird, what is the window size of your project? 544x416 (default)?
That's weird, what is the window size of your project? 544x416 (default)?
640,480!
You could also just hide the player and use an event to represent the PC. Then the player doesn't actually move, so your scroll map will behave as you tell it. No script needed 😉
You could also just hide the player and use an event to represent the PC. Then the player doesn't actually move, so your scroll map will behave as you tell it. No script needed 😉
That means rewriting the whole cutscene, which i don't have time for >.<

I've done that a lot in my game already, but I'd rather lock the screen somehow ^-^
I just checked Enhanced Camera's demo using 640x480 and a deceleration value of 1 and it works fine: 9.5 tiles to the left and 9.5 to the right of the player's tile. It's centered. Have you used any of Enhanced Camera's commands? Maybe something got messed up.

If you would like, you could send me a demo via PM and I'll take a look into it.
I just checked Enhanced Camera's demo using 640x480 and a deceleration value of 1 and it works fine: 9.5 tiles to the left and 9.5 to the right of the player's tile. It's centered. Have you used any of Enhanced Camera's commands? Maybe something got messed up.

If you would like, you could send me a demo via PM and I'll take a look into it.
Ah! The screen size is actually 1920x1080 lol

Thanks to Zane - Full Screen script.

Unfortunately I can't find where his script is anywhere, so I'll post it here (Sorry, Zane! D: )

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

# ** Zane - Full Screen

#   Version 2.0.0

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

# * Release History:

#  - 1.0.0 Wrote Script

#  - 2.0.0 Re-Written and now more efficient

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

# * Features:

#  - Will take your game and stretch it to your computers native resolution

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

# * How to Use:

#  Paste below materials but above main. Press F5 to use new screen effect.

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

# * License:

#  - Do not distribute this work anywhere.

# If you really want to share it, post a link back to the original thread.

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

 

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

# ** Serialize script into Global

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

($imported ||= {}) [:Zane_Full_Screen] = true

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

 

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

# ** VXA Native

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

#  This setting will adjust the window resolution.

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

Graphics.resize_screen(1920, 1080)

 

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

# ** Graphics

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

#  This module defines graphical processing.

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

class << Graphics

 

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

  # * Obtain Win32API Methods

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

  FindWindow       = Win32API.new('user32', 'FindWindow', 'pp', 'l')

  UpdateWindow     = Win32API.new('user32', 'UpdateWindow', 'l', 'l')

  ShowWindow       = Win32API.new('user32', 'ShowWindow', 'll', 'l')

  SetWindowLong    = Win32API.new('user32', 'SetWindowLong', 'lll', 'l')

  SetWindowPos     = Win32API.new('user32', 'SetWindowPos', 'l' * 7, 'l')

  GetSystemMetrics = Win32API.new('user32', 'GetSystemMetrics', 'l', 'l')

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

  # * Public Variable

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

  @@full_screen_checker = false

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

  # * Alias Methods

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

  alias :zane_graphics_update :update if !method_defined?🙂zane_graphics_update)

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

  # * Frame Update

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

  def update(*args, &block)

    zane_graphics_update(*args, &block)

    standard_window if Input.trigger?🙂F5)

  end

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

  # * Determine Full Screen

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

  def screen_check? ; @@full_screen_checker end

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

  # * Determine Standard Window

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

  def standard_window ; screen_check? ? default_window : metrics_window end

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

  # * Metrics Window

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

  def metrics_window

    zane_width = GetSystemMetrics.call(0)

    zane_height = GetSystemMetrics.call(1)

    zane_rgss = FindWindow.call('RGSS Player', 0)

    SetWindowPos.call(zane_rgss, -2, 0, 0, zane_width, zane_height, 0)

    SetWindowLong.call(zane_rgss, -16, 0x14000000)

    @@full_screen_checker = true

    ini_setting("true")

  end

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

  # * Default Window

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

  def default_window

    zane_width = GetSystemMetrics.call(0)

    zane_height = GetSystemMetrics.call(1)

    zane_rgss = FindWindow.call('RGSS Player', 0)

    zane_w = width + GetSystemMetrics.call(5) * 2 + 4

    zane_h = height + GetSystemMetrics.call(6) * 2 + 4 + GetSystemMetrics.call(4)

    cx = (zane_width - zane_w) / 2 ; cy = (zane_height - zane_h) / 2

    SetWindowPos.call(zane_rgss, -2, cx, cy, zane_w, zane_h, 0)

    SetWindowLong.call(zane_rgss, -16, 0x14CA0000)

    @@full_screen_checker = false

    ini_setting("false")

  end

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

  # * .INI Setting

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

  def ini_setting(value)

    text = File.read("Game.ini")

    File.open("Game.ini", 'w+'){|f| f << text.gsub(/Fullscreen=(true|false)/, "Fullscreen=#{value}")}

  end

end

 

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

# ** .INI Settings

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

#  This defines File Setup Properties

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

File.read("Game.ini")[/Fullscreen=(true|false)/i]

Graphics.metrics_window if !$1.nil? and eval($1)

File.open("Game.ini", 'a+') {|file| file.puts "Fullscreen=true" } if $1.nil?

 
 

I believe I modified it when I first got it so the screen would be 1920x1080, so it's probably best I posted it anyway!
Just tried it. It works fine too. The problem you're experiencing is likely an incompatibility with another script.
The problem is from a script, yeah, Zanes Fullscreen script ^-^

The two scripts:

Script.png

What happens when the two scripts are together:

Camera.png

As you can see, the camera is one square too much to the left. RPG Maker's camera usually shows 9 and a half squares to the left and the right when in 640,480, but this shows 10 squares to the left and 9 to the right.

How it should look:

How it should look.png

Look how the camera only goes to 9 and a half blocks on each side. Thats how it should look.

Now, let's test it with just the camera script.

8 squares to the left, 8 squares to the right.

Works great! Hmm... Maybe its the resolution that is the problem...

Time to test a different resolution script! Hmm... Let's just try the good ol' Graphics.resize_screen(640, 480) script that you put below materials and above main.

The command restricts any resolution higher than 640,480 since thats as high as RPG Maker VX Ace can go without the use of a script that allows you to bypass that issue, such as Zane's Full Screen Script.

Nope, still the same outcome.
Your script seems to be incompatable with resolutions higher than the default resolution 🙂

Thanks for all the help though, I'll just have to find another one ^-^
The problem is from a script, yeah, Zanes Fullscreen script ^-^
I already told you I tried it and it works fine. What version are you using? Get the script from here.

Your script seems to be incompatable with resolutions higher than the default resolution 🙂
Uh, no:

Kb5qKE5.png
Even after figuring out that I had the wrong script, it still isn't what I wanted.

Instead of nitpicking at what features I want and don't want, I asked around if anyone knew of a script that had only what I needed.

One of my friends suggested Galv's Cam Control script. It's perfect.

http://galvs-scripts.com/2012/10/20/cam-control/

Enjoy.

Original thread: https://forums.rpgmakerweb.com/threads/scroll-map-lock.41969/