[RMVX ACE] HELP MOVING PICTURES AND "SCROLL WITH MAP" FUNCTION.

Posts

Pages: 1
I'm new to RPG Maker VX Ace, I'm starting to understand how scripting works, but I'm not yet familiar with all the different possible 'calls'. I'm currently experimenting with building an action game using Khan's Pixel Movement Script, and Cidiomar Collision Detection. While most of the features are coming along pretty well, I've run into a issue using a picture as an arrow to attack enemies. Rm2k3 featured a simple checkbox which made a picture "scroll with the map", it appears to be absent in VX Ace. While there are a couple solutions out there for people who want to fix a static image to the map, I'm trying to have the arrow fly out from the player and move across the game world. The issue appears while the screen scrolls for maps larger than 17 x 13, the picture's movement fails to compensate for player's movement around a map, and the result is an aesthetic blunder.


Here you can see the problem at work. The arrow follows the player up into the bridge when it should be 3 tiles below.


Here you can see the little bit of progress I made, the picture scrolls with the map, but fails to sync with the player's coordinates.

Below is my attempt at modifying the script used for fixing static images to the map.

#==============================================================================
# Fixed Pictures
#==============================================================================
# Author : Seer UK & OriginalWij
# Version : 1.2
#
# Credit: Seer UK
# OriginalWij (Original RGSS2 Script)
#==============================================================================

#==============================================================================
# To use:
# put the tag in the affected picture's filename
#==============================================================================

#==============================================================================
# What this does:
# fixes tagged pictures to the map (scrolls with the map)
#==============================================================================

#==============================================================================
# Sprite_Picture
#==============================================================================

class Sprite_Picture < Sprite
#----------------------------------------------------------------------------
# Update
#----------------------------------------------------------------------------
def update
update_bitmap
update_origin

if @picture.name.include?("")
self.x = 0 - $game_map.display_x * 32
self.y = 0 - $game_map.display_y * 32

else
update_position
end


if @picture.name.include?("arrow1") #attempt to solve problem

$game_variables = $game_map.display_x
$game_variables = $game_map.display_y
self.x = @picture.x - ($game_map.display_x * 32)
self.y = @picture.y - ($game_map.display_y * 32)
$game_variables = @picture.x
$game_variables = @picture.y
end

if @picture.name.include?("arrow2") #attempt to solve problem
$game_variables = self.x
$game_variables = self.y
$game_variables = $game_map.display_x
$game_variables = $game_map.display_y
$game_variables *= 32
$game_variables *= 32
$game_variables -= $game_variables
$game_variables -= $game_variables
self.x += $game_variables
self.y += $game_variables


end
update_zoom
update_other
end
end
SunflowerGames
The most beautiful user on RMN!
13323

Try the FA interactive system instead. I'm not sure it will work.

https://falcaorgss.wordpress.com/2012/09/17/falcao-interactive-system-2-0/

That has some cool stuff in it, and some awesome scripts to pull ideas from, but I didn't see anything that would help this specific issue.

However I did get a little closer with this.

if @picture.name.include?("arrow")
$game_variables = $game_map.display_x #probe value of display_x
$game_variables = $game_map.display_y #probe value of display_y
if ($game_map.display_x > 0) && ($game_map.display_x < 11)
self.x = @picture.x + ($game_map.events.screen_x) - ($game_player.screen_x)
end
if if ($game_map.display_y > 0) && ($game_map.display_y < 9)
self.y = @picture.y + ($game_map.events.screen_y) - ($game_player.screen_y)
end


It uses an event as a reference and modifies the picture's xy relative to the player's distance from the arrow's initial starting point. It still causes some wonky little issues at the points where the map will begin to scroll, the image will jerky around. I feel like there has to be an easier and more effective way.
Pages: 1