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.
Script Scroll camera on map! v 1.5

0 Members and 2 Guests are viewing this topic.

**
Rep:
Level 83
Hi

Here a script that allow you to scroll the game camera wherever you like just by pressing the directional arrows

Features

- By pressing "A" (by defaut) call the camera
- allow you move the camera wherever you like
- work like a minimap script also.
- You can see the arrows icon on map with zoom
- Easy to use

Instructios

Copy and paste the script to your project, YEAH! very esasy i think.


Compatibility

This script work perfectly with others scripts system like XAS HERO
Compatibility thank to the alias method


Credits

By Falcao


Script

Code: [Select]
#==================================================================#
#==================================================================#
#  #*****************#        Scroll camera v1.5 Falcao script     #
#  #*** By Falcao ***#        allow you move the game camera       #        
#  #*****************#        with the directional keys            #
#         RMXP                                                     #
# makerpalace.onlinegoo.com         V 1.5                          #
#==================================================================#

module Camara

# Button to run the script (Key "A" of the keyboard)
Button = Input::X  

# Speed of the camera (set 1 until 10)
Speed = 5

#Switch to disable or enable the script (on, off)
CamaraDisable = 50

end

$xrxs = {} if $xrxs == nil
  
class Game_System
  attr_accessor :camara
  alias falcaoscroll_initialize initialize
  def initialize
    falcaoscroll_initialize
    @camara = false
  end
end

class Active_Arrow
  def initialize
    @arrow_up = Sprite.new
    @arrow_up.bitmap = RPG::Cache.icon("047-Skill04")
    @arrow_up.x = 325
    @arrow_up.y = 40
    @arrow_up.z = 200
    @arrow_up.angle = 180
    @arrow_up.visible = false
    
    @arrow_left = Sprite.new
    @arrow_left.bitmap = RPG::Cache.icon("047-Skill04")
    @arrow_left.x = 32
    @arrow_left.y = 220
    @arrow_left.z = 200
    @arrow_left.angle = 270
    @arrow_left.visible = false
    
    @arrow_down = Sprite.new
    @arrow_down.bitmap = RPG::Cache.icon("047-Skill04")
    @arrow_down.x = 316
    @arrow_down.y = 446
    @arrow_down.z = 200
    @arrow_down.visible = false
    
    @arrow_right = Sprite.new
    @arrow_right.bitmap = RPG::Cache.icon("047-Skill04")
    @arrow_right.x = 600
    @arrow_right.y = 242
    @arrow_right.z = 200
    @arrow_right.angle = 90
    @arrow_right.visible = false
  end
  def update
     if $game_system.camara == true
     case Input.dir4
     when 2
      @arrow_up.zoom_x = 1;  @arrow_up.zoom_y = 1
      @arrow_left.zoom_x = 1;  @arrow_left.zoom_y = 1
      @arrow_right.zoom_x = 1;  @arrow_right.zoom_y = 1
      @arrow_down.zoom_x = 1.4; @arrow_down.zoom_y = 1.4
     when 4
       @arrow_up.zoom_x = 1;  @arrow_up.zoom_y = 1
      @arrow_right.zoom_x = 1;  @arrow_right.zoom_y = 1
      @arrow_down.zoom_x = 1;  @arrow_down.zoom_y = 1
       @arrow_left.zoom_x = 1.4; @arrow_left.zoom_y = 1.4
     when 6
       @arrow_up.zoom_x = 1;  @arrow_up.zoom_y = 1
      @arrow_left.zoom_x = 1;  @arrow_left.zoom_y = 1
      @arrow_down.zoom_x = 1;  @arrow_down.zoom_y = 1
       @arrow_right.zoom_x = 1.4; @arrow_right.zoom_y = 1.4
     when 8
      @arrow_left.zoom_x = 1;  @arrow_left.zoom_y = 1
      @arrow_right.zoom_x = 1;  @arrow_right.zoom_y = 1
      @arrow_down.zoom_x = 1;  @arrow_down.zoom_y = 1
      @arrow_up.zoom_x = 1.4; @arrow_up.zoom_y = 1.4
    end
    @arrow_up.visible = true
      @arrow_left.visible = true
      @arrow_down.visible = true
      @arrow_right.visible = true
    else
      @arrow_up.visible = false
      @arrow_left.visible = false
      @arrow_down.visible = false
      @arrow_right.visible = false
     end
  end
  def dispose
    @arrow_up.dispose
    @arrow_up.bitmap.dispose
    @arrow_left.dispose
    @arrow_left.bitmap.dispose
    @arrow_down.dispose
    @arrow_down.bitmap.dispose
    @arrow_right.dispose
    @arrow_right.bitmap.dispose
  end
end

class Game_Player < Game_Character
  include Camara
  alias falcaocamara_update update
  def update
    falcaocamara_update
      if Input.trigger?(Button) and @camera_action == nil and
        $game_switches[CamaraDisable] == false
        if $xrxs["xas"] == true
        $game_switches[6] = true
        $game_map.refresh
      end
      @walk_anime = false
      $game_system.camara = true
      @camera_action = 1
    elsif Input.trigger?(Button) and @camera_action == 1 and
      $game_switches[CamaraDisable] == false
      center(x, y)
      if $xrxs["xas"] == true
        $game_switches[6] = false
        $game_map.refresh
      end
      @move_speed = 4
      @walk_anime = true
      $game_system.camara = false
      @camera_action = nil
    end
    if $game_system.camara == true
      @move_speed = -20
    unless $game_temp.message_window_showing
      case Input.dir4
      when 2
        turn_down
        $game_map.start_scroll(2, 1,Speed)
      when 4
        turn_left
        $game_map.start_scroll(4, 1,Speed)
      when 6
        turn_right
        $game_map.start_scroll(6, 1,Speed)
      when 8
        turn_up
        $game_map.start_scroll(8, 1,Speed)
      end
    end  
  end
end
end

class Scene_Map
  alias falcaoscroll_main main
  def main
    @arrow_active = Active_Arrow.new
    falcaoscroll_main
    @arrow_active.dispose
  end
  alias falcaoscroll_update update
  def update
    @arrow_active.update
    falcaoscroll_update
  end
end


« Last Edit: August 28, 2009, 03:43:42 AM by Dark_falcao »

***
Rep:
Level 83
X-PLAT!
*this script works like a charm with XAS and is perfect for those large maze like maps!

@Dark_falcao - thanks for sharing!

*just a thought, it would be sweet to use this with a character animation!

for example... let's say the actor acquires a 'bird' as an item... which enables this script.
you change the actor graphic to one with a bird on his shoulder (custom sprite)
now when you use it, the actor graphic changes (no bird on shoulder)
and there's a character sprite of a flying bird in the middle(when scrolling camera)
to present that the bird is your second pair of eyes. ^,^


~(G//A/\/\|E|F//A((C|E
« Last Edit: September 26, 2009, 06:47:36 AM by gameface101 »

**
Rep:
Level 83
Thanks gameface101

I like your idea, may be i gonna use it in my game jeje ;D

I update the script to  v1.5 it have some new features

- You ca disable or enable the script wherever you want
- I fixed some crappy bugs

Enjoy

**
Rep: +0/-0Level 67
RMRK AzumDude
How can i fix it and if, then please tell me how. How do I fix so my character doesn't walk when I move around the camera?