[RESOLVED][XP] Script Configuration Questions

Started by Andreavnn, April 20, 2012, 07:58:05 pm

Previous topic - Next topic

Andreavnn

April 20, 2012, 07:58:05 pm Last Edit: April 23, 2012, 07:00:10 pm by Andreavnn
Platform: RPG Maker XP

Script Order
Spoiler: ShowHide

MAWS 1.2
Dynamic_Footprints - Wachunga
Dynamic_Shadow - Rataime, Boushy, Genzai Kawakami
Dynamic_Lights - Kellessdee
Dynamic_Reflection - Rataime
Multiple Fogs - Game_Guy
Particle Engine (1) - By Pinkman, Sylver, markusmks
Particle Engine (2)
Particle Engine (3)
Particle Engine (4)
Particle Engine (5)
Particle Engine (6)
TOA (1)
TOA (2)
TOA (3)
BABS (1)
BABS (2)
BABS (3)
Z_HUD
Z_HUD_Plugin - RPGManiac3030
BABS_Battle Music


[Resolved]#1 = I don't want floating damage at all, when heroes and enemies hit each other I don't want the damage displayed on screen. Is there a way to turn it off? = BABS

[Resolved]#2 = When a hero attacks a target they either have to stand still and spam the attack key or move and press the attack key intermittently. I wanted to know if I could make it so you could move and spam the attack key at the same time is that possible, am I missing an option? = BABS

[http://forum.chaos-project.com/index.php/topic,11721.0.html]#3 = I am using Ton-Of-Addons and I have ARROW_ABOVE_PLAYER set to true, however it only works in the top left half of the screen and not anywhere else on the map. = TOA (It was suggested I ask Blizzard for help on this one :shy:)

[Resolved]#4 = I am trying to use a water reflection script and I keep getting an error. "Script 'Water_Reflection' line 187: SyntaxError occurred." = Water_Reflection

#5 I am using a dynamic footprint script, game loads just fine, however, when I press the movement key I get the following error, "Script 'Dynamic Footprints' line 323: ArgumnetError occurred. wrong number of arguments(2 for 0)

Dynamic_Footprints
Spoiler: ShowHide
=begin
============
 Dynamic Footprints - version 1.0 (2005-11-07)
============
 by Wachunga

0.95 - original release
1.0 - fixed a small bug with directional footprints and
      updated the compatibility list
 
SETUP:
1) From the database (Tileset tab), give the appropriate tiles of any
   tilesets that you want to show footprints (e.g. sand in "Desert",
   snow in "Snow Field") the terrain tag 1.
2) Place the footprints file in the Graphics/Tilesets folder.

To prevent an event from having any footprints (e.g. birds), include <nofp>
somewhere in its name.

(If using non-RTP sprites, you may want to create customized footprints.)

FEATURES:
* customizable duration footprint fading (optional)
* direction-specific footprints (optional)
* rounded footprints paths
* overlapping footprints supported
* handles move events (jumping, speed changes, etc) and teleportation

COMPATIBILITY:
1) Cogwheel's Pixel Movement script - unfortunately, pixel movement by its
   very nature isn't very compatible with footprints (short of using sprites
   or pictures instead of a tileset) because a character can move part way
   across a tile without footprints appearing.
   
 2) Near Fantastica's Squad Based Movement/Action Battle System script -
    make sure it is below this script
 
 3) Near Fantastica's Updated Day Night script - again, make sure it is below
    this script
 
 4) Baskinein's Animated Sprite script - see:
    http://www.rmxp.net/forums/index.php?s=&showtopic=27407&view=findpost&p=261921
   
 5) Fukuyama's Caterpillar script - to only have one set of footprints
    for the whole group, no modifications are necessary (just make sure his
    script is above this one). To have a separate (overlapping) set of
    footprints for each character, uncomment (by moving the "= end") the
    following lines:

module Train_Actor
class Game_Party_Actor < Game_Character    
 def move_down(turn_enabled = true)
   if turn_enabled
     turn_down
   end
   if passable?(@x, @y, Input::DOWN)
     turn_down
     @y += 1
     increase_steps
   end
 end
 def move_left(turn_enabled = true)
   if turn_enabled
     turn_left
   end
   if passable?(@x, @y, Input::LEFT)
     turn_left
     @x -= 1
     increase_steps
   end
 end
 def move_right(turn_enabled = true)
   if turn_enabled
     turn_right
   end
   if passable?(@x, @y, Input::RIGHT)
     turn_right
     @x += 1
     increase_steps
   end
 end
 def move_up(turn_enabled = true)
   if turn_enabled
     turn_up
   end
   if passable?(@x, @y, Input::UP)
     turn_up
     @y -= 1
     increase_steps
   end
 end
end
end

=end

#----------------------------------------------------------------------
# Footprints for six situations (down->up, left->right, down->left,
# left->up, up->right and right->down) are required (twelve for
# directional footprints). See the provided footprints template
# (footprints_template.png) for specific details, noting
# that the right half of the template can be empty if using the default
# of non-directional footprints (i.e. leaving FP_DIRECTIONAL = false).
FP_FILE = "footprints_default"
#----------------------------------------------------------------------
# FP_DIRECTIONAL specifies whether there are direction-specific
# footprints (e.g. footprints from player moving up are different
# from those left when player is moving down)
FP_DIRECTIONAL = false
#----------------------------------------------------------------------
# Terrain tag(s) as set in the database
FP_TAG = 1
#----------------------------------------------------------------------
# How much time elapses before footprints begin to fade
FP_BEFORE_FADE_TIME = 100
# After beginning to fade, how long the fading process actually takes
FP_FADE_TIME = 100
# Note: it's possible to maintain footprints indefinitely (with
# FP_FADE_TIME = 0), but if the player opens a menu or changes maps,
# the footprints won't be saved. To allow them to persist even then,
# use Near's Dynamic Maps script (slight modifications would be needed).
#----------------------------------------------------------------------
# tilemap indexes (do not modify)
# regular:
FP_DU = 384
FP_LR = 385
FP_DL = 386
FP_LU = 387
FP_UR = 388
FP_RD = 389
# directional:
FP_UD = 512
FP_RL = 513
FP_DR = 514
FP_RU = 515
FP_UL = 516
FP_LD = 517

#----------------------------------------------------------------------

class Spriteset_Map
attr_accessor :footprints  
attr_accessor :fp_tilemap
def initialize
  @viewport1 = Viewport.new(0, 0, 640, 480)
  @viewport2 = Viewport.new(0, 0, 640, 480)
  @viewport3 = Viewport.new(0, 0, 640, 480)
  @viewport2.z = 200
  @viewport3.z = 5000
  @tilemap = Tilemap.new(@viewport1)
  @tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)
  for i in 0..6
    autotile_name = $game_map.autotile_names[i]
    @tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
  end
  @tilemap.map_data = $game_map.data
  @tilemap.priorities = $game_map.priorities
  @panorama = Plane.new(@viewport1)
  @panorama.z = -1000
  @fog = Plane.new(@viewport1)
  @fog.z = 3000
  @character_sprites = []
  for i in $game_map.events.keys.sort
    sprite = Sprite_Character.new(@viewport1, $game_map.events[i])
    @character_sprites.push(sprite)
  end
  @character_sprites.push(Sprite_Character.new(@viewport1, $game_player))
  @weather = RPG::Weather.new(@viewport1)
  @picture_sprites = []
  for i in 1..50
    @picture_sprites.push(Sprite_Picture.new(@viewport2,
      $game_screen.pictures[i]))
  end
  @timer_sprite = Sprite_Timer.new

  # Dynamic Footprints additions begin
  @footprints = []
  fp_tileset = FP_DIRECTIONAL ? Bitmap.new(256,1024) : Bitmap.new(256,512)
  # make a column for each footprint image
  # right -> down
  fp_tileset.blt(160, 0, RPG::Cache.tileset(FP_FILE), Rect.new(0, 0, 32, 32))
  # up -> right
  fp_tileset.blt(128, 0, RPG::Cache.tileset(FP_FILE), Rect.new(0, 32, 32, 32))  
  # left -> right  
  fp_tileset.blt(32, 0, RPG::Cache.tileset(FP_FILE), Rect.new(0, 64, 32, 32))    
  # down -> left
  fp_tileset.blt(64, 0, RPG::Cache.tileset(FP_FILE), Rect.new(32, 0, 32, 32))
  # left -> up
  fp_tileset.blt(96, 0, RPG::Cache.tileset(FP_FILE), Rect.new(32, 32, 32, 32))  
  # down -> up
  fp_tileset.blt(0, 0, RPG::Cache.tileset(FP_FILE), Rect.new(32, 64, 32, 32))

  # fill out each column, making copies of the image with decreasing opacity
  0.step(5*32, 32) do |x|
    opacity = 255
    0.step(15*32, 32) do |y|
      fp_tileset.blt(x, y, fp_tileset, Rect.new(x, 0, 32, 32), opacity)
      opacity -= 16
    end
  end

  if FP_DIRECTIONAL
    # down -> right
    fp_tileset.blt(160, 512, RPG::Cache.tileset(FP_FILE), Rect.new(64, 0, 32, 32))
    # right -> up
    fp_tileset.blt(128, 512, RPG::Cache.tileset(FP_FILE), Rect.new(64, 32, 32, 32))  
    # right -> left
    fp_tileset.blt(32, 512, RPG::Cache.tileset(FP_FILE), Rect.new(64, 64, 32, 32))    
    # left -> down
    fp_tileset.blt(64, 512, RPG::Cache.tileset(FP_FILE), Rect.new(96, 0, 32, 32))
    # up -> left
    fp_tileset.blt(96, 512, RPG::Cache.tileset(FP_FILE), Rect.new(96, 32, 32, 32))  
    # up -> down
    fp_tileset.blt(0, 512, RPG::Cache.tileset(FP_FILE), Rect.new(96, 64, 32, 32))
   
    0.step(5*32, 32) do |x|
      opacity = 255
      512.step(32*32, 32) do |y|
        fp_tileset.blt(x, y, fp_tileset, Rect.new(x, 512, 32, 32), opacity)
        opacity -= 16
      end
    end  
  end
 
  @fp_tilemap = Tilemap.new(@viewport1)  
  @fp_tilemap.tileset = fp_tileset
  @fp_tilemap.map_data = Table.new($game_map.width, $game_map.height, 3)
  # end Dynamic Footprints additions
 
  update
end

alias fp_dispose dispose
def dispose
  @fp_tilemap.dispose
  fp_dispose
end

alias fp_update update
def update
  @fp_tilemap.ox = $game_map.display_x / 4
  @fp_tilemap.oy = $game_map.display_y / 4
  @fp_tilemap.update
  unless FP_FADE_TIME == 0
    for fp in @footprints
      if fp.time > 1
        fp.time -= 1
        if fp.fade and (FP_FADE_TIME - fp.time) % (FP_FADE_TIME/16.0) < 1
          @fp_tilemap.map_data[fp.x,fp.y,fp.z] += 8
        end
      else
        if not fp.fade
          # begin fading
          fp.time = FP_FADE_TIME
          fp.fade = true
        else        
          @fp_tilemap.map_data[fp.x,fp.y,fp.z] = 0
          @footprints.delete(fp)
        end
      end
    end
  end
  fp_update
end

 def show_footprints(fp_index,fp_x,fp_y)
   # start with first layer, then stack footprints as necessary
   fp_z = 0
   if @fp_tilemap.map_data[fp_x,fp_y,fp_z] == 0
    @fp_tilemap.map_data[fp_x,fp_y,fp_z] = fp_index
   else
    fp_z = 1
    if @fp_tilemap.map_data[fp_x,fp_y,fp_z] == 0
      @fp_tilemap.map_data[fp_x,fp_y,fp_z] = fp_index
    else
      fp_z = 2
      if @fp_tilemap.map_data[fp_x,fp_y,fp_z] != 0
        # delete the existing footprint at these coords from the list
        # (to prevent having multiples)
        for i in @footprints.reverse
          if i.x == fp_x and i.y == fp_y and i.z == fp_z
            @footprints.delete(i)
            break
          end
        end
      end
      @fp_tilemap.map_data[fp_x,fp_y,fp_z] = fp_index
    end
   end
   @footprints.push(Footprint.new(fp_x,fp_y,fp_z))    
 end  

end

#-------------------------------------------------------------------------------

class Game_Event < Game_Character
 alias fp_ge_init initialize
 def initialize(map_id, event)
  fp_ge_init(map_id, event)
  if @event.name.upcase.include?('<NOFP>')
    @fp_id = nil
  end
 end
end

#-------------------------------------------------------------------------------

class Game_Character

alias fp_gc_init initialize
def initialize
  fp_gc_init
  # 1st argument = second last x/y
  # 2nd argument = last x/y
  @last_x = [0,0]
  @last_y = [0,0]
  @fp_id = 0 # default footprints
end

def footprints
  # determine which prints to draw and where
  if terrain_tag(@last_x[1],@last_y[1]) != FP_TAG
    return
  end
  fp_index = nil
  # left
  if @x > @last_x[1]
    if @last_y[1] > @last_y[0]
      fp_index = FP_UR
    elsif @last_y[1] < @last_y[0]
      fp_index = FP_DIRECTIONAL ? FP_DR : FP_RD
    else
      fp_index = FP_LR
    end
  else
    # right
    if @x < @last_x[1]
      if @last_y[1] > @last_y[0]
        fp_index = FP_DIRECTIONAL ? FP_UL : FP_LU
      elsif @last_y[1] < @last_y[0]
        fp_index = FP_DL
      else
        fp_index = FP_DIRECTIONAL ? FP_RL : FP_LR
      end
    else
      # up
      if @y < @last_y[1]
        if @last_x[1] > @last_x[0]
          fp_index = FP_LU
        elsif @last_x[1] < @last_x[0]
          fp_index = FP_DIRECTIONAL ? FP_RU : FP_UR
        else
          fp_index = FP_DU
        end
      # down
      elsif @y > @last_y[1]
        if @last_x[1] > @last_x[0]
          fp_index = FP_DIRECTIONAL ? FP_LD : FP_DL
        elsif @last_x[1] < @last_x[0]
          fp_index = FP_RD
        else
          fp_index = FP_DIRECTIONAL ? FP_UD : FP_DU
        end
      end
    end
  end
  if fp_index != nil
    fp_x = @last_x[1]
    fp_y = @last_y[1]
    $scene.spriteset.show_footprints(fp_index,fp_x,fp_y)
  end
end

 def moveto(x, y)
   @x = x
   @y = y
   @real_x = x * 128
   @real_y = y * 128
   if @fp_id != nil
     # track the last positions
     @last_x = [@x,@x]
     @last_y = [@y,@y]
   end
 end

 def increase_steps
   @stop_count = 0
   # show footprints if enabled for this character
   if @fp_id != nil and $scene.is_a?(Scene_Map)
     footprints
     # track the last positions
     @last_x.shift
     @last_x.push(@x)  
     @last_y.shift
     @last_y.push(@y)  
   end
 end

 def terrain_tag(x=@x,y=@y)
   return $game_map.terrain_tag(x, y)
 end

 def update_jump
   @jump_count -= 1
   @real_x = (@real_x * @jump_count + @x * 128) / (@jump_count + 1)
   @real_y = (@real_y * @jump_count + @y * 128) / (@jump_count + 1)
   if @fp_id != nil and @jump_count == 0
     # track the last positions
     @last_x = [@x,@x]
     @last_y = [@y,@y]      
   end
 end  
 
end

#-------------------------------------------------------------------------------

class Scene_Map
 attr_reader :spriteset

 # only change is a couple of (commented) sections to prevent teleporting
 # within same map from losing footprints when the spriteset is recreated
 def transfer_player
   $game_temp.player_transferring = false
   if $game_map.map_id != $game_temp.player_new_map_id
     $game_map.setup($game_temp.player_new_map_id)
   else # Dynamic Footprints
     fp = @spriteset.footprints
     md = @spriteset.fp_tilemap.map_data
   end
   $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
   case $game_temp.player_new_direction
   when 2
     $game_player.turn_down
   when 4
     $game_player.turn_left
   when 6
     $game_player.turn_right
   when 8
     $game_player.turn_up
   end
   $game_player.straighten
   $game_map.update
   @spriteset.dispose
   @spriteset = Spriteset_Map.new
   if fp != nil or md != nil # Dynamic Footprints
     @spriteset.footprints = fp
     @spriteset.fp_tilemap.map_data = md
   end
   if $game_temp.transition_processing
     $game_temp.transition_processing = false
     Graphics.transition(20)
   end
   $game_map.autoplay
   Graphics.frame_reset
   Input.update
 end
end

#-------------------------------------------------------------------------------

class Footprint
attr_reader :x
attr_reader :y
attr_reader :z
attr_accessor :time
attr_accessor :fade

def initialize(x,y,z)
  @x = x
  @y = y
  @z = z
  @time = FP_BEFORE_FADE_TIME
  @fade = false
end

end


Any help is appreciated  

*EDIT* Add information
**EDIT** Resolved some issues
***EDIT*** Updated scripts being used
****EDIT**** Updated post Scripts being used/new configuration problem. #5
*****EDIT***** Resolved some issues

AJNR95

#1 I have it fixed for you

#2 I believe it has to do with the Charge of the Weapon and/or it's Penalty. I will test it for you

#3 I have never used "Tons-Of-Addons"

#4 Can't help with that
Spoiler: ShowHide


by Blizz: Spoilered, because image is 2.6 MB.
by AJNR95: Unspoilered, because fuck you - ¡Viva la Revolución!
by Blizz: Spoilered again, and Banned.

Andreavnn

 :facepalm:  :^_^': I am going to have to level you up again +1

I think that is two or three now. Thanks for all this help!

ForeverZer0

#4:

In this line:
if (character.is_a?(Game_Event) and character.list!=nil and character.list[0].code == 108 and character.list[0].parameters == ["r])


At the end, there is a missing " after the r in the array.
Make it look like this:

if (character.is_a?(Game_Event) && character.list != nil && character.list[0].code == 108 && character.list[0].parameters == ["r"])

I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Andreavnn

April 21, 2012, 02:11:31 pm #4 Last Edit: April 21, 2012, 02:16:57 pm by Andreavnn
@ForeverZer0: I found and changed the line and I load without errors, however the terrain tag I set to 7, a water autotile doesn't show a reflection.  :???:
Am I setting it up wrong or is my char_set not working with it right. I will keep trying to play with it.


I am using this character_set
Spoiler: ShowHide


*EDIT* That might be the same problem I am having with TOA too.

ForeverZer0

I don't really know, I think the script is junk. I copied-pasted into a project what you have, set some tiles with a terrain tag of 7, and it did nothing. I didn't really look at the script, its a sloppy mess, and I don't waste my time fixing things that the author didn't have the time to format correctly. Nothing personal with you, you didn't write it, its just a pet-peeve of mine.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Vexus

April 22, 2012, 06:30:14 am #6 Last Edit: April 22, 2012, 06:31:47 am by Vexus
I believe this is an edited version by dervvulfman of the same water reflect script:

Spoiler: ShowHide
#==============================================================================
# ** Sprite Reflection
#------------------------------------------------------------------------------
#    Based on Sprite Mirror
#    modified by JmsPlDnl
#    rewritten entirely by Rataime
#    New Edits by DerVVulfman
#    February 12, 2008
#------------------------------------------------------------------------------
#
# Introduction:
#  This system allows you and events to have their image reflected on various
#  tagged surfaces.
#
#------------------------------------------------------------------------------
#
# Revisions to note:
#
#  1) Added formatted headers and comments throughout the script.
#  2) Compatability with Near Fantastica's Squad Movement systems.
#  3) Compatability with Ccoa's Caterpillar system.
#  4) Compatability with Trickster's Caterpillar system.
#  5) Added the REFLECT_TAG value into the configurables
#
#==============================================================================



   #========================================================================
   #  **  C  O  N  F  I  G  U  R  A  T  I  O  N      S  Y  S  T  E  M  **  #
   #========================================================================
    # Caterpillar Systems
    CATERPILLAR_COMPATIBLE      = true    # Toggle for Fukuyama's original 
    SQUAD_MOVE_COMPATIBLE       = false   # Toggle for Near Fantastica's SBABS
    CCOA_CATER_COMPATIBLE       = false   # Toggle for Ccoa's Caterpillar
    TRICKSTER_CATER_COMPATIBLE  = false   # Toggle for Trickster's Caterpillar
   
    # Reflection Specific Systems
    REFLECT_TAG                 = 7       # Terrain tag used by reflective tiles

   
   #========================================================================
   #  ****   E N D   O F   C O N F I G U R A T I O N   S Y S T E M   ****  #
   #========================================================================


#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
#  This class handles the party. It includes information on amount of gold
#  and items. Refer to "$game_party" for the instance of this class.
#==============================================================================

class Game_Party
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader :characters
end


#==============================================================================
# ** Sprite_Reflection
#------------------------------------------------------------------------------
#  This sprite is used to position character reflection relative to map position.
#  It observes the Game_Character class and automatically changes sprite
#  conditions.
#==============================================================================

class Sprite_Reflection < RPG::Sprite
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :character           
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     viewport   : viewport
  #     character  : character (Game_Character)
  #     self_angle : id
  #--------------------------------------------------------------------------
  def initialize(viewport=nil, character=nil, self_angle = 180)
    super(viewport)
    @character    = character
    @self_angle   = self_angle
    self.opacity  = 0
    @reflected    = false
    @former       = false
    @moving       = false
    if $game_map.terrain_tag(@character.real_x / 128,
      @character.real_y / 128 + 1) == REFLECT_TAG
      @reflected  = true
      @former     = true
    end
    update
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    # If tile ID, file name, or hue are different from current ones
    if @tile_id != @character.tile_id or
       @character_name != @character.character_name or
       @character_hue != @character.character_hue
      # Remember tile ID, file name, and hue
      @tile_id = @character.tile_id
      @character_name = @character.character_name
      @character_hue = @character.character_hue
      # If tile ID value is valid 
      if @tile_id >= 384
        self.bitmap = RPG::Cache.tile($game_map.tileset_name,
          @tile_id, @character.character_hue)
        self.src_rect.set(0, 0, 32, 32)
        self.ox = 16
        self.oy = 32
      # If tile ID value is invalid   
      else
        self.bitmap = RPG::Cache.character(@character.character_name,
          @character.character_hue)
        @cw = bitmap.width / 4
        @ch = bitmap.height / 4
        self.ox = @cw / 2
        self.oy = @ch
      end
    end
    # Set visible situation
    self.visible = (not @character.transparent)
    # If graphic is character
    if @tile_id == 0
      sx = (@character.pattern) * @cw
      sy = (@character.direction - 2) / 2 * @ch
      sy = ( 4 - 2) / 2 * @ch   if @character.direction == 6
      sy = ( 6 - 2) / 2 * @ch   if @character.direction== 4
      if @character.direction != 4 and @character.direction != 6
        sy = (@character.direction - 2) / 2 * @ch
      end
    end
    # Set sprite coordinates   
    self.x = @character.screen_x
    self.y = @character.screen_y-5
    @moving =! (@character.real_x % 128 == 0 and @character.real_y % 128 == 0)
    @d = @character.direction
    @rect = [sx, sy, @cw, @ch]
    if !(@moving)
      if $game_map.terrain_tag(@character.real_x / 128,
          @character.real_y / 128 + 1) == REFLECT_TAG
        @reflected=true
        @former=true
      else
        @reflected=false 
        @former=false
      end
    else
      case @d
      when 2
        if $game_map.terrain_tag(@character.real_x / 128,
            @character.real_y / 128 + 2) == REFLECT_TAG
          @reflected=true
          if @former == false
            @offset = (@character.screen_y % 32) * @ch / 32
            @rect = [sx, sy, @cw, @offset]
            self.y = @character.screen_y - 5
          end
        else
          @reflected = false 
        end
      when 4
        if $game_map.terrain_tag(@character.real_x / 128,
            @character.real_y / 128 + 1) != REFLECT_TAG
          @offset = ((@character.screen_x - @cw / 2) % 32) * @cw / 32
          @rect = [sx, sy, @offset, @ch]
          self.x = @character.screen_x
        else
          @reflected = true
          if @former == false
            @offset = ((@character.screen_x - @cw / 2) % 32) * @cw / 32
            @rect = [sx + @offset, sy, @cw - @offset, @ch]
            self.x = @character.screen_x - @offset
          end
        end
      when 6
        if $game_map.terrain_tag(@character.real_x / 128 + 1,
            @character.real_y / 128 + 1) != REFLECT_TAG
          @offset = ((@character.screen_x - @cw / 2) % 32) * @cw / 32
          @rect = [sx + @offset, sy, @cw - @offset, @ch]
          self.x = @character.screen_x - @offset
        else
          @reflected = true
          if @former == false
            @offset = ((@character.screen_x - @cw / 2) % 32) * @cw / 32
            @rect = [sx, sy, @offset, @ch]
            self.x = @character.screen_x
           end
         end
      when 8
        if $game_map.terrain_tag(@character.real_x / 128, @character.real_y / 128 + 2) == REFLECT_TAG
          @reflected=true
          if $game_map.terrain_tag(@character.real_x / 128, @character.real_y / 128 + 1) != REFLECT_TAG
            @offset = (@character.screen_y%32)*@ch/32
            @rect=[sx, sy, @cw, @offset]
            self.y=@character.screen_y-5
          end
        else
          @reflected=false 
        end
      end
    end
    if @reflected
      self.opacity=128
    else
      @rect=[sx, sy, @cw, @ch]
      self.opacity=0
    end
    if $game_map.terrain_tag((@character.real_x + 64) / 128, @character.real_y / 128 + 2) != REFLECT_TAG
      if $game_map.terrain_tag((@character.real_x + 64) / 128, @character.real_y / 128 + 2) != REFLECT_TAG
        @rect[1]= @rect[1]+@ch/2
        @rect[3]= @rect[3]/2
        self.y = self.y - @ch/2
      else
        @reflected=false
      end
    end
    self.src_rect.set(@rect[0],@rect[1],@rect[2],@rect[3])
    @character.is_a?(Game_Player) ? self.z = 9 : self.z = 5
    # Set opacity level, blend method, and bush depth
    self.blend_type = @character.blend_type
    self.bush_depth = @character.bush_depth
    # Animation
    if @character.animation_id != 0
      animation = $data_animations[@character.animation_id]
      animation(animation, true)
      @character.animation_id = 0
    end
    self.angle = @self_angle
  end
end



#==============================================================================
# ** Sprite_Character
#------------------------------------------------------------------------------
#  This sprite is used to display the character.It observes the Game_Character
#  class and automatically changes sprite conditions.
#==============================================================================

class Sprite_Character < RPG::Sprite
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias reflect_initialize initialize
  alias reflect_update update
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     viewport  : viewport
  #     character : character (Game_Character)
  #-------------------------------------------------------------------------- 
  def initialize(viewport, character = nil)
    @character = character
    @reflection = []
    super(viewport)
    if (character.is_a?(Game_Event) and character.list != nil and
      character.list[0].code == 108 and
      character.list[0].parameters == ["r"])
     @reflection.push(Sprite_Reflection.new(viewport,@character))
    end
    if (character.is_a?(Game_Event) and character.list != nil and
      character.list[0].code == 108 and
      character.list[0].parameters == ["hero_r"])
      @reflection.push(Sprite_Reflection.new(viewport,$game_player))
      #===================================================
      # * Compatibility with Caterpillar Functions
      #===================================================
      if CATERPILLAR_COMPATIBLE and $game_party.characters != nil
        for member in $game_party.characters
          @reflection.push(Sprite_Reflection.new(viewport, member))
        end
      end
      if SQUAD_MOVE_COMPATIBLE and $game_allies.values != nil
        for member in $game_allies.values
          @reflection.push(Sprite_Reflection.new(viewport, member))
        end
      end
      if CCOA_CATER_COMPATIBLE and $game_train.actors != nil
        for member in $game_train.actors
          @reflection.push(Sprite_Reflection.new(viewport, member))
        end
      end
      if TRICKSTER_CATER_COMPATIBLE and $game_party.followers != nil
        for member in $game_party.followers
          @reflection.push(Sprite_Reflection.new(viewport, member))
        end
      end
      #===================================================
      # ** End of the compatibility
      #===================================================       
    end
    # Perform the original call
    reflect_initialize(viewport, @character)
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    reflect_update
    if @reflection != nil
      for reflect in @reflection
        reflect.update
      end
    end
  end
end


It's better formatted and while the script doesn't tell you, you need to put an event with a comment inside it "hero_r" for maps you want your character to be reflected in tag 7 water (Not sure if the event has to be parallel or action so try both).

You can also have events reflected in water by putting a comment "r" at the top. (The events with "r" comment don't have to be in parallel or auto run you can leave them on action button or whatever you want.)

I was using it myself in my project but if your using rounded waters instead of the default squarish ones you'll have problems with the reflection showing in the water and on the land.
Current Project/s:

Andreavnn

@ForeverZer0 I understand no problem thanks for the help I will keep looking into it.

@Vexus I will give it a try tonight after work, thanks.

diagostimo

sorting the reflection for rounded tiles is pretty easy, ussualy what i do is make a duplicate auto-tile of the one that has a reflection, then in an image manipulation program i either delete the water out of it or change its opacity so the reflection seems dimmer, then i just draw this auto-tile over the other one on the map, or if you dont want to waste auto-tile space (this will only work for the one you delete water out of completly, the reason being the water ripple frames wouldnt happen with the semi transparent one) you could add it to whatever tilesets you would be using the autile with, just remember to draw it above the reflection tile, then the reflection will be drawn between these :D

Andreavnn

April 22, 2012, 05:49:19 pm #9 Last Edit: April 22, 2012, 06:05:55 pm by Andreavnn
@diagostimo I will have to check that out, sounds promising. I don't know which water tile I am going to us yet. I will probably test both and see. It isn't that big of a deal, so I might just stick with the squrish one.

*EDIT*

@Vexus I have the script you gave me working, however, I am running into a few "problems". First when the character gets close to the water on actually at the water is reflects, but when the character is actually standing at the water it doesn't show a reflection. Second, which can be take care of with map design, but the reflection only works it the character is facing down.

Spoiler: ShowHide
 

diagostimo

i would probably go with this script here that i use:
http://www.rmxpunlimited.net/forums/topic/8460-sprite-reflection/
it has much more than just water reflection, it has mirror ect also has shadows etc anyway its all in a demo so you can see for yourself, and i must say i prefer this one to many others iv seen, at the reflections on square autotiles, sometimes depending on how large the sprite is the reflection will go other the mud bank on the auto tile, say an ogre is stood next to it, its width exeeds 32 pixles so its gonna be drawn on the bank, which is where my method comes in handy, it just makes it a bit cleaner is all :D

Andreavnn

April 22, 2012, 07:34:04 pm #11 Last Edit: April 22, 2012, 07:40:25 pm by Andreavnn
@diagostimo dowloading going give it a try, thanks  ;)

*EDIT* That script is awesome! Does it work with BABS? I have a list of scripts being used in my game as my signature. 

diagostimo

im not sure, i have only tested it stand alone, i hope it does as i plan on using it in conjunction with blizz abs, also i found a dynamic footprints script here(that is if your still having issues with the other):
https://github.com/wachunga/rmxp-dynamic-footprints
i thought i would search for one looking at your post as i thought it would be a great little feature to include in a game :P that sites a little wierd just click on the little zip box in the upper left corner to download it :)

Andreavnn

April 22, 2012, 08:03:14 pm #13 Last Edit: April 22, 2012, 08:13:55 pm by Andreavnn
@diagostimo That is the footprint script I am using it isn't working for some reason. The scripts worked in my project, however I am still having problems setting the mirror and glass reflections to work. Everything else works great.

Problem I am having :(
Spoiler: ShowHide


*EDIT* Issue with shadows ^

diagostimo

April 22, 2012, 08:18:32 pm #14 Last Edit: April 22, 2012, 08:37:55 pm by diagostimo
the footprint script requires the footprint image to be in the tileset directory, i know it seems a bit random but this could be the source of your problem if you have put it in the characters folder?
edit: i figured out the issue with the tree trunk, the script has no way of seeing that it is an unpasable solid object, so it basicly draws the shadow no matter what, a sollution to this is to go into the database, tilesets, go to the desired tileset that the shadows will be shown on, and give the tree trunks a priority of 1, this basicly means that the trunk will be drawn over anything on its tile below its priority, and seen as though you cant walk on the trunk it will never appear above you, this is a quick fix, im not experienced enough in scripting to try making it not draw shadows on certain tiles :)

Andreavnn

April 22, 2012, 10:27:07 pm #15 Last Edit: April 22, 2012, 10:28:41 pm by Andreavnn
That is no problem, I didn't even think about playing with the priorities. duh  :facepalm: That will work, don't need a whole script for that. Besides be complicated  :^_^':

*EDIT* Checked, footprint graphic is in the tileset folder. I took that script out for the moment. I am having a few other issues. I will tickle is later, unless someone can help me fix it. :/

diagostimo

April 22, 2012, 10:32:52 pm #16 Last Edit: April 22, 2012, 10:34:02 pm by diagostimo
post a demo of with all the scripts in their current format, and ill have a mess around when i get home later, it could be down to conflict but if i can narrow it down, that would make things easier to solve, im guessing than your script list is now differnt from the one previously posted?

Andreavnn

April 22, 2012, 10:44:51 pm #17 Last Edit: April 22, 2012, 10:52:31 pm by Andreavnn
I will upload a demo for you. I will put the script back in. I have everything setup, but the footprints and the mirror reflection can't seem to figure out what I am upsetting up wrong. Give me a second and I will edit in a upload.  :wacko:

*EDIT*
Demo - If the Dynamic_Footprint script isn't where I have it other scripts will pop up with errors. It might just be the script  :'(

Vexus

The demo with reflection, shadows etc etc is probably the same one I have (Which I pasted the code for the water reflection from) and I can tell you from advance, the shadow script if you want it ingame you'll need to put events ALL across the maps using tileset pieces so that the shadow doesn't go over them.

There's no other solution unless said script gets edited (Which I doubt it would fix priority issues of hills)
Current Project/s:

diagostimo

April 23, 2012, 03:45:01 am #19 Last Edit: April 23, 2012, 05:42:54 am by diagostimo
ok i have figured some stuff out, first of the dynamic footsteps isnt compatible with babs, it works with the rest apart from babs, second i noticed when playtesting that the reflection on the water was still messed up like in the image above, the way to solve this is going into the babs config, turning pixle movement to 0 and turning 8 directional movement to false, you can test it yourself but these mess the reflection up, also the reflection started in the tile above the water tile, i messed around and found that it was the sprite size, for some reason it messes with the alignment if the sprite is below a certain size, what i did was make your image a little larger.
also i got the mirrors to work, they HAVE to be on a tile that has a priority of 1, you can set a blank tile with a priority of 1 to test it, here is 2 images i edited in the proccess the first one is your sprite resized to solve the sprite being drawn in the tile above the water, the second is a hollow water auto tile:
Spoiler: ShowHide

Spoiler: ShowHide

edit:
had a look for another footprint system, couldnt find a script but i found an event system so i put this together for you, its not entirly practical as it requires lots of events:
http://www.mediafire.com/?bslxd3l5sno578t

Andreavnn

April 23, 2012, 10:24:22 am #20 Last Edit: April 23, 2012, 10:31:15 am by Andreavnn
@diagostimo, thanks I will test it out right now.

*EDIT* diagostimo do you think you could throw together the fixed version of the demo for me? I can't seem to get it to work on my side. I set the mirrors to priority *1 and still no anvil. I got the reflection to work just fine. I don't know what I am doing wrong with the mirror stuff.  :facepalm:

diagostimo

nvm i forgot to re add blizz abs when i was testing with the mirrors, so ye theres conflict with blizz abs and the mirrors, but without blizz abs to make the reflections you would draw your bottom tile then draw a tile with a priority of 1 above that, the reflection is always drawn below a tile with a priority of 1, so im guesing without it there it wouldnt be drawn at all, then of course add the reflection event

Andreavnn

I see, BABS stumbles me again. Why does every script online make there scripts work with Blizzard's, I mean he is the best so it should just be a rule.  :facepalm: Any chance I can get help with this too Blizz?

ForeverZer0

Reflection and shadow scripts, by their very nature, are extremely buggy. It is why most people end up ditching them for their actual game. They are more of a cool novelty, and causes more problems than they are worth.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Andreavnn

I see, oh well. I guess I will have to really think about it then.  :'( Sad they didn't make the engine better for that kind of stuff. Is that going to be some in ARC?

ForeverZer0

Its not a restriction of the engine, its a matter of the scripting. There is no way to predict every possibility where you may or may not want a reflection/shadow to display. This could be due only to a look you are trying to get with your mapping style. Regardless, a script is a logical set of functions that do different things under different conditions. It is unrealistic to have a Ruby script for a 2D  game to be so advanced.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Andreavnn

I see, just something that can't be done with Ruby.  :wacko: Oh well might just scrap it then.

ForeverZer0

Its not that it CAN'T be done with Ruby (RGSS to be more specific), its just that it is extremely hard to not have visual bugs here an there, even compatibility aside. If you are willing to accept that, or very carefully test every map to avoid such instances, then you don't need to scrap anything. Its more a matter of the extra work required for something so simple.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Andreavnn

Ah okay, well I am in need hurry so I will just have to keep testing and see how things work out. Thanks!

Blizzard

@F0: I'd say it's more a problem of compatibility than buggy scripts. Especially since most of those scripts modify the Sprite_Character class in some way or another, things usually go haywire if you have a script that completely changes how sprites are displayed. xD
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

ForeverZer0

Quote from: ForeverZer0 on April 23, 2012, 07:31:06 pm
Its not a restriction of the engine, its a matter of the scripting. There is no way to predict every possibility where you may or may not want a reflection/shadow to display.


This is more along the lines I meant.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Andreavnn

April 24, 2012, 06:38:40 pm #31 Last Edit: April 24, 2012, 07:39:50 pm by Andreavnn
I see that only way to do it effectively would be to make a whole game then have someone or yourself come in and script a special little piece of code or each spot in your game where you would have reflections? Seems like a lot of work for someone else to do which is why I am sure no one really does it. Unless they do it for themselves, which most projects flop anyways. :/ *sigh* Well I am sitting on it for now and maybe pick it back up later if I feel like I really, really need it in there. Thanks guys for the help and insight. Always appreciated.  :haha:

*EDIT* Damn you grammar!