The RPG Maker Resource Kit

RMRK RPG Maker Creation => Requests => Script Request => Topic started by: Daltonmayes1 on September 29, 2011, 04:17:42 AM

Title: Parallax being the battle back?
Post by: Daltonmayes1 on September 29, 2011, 04:17:42 AM
Well you see, I don't use the Parallax in my RPGVX games. SO maybe, I'm wondering if theres a script (Or if someone could script it) to where when you go into a battle it takes the Parallax of the map for the battleback.

Simple request I'm hoping.
Title: Re: Parallax being the battle back?
Post by: Mushu on September 29, 2011, 04:25:52 AM
There are ways to change the battleback but that would be an easier way if you don't want to use switches.
Title: Re: Parallax being the battle back?
Post by: Daltonmayes1 on September 29, 2011, 04:34:46 AM
Using switches? Is there a post for that way? I didn't see it if so. Only one I could find is the inputting codes into a script (like Map ID>'Background Name') But I can't get it to work right.
Title: Re: Parallax being the battle back?
Post by: pacdiggity on September 29, 2011, 04:48:16 AM
Are you saying that you want a screenshot of the map to serve as the background of the battle scene?
Title: Re: Parallax being the battle back?
Post by: Daltonmayes1 on September 29, 2011, 04:52:05 AM
No, actually I have a script to take a picture of the map and make it the battleback (Currently what I'm using) But I'm talking about that option in Map Properties "Parallax" as in what ever you set it to is the battleback for your battles on the map.
Title: Re: Parallax being the battle back?
Post by: Mushu on September 29, 2011, 04:58:08 AM
Script>Sprites(Spriteset_Battle)>line 49
These are examples, just copy and paste logically and change the name to the names that you have of pics downloaded in Resource Manager>Graphics/System
Don't forget to set switches for them.

Edit: you also have to delete w/e does the weird effects but I forgot where that was xD
  #--------------------------------------------------------------------------
  # * Create Battlefloor Sprite
  #--------------------------------------------------------------------------
  def create_battlefloor
    @battlefloor_sprite = Sprite.new(@viewport1)
    @battlefloor_sprite.bitmap = Cache.system("Forest2")
    @battlefloor_sprite.x = 0
    @battlefloor_sprite.y = 0
    @battlefloor_sprite.z = 1
    @battlefloor_sprite.opacity = 255
    if $game_switches[203] == true
      @battlefloor_sprite = Sprite.new(@viewport1)
      @battlefloor_sprite.bitmap = Cache.system("Forest")
      @battlefloor_sprite.x = 0
      @battlefloor_sprite.y = 0
      @battlefloor_sprite.z = 1
      @battlefloor_sprite.opacity = 255
    end
    if $game_switches[204] == true
      @battlefloor_sprite = Sprite.new(@viewport1)
      @battlefloor_sprite.bitmap = Cache.system("Twirl")
      @battlefloor_sprite.x = 0
      @battlefloor_sprite.y = 0
      @battlefloor_sprite.z = 1
      @battlefloor_sprite.opacity = 255
    end
  end
Title: Re: Parallax being the battle back?
Post by: Daltonmayes1 on September 29, 2011, 05:12:40 AM
Haha, tried to use it but winded up screwing up my game... I'm 95% hopeless when it comes to scripting on my own  :-\
Title: Re: Parallax being the battle back?
Post by: pacdiggity on September 29, 2011, 05:21:35 AM
That's unnecessary.
Insert this at the top of your custom script list.
class Spriteset_Battle
  def create_battleback
    source = Cache.parallax($game_map.parallax_name)
    bitmap = Bitmap.new(640, 480)
    bitmap.stretch_blt(bitmap.rect, source, source.rect)
#~     bitmap.radial_blur(90, 12)
    @battleback_sprite = Sprite.new(@viewport1)
    @battleback_sprite.bitmap = bitmap
    @battleback_sprite.ox = 320
    @battleback_sprite.oy = 240
    @battleback_sprite.x = 272
    @battleback_sprite.y = 176
    @battleback_sprite.wave_amp = 8
    @battleback_sprite.wave_length = 240
    @battleback_sprite.wave_speed = 120
  end
end

I think you'll see what I've done (I think I understand what you wanted).
Title: Re: Parallax being the battle back?
Post by: Daltonmayes1 on September 29, 2011, 05:32:58 AM
YES! You're right on the money! Now to make my custom "Parallaxes"