Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

How to make the camera follow a specific evet, not $game_player

How to make the camera follow a specific evet, not $game_player...?
I tried modifiging the 'Game Player < Game Character' , but its not working...

Thanks in advance
 
i teleport the hero to where the event is and put an event where the hero last was and use the graphic of the hero and change the graphic of the hero into the the graphic of the event o.o;;
 
as cheeze said, just replace the hero with an event of the same graphic, turn the player character invisible, and then move the hero with 'set move route' along with the event you want to follow. scroll map works too but not as well. I wish there was a smoother way to follow events.
 
I already made this... i'll try to find where i posted it :)
------------------

I found it...
In Game_Player, replace this:
Code:
   # If character moves down and is positioned lower than the center
   # of the screen
   if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
     # Scroll map down
     $game_map.scroll_down(@real_y - last_real_y)
   end
   # If character moves left and is positioned more let on-screen than
   # center
   if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
     # Scroll map left
     $game_map.scroll_left(last_real_x - @real_x)
   end
   # If character moves right and is positioned more right on-screen than
   # center
   if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
     # Scroll map right
     $game_map.scroll_right(@real_x - last_real_x)
   end
   # If character moves up and is positioned higher than the center
   # of the screen
   if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
     # Scroll map up
     $game_map.scroll_up(last_real_y - @real_y)
   end
with this:
Code:
   if $game_variables[100] == 0
   if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
     $game_map.scroll_down(@real_y - last_real_y)
   end
   if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
     $game_map.scroll_left(last_real_x - @real_x)
   end
   if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
     $game_map.scroll_right(@real_x - last_real_x)
   end
   if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
     $game_map.scroll_up(last_real_y - @real_y)
   end
   end

And add this before Main:
Code:
class Game_Event < Game_Character

 def update
   last_real_x = @real_x
   last_real_y = @real_y
   
   super
   # Automatic event starting determinant
   check_event_trigger_auto
   # If parallel process is valid
   if @interpreter != nil
     # If not running
     unless @interpreter.running?
       # Set up event
       @interpreter.setup(@list, @event.id)
     end
     # Update interpreter
     @interpreter.update
   end
   
   if $game_variables[100] == @id
   
   if @real_y > last_real_y and @real_y - $game_map.display_y > Game_Player::CENTER_Y
     # Scroll map down
     $game_map.scroll_down(@real_y - last_real_y)
   end
   # If character moves left and is positioned more let on-screen than
   # center
   if @real_x < last_real_x and @real_x - $game_map.display_x < Game_Player::CENTER_X
     # Scroll map left
     $game_map.scroll_left(last_real_x - @real_x)
   end
   # If character moves right and is positioned more right on-screen than
   # center
   if @real_x > last_real_x and @real_x - $game_map.display_x > Game_Player::CENTER_X
     # Scroll map right
     $game_map.scroll_right(@real_x - last_real_x)
   end
   # If character moves up and is positioned higher than the center
   # of the screen
   if @real_y < last_real_y and @real_y - $game_map.display_y < Game_Player::CENTER_Y
     # Scroll map up
     $game_map.scroll_up(last_real_y - @real_y)
   end
   end
   
 end
end

Set variable 100 to 0 to follow player, change it to the event id to follow it :)
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top