VX ACE RASTER SCROLL EFFECT

Posts

Pages: 1
Hey, I saw in the VX Ace help file something about a raster scroll effect, possible with scripting. Provided were the strings:

wave_amp
wave_length
wave_speed
wave_phase

...But I have no idea what to do with them. They were in the "Sprite" section, so I would surmise that you'd use them like "Sprite.wave_amp" etc., but what comes next? I tried adding "= 100" or something like that, and nothing happened. I'm sure some kind of equation or formula is required.

Any help?
Craze
why would i heal when i could equip a morningstar
15170
This is what I use for the backgrounds in Promised Abyss:

(http://www.youtube.com/watch?v=gv2k3Gsu3bE)

Within Spriteset_Battle:

def create_battleback1
    @back1_sprite = Sprite.new(@viewport1)
    @back1_sprite.bitmap = battleback1_bitmap
    @back1_sprite.z = 0
    @back1_sprite.zoom_x = 1.3
    @back1_sprite.wave_amp = 2
    @back1_sprite.wave_length = 64
    @back1_sprite.wave_speed = 320
    center_sprite(@back1_sprite)
  end

def create_battleback2
    @back2_sprite = Sprite.new(@viewport1)
    @back2_sprite.bitmap = battleback2_bitmap
    @back2_sprite.z = 1
    @back2_sprite.zoom_x = 1.3
    unless $game_player.region_id > 0
      @back2_sprite.wave_amp = 4
      @back2_sprite.wave_length = 128
      @back2_sprite.wave_speed = 240
    end
    center_sprite(@back2_sprite)
  end

(The region thing is so that I don't have wiggling dungeon walls in certain areas.)


EDIT: OH RIGHT SUPER-IMPORTANT

Make sure the sprite (@back1_sprite, for example is a Sprite) is updated! Double-check the update method in Spriteset_Battle and then makes sure this method in Scene_Battle has the obvious line:

def update_basic
    super
    $game_timer.update
    $game_troop.update
    @spriteset.update
    update_info_viewport
    update_message_open
  end
I assume those values are expressed in pixels? As in, an amplitude of 4 will wiggle 4 pixels above and below its equilibrium point? It looks close to that in the video, at least. Also, I am unsure of what speed is.
Craze
why would i heal when i could equip a morningstar
15170
Defines the amplitude, frequency, speed, and phase of the wave effect. A raster scroll effect is achieved by using a sinusoidal function to draw the sprite with each line's horizontal position slightly different from the last.

wave_amp is the wave amplitude and wave_length is the wave frequency, and each is specified by a number of pixels.

wave_speed specifies the speed of the wave animation. The default is 360, and the larger the value, the faster the effect.

wave_phase specifies the phase of the top line of the sprite using an angle of up to 360 degrees. This is updated each time the update method is called. It is not necessary to use this property unless it is required for two sprites to have their wave effects synchronized.


So, basically, frequency is how often a new wave occurs, and speed is how quickly a wave reaches its max amplitude.
Thanks, Craze, I'll have to mess with the stuff you provided.
Pages: 1