LOGIN
SEARCH
PROFILE
keys: ↑ ↓
LOGOUT
INDEX
MEMBERS
keys: ↑ ↓
HOME
PORTAL
PLAY ALONG
PLAY with WORDS
PLAY with GRAPHICS
PLAY with SOUNDS
PLAY with CODES
PLAY with PROJECTS
keys: ← →
Guest Access
Register:
Members:



View previous topic View next topic Go down Message [Page 1 of 1]

Administrator
Administrator
#1 default RMXP + XAS = CATERPILLAR!
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
XAS CATERPILLAR!
Version:1.1 Current version
Author:gameface101
Date:2/4/2011



Planned Future Versions

  • newer version will work with XPLAT!
  • when actor is hit/knock back, trailing events will regroup
  • trailing events will be faded when that event's actor is knockedout


Description


Automatically makes an event for additional actors in your party!
(No, this is not an ALLY script.)

Features

  • Plug and play!
  • Works great with the XAS Leader Switch!


Screenshots
[You must be registered and logged in to see this image.]

Instructions
Simply copy and paste above "main" and below "xas system" scripts.

The script


Spoiler:
Code:

################################################################################
#※※※※====== XAS CATERPILLAR script V1.1 by gameface101 2-4-2011 ======※※※※
#based off of Fukuyama's original train_actor *free to use and must give credit
################################################################################

module XAS_CAT
# When true, switch control is used
TRANSPARENT_SWITCH = true
# When TRANSPARENT_SWITCH is true, transparency will be activated when the switch of this number is on
TRANSPARENT_SWITCHES_INDEX = 20
# Maximum actors in your party
XCAT_ACTORS_SIZE_MAX = 4
# Constants
DOWN_LEFT  = 1
DOWN_RIGHT = 3
UP_LEFT    = 7
UP_RIGHT  = 9
JUMP      = 10#5
# Put any actor IDs who should have a "stopped animation" if in the caterpillar
# i.e. if a party member "is floating" it will look stupid if he suddenly stops
ACTOR_IDS = [2, 3, 4]
end
#==============================================================================
# ■ Spriteset_Map_Module
#------------------------------------------------------------------------------
# Caterpillar movement of actor is carried out on map
#==============================================================================

module XAS_CAT

module Spriteset_Map_Module
  def setup_actor_character_sprites?
    return @setup_actor_character_sprites_flag != nil
  end
  def setup_actor_character_sprites(characters)
    if !setup_actor_character_sprites?
      for character in characters.reverse
        @character_sprites.unshift(
          Sprite_Character.new(@viewport1, character)
        )
      end
      @setup_actor_character_sprites_flag = true
    end
  end
end

end

class Spriteset_Map
  include XAS_CAT::Spriteset_Map_Module
end

#==============================================================================
# ■ Scene_Map_Module
#------------------------------------------------------------------------------
# Caterpillar movement of actor is carried out on map
#==============================================================================

module XAS_CAT

module Scene_Map_Module
  def setup_actor_character_sprites(characters)
    @spriteset.setup_actor_character_sprites(characters)
  end

end

end

class Scene_Map
  include XAS_CAT::Scene_Map_Module
end


#==============================================================================
# ■ Game_Party_Module
#------------------------------------------------------------------------------
# Caterpillar movement of actor is carried out on map
#==============================================================================

module XAS_CAT

module Game_Party_Module
 
  attr_reader :characters
 
  def update_party_order() return actors end

  def setup_actor_character_sprites
    if @characters.nil?
      @characters = []
      for i in 1 ... XCAT_ACTORS_SIZE_MAX
        @characters.push(Game_Party_Actor.new)
      end
    end
    setup_actors = update_party_order
    for i in 1 ... XCAT_ACTORS_SIZE_MAX
      @characters[i - 1].setup(setup_actors[i])
    end
    if $scene.class.method_defined?('setup_actor_character_sprites')
      $scene.setup_actor_character_sprites(@characters)
    end
  end
 
  def update_party_actors
    update_party_order
    setup_actor_character_sprites
    transparent = $game_player.transparent
      $game_player.refresh#
      $game_map.refresh#test
    if transparent == false and TRANSPARENT_SWITCH
      transparent = $game_switches[TRANSPARENT_SWITCHES_INDEX]
    end
    for character in @characters
      character.transparent = transparent
      character.move_speed = $game_player.move_speed
      if ACTOR_IDS.include?(character.cp_id) #for stopped animation
        character.step_anime = true #for stopped animation
      else #stopped animation
        character.step_anime = $game_player.step_anime
      end #for stopped animation
      character.update
    end
  end
 
  def moveto_party_actors( x, y )
    setup_actor_character_sprites
    for character in @characters
      character.moveto( x, y )
    end
    @move_list = [] if @move_list == nil
    move_list_setup
  end
 
  def move_party_actors
    if @move_list == nil
      @move_list = []
      move_list_setup
    end
    @move_list.each_index do |i|
    if @characters[i] != nil
      case @move_list[i].type
        when Input::DOWN
          @characters[i].move_down(@move_list[i].args[0])
        when Input::LEFT
          @characters[i].move_left(@move_list[i].args[0])
        when Input::RIGHT
          @characters[i].move_right(@move_list[i].args[0])
        when Input::UP
          @characters[i].move_up(@move_list[i].args[0])
        when DOWN_LEFT
          @characters[i].move_lower_left
        when DOWN_RIGHT
          @characters[i].move_lower_right
        when UP_LEFT
          @characters[i].move_upper_left
        when UP_RIGHT
          @characters[i].move_upper_right
        when JUMP
          @characters[i].jump(@move_list[i].args[0],@move_list[i].args[1])
        end
      end
    end
  end

  class Move_List_Element
 
    def initialize(type,args)
      @type = type
      @args = args
    end
 
    def type() return @type end
 
    def args() return @args end
 
    end
 
    def move_list_setup
      for i in 0 .. XCAT_ACTORS_SIZE_MAX
        @move_list[i] = nil
      end
    end
 
    def add_move_list(type,*args)
      @move_list.unshift(Move_List_Element.new(type,args)).pop
    end
 
    def move_down_party_actors(turn_enabled = true)
      move_party_actors
      add_move_list(Input::DOWN,turn_enabled)
    end
 
    def move_left_party_actors(turn_enabled = true)
      move_party_actors
      add_move_list(Input::LEFT,turn_enabled)
    end
 
    def move_right_party_actors(turn_enabled = true)
      move_party_actors
      add_move_list(Input::RIGHT,turn_enabled)
    end
 
    def move_up_party_actors(turn_enabled = true)
      move_party_actors
      add_move_list(Input::UP,turn_enabled)
    end
 
    def move_lower_left_party_actors
      move_party_actors
      add_move_list(DOWN_LEFT)
    end
 
    def move_lower_right_party_actors
      move_party_actors
      add_move_list(DOWN_RIGHT)
    end
 
    def move_upper_left_party_actors
      move_party_actors
      add_move_list(UP_LEFT)
    end
 
    def move_upper_right_party_actors
      move_party_actors
      add_move_list(UP_RIGHT)
    end
 
    def jump_party_actors(x_plus, y_plus)
      move_party_actors
      add_move_list(JUMP,x_plus, y_plus)
    end
 
  end

end

class Game_Party
  include XAS_CAT::Game_Party_Module
end

#==============================================================================
# ■ Game_Player_Module
#------------------------------------------------------------------------------
# Caterpillar movement of actor is carried out on map
#==============================================================================

module XAS_CAT

module Game_Player_Module
 
  attr_reader :move_speed
  attr_reader :step_anime
 
  def update_party_actors
    $game_party.update_party_actors
    $game_party.actors.each do |actor|
      @character_name = actor.character_name
      @character_hue = actor.character_hue
      break
    end
  end
 
  def update
    update_party_actors
    super
  end
 
  def moveto( x, y )
    $game_party.moveto_party_actors( x, y )
    super( x, y )
  end
 
  def move_down(turn_enabled = true)
    if passable?(@x, @y, Input::DOWN)
      $game_party.move_down_party_actors(turn_enabled)
    end
    super(turn_enabled)
  end
 
  def move_left(turn_enabled = true)
    if passable?(@x, @y, Input::LEFT)
      $game_party.move_left_party_actors(turn_enabled)
    end
    super(turn_enabled)
  end
 
  def move_right(turn_enabled = true)
    if passable?(@x, @y, Input::RIGHT)
      $game_party.move_right_party_actors(turn_enabled)
    end
    super(turn_enabled)
  end
 
  def move_up(turn_enabled = true)
    if passable?(@x, @y, Input::UP)
      $game_party.move_up_party_actors(turn_enabled)
    end
    super(turn_enabled)
  end
#======================================================[ move methods for events
  def move_lower_left
    # When possible to move from down→left or from left→down
    if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::LEFT)) or
      (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::DOWN))
      $game_party.move_lower_left_party_actors
    end
    super
  end
 
  def move_lower_right
    # When possible to move from down→right or from right→down
    if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::RIGHT)) or
      (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::DOWN))
      $game_party.move_lower_right_party_actors
    end
    super
  end
 
  def move_upper_left
    # When possible to move from up→left or from left→up
    if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::LEFT)) or
      (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::UP))
      $game_party.move_upper_left_party_actors
    end
    super
  end
 
  def move_upper_right
    # When possible to move from up→right or from right→up
    if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::RIGHT)) or
      (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::UP))
      $game_party.move_upper_right_party_actors
    end
    super
  end
 
  def jump(x_plus, y_plus)
    # New coordinates are calculated
    new_x = @x + x_plus
    new_y = @y + y_plus
    # When addition values are (0,0), it is possible to jump to the destination
    if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y, 0)
      $game_party.jump_party_actors(x_plus, y_plus)
    end
    super(x_plus, y_plus)
  end
 
end

end

class Game_Player
 include XAS_CAT::Game_Player_Module
end

#==============================================================================
# ■ Game_Event_Module
#------------------------------------------------------------------------------
# Caterpillar movement of actor is carried out on map
#==============================================================================

module XAS_CAT

module Game_Event_Module
  #--------------------------------------------------------------------------
  # ● Judgement determined
  #    x  : X coordinates
  #    y  : Y coordinates
  #    d  : Direction (0,2,4,6,8)  ※ 0 = Checks if all directions are not able to be passed (for a jump)
  # return : Passing is impossible (false), possible (true)
  #--------------------------------------------------------------------------
  def passable?(x, y, d)
    result = super(x, y, d)
    if result
      # New coordinates are searched for
      new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
      new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
      # Loops for actor in train
      for actor in $game_party.characters
        # When displayed
        if not actor.character_name.empty?
          # When actor's coordinates correspond to the destination
          if actor.x == new_x and actor.y == new_y
          # When event
            return false if self != $game_player
          end
        end
      end
    end
    return result
  end
 
end

end

class Game_Event
  include XAS_CAT::Game_Event_Module
end

#==============================================================================
# ■ Game_Party_Actor
#------------------------------------------------------------------------------
# Caterpillar movement of actor is carried out on map
#==============================================================================

module XAS_CAT

class Game_Party_Actor < Game_Character
 
  attr_reader :cp_id
  attr_writer :move_speed
  attr_writer :step_anime

  def initialize
    super()
    @through = true
  end
 
  #for XAS
  def battler
    return $game_party.actors[1]#0
  end
 
  def dead?
    return self.battler == nil ? false : self.battler.dead?
  end
  #for XAS
 
  def setup(actor)
    # The file name and hue of the character are set
    @cp_id = $data_actors[actor.id].id
    if actor != nil
      @character_name = actor.character_name
      @character_hue = actor.character_hue
    else
      @character_name = ""
      @character_hue = 0
    end
    # Opacity and blending method are initialized
    @opacity = 255
    @blend_type = 0
  end
 
  def screen_z(height = 0)
    if $game_player.x == @x and $game_player.y == @y
      return $game_player.screen_z(height) - 1
    end
    super(height)
  end
  #--------------------------------------------------------------------------
  # ● Move down
  #    turn_enabled : Flag that permits direction change on the spot
  #--------------------------------------------------------------------------
  def move_down(turn_enabled = true)
    # Face down
    turn_down if turn_enabled
    # When possible to pass
    if passable?(@x, @y, Input::DOWN)
      # Face down
      turn_down
      # Update coordinates
      @y += 1
    end
  end
  #--------------------------------------------------------------------------
  # ● Move left
  #    turn_enabled : Flag that permits direction change on the spot
  #--------------------------------------------------------------------------
  def move_left(turn_enabled = true)
    # Face left
    turn_left if turn_enabled
    # When possible to pass
    if passable?(@x, @y, Input::LEFT)
      # Face left
      turn_left
      # Update coordinates
      @x -= 1
    end
  end
  #--------------------------------------------------------------------------
  # ● Move right
  #    turn_enabled : Flag that permits direction change on the spot
  #--------------------------------------------------------------------------
  def move_right(turn_enabled = true)
    # Face right
    turn_right if turn_enabled
    # When possible to pass
    if passable?(@x, @y, Input::RIGHT)
      # Face right
      turn_right
      # Update coordinates
      @x += 1
    end
  end
  #--------------------------------------------------------------------------
  # ● Move up
  #    turn_enabled : Flag that permits direction change on the spot
  #--------------------------------------------------------------------------
  def move_up(turn_enabled = true)
    # Face up
    turn_up if turn_enabled
    # When possible to pass
    if passable?(@x, @y, Input::UP)
      # Face up
      turn_up
      # Update coordinates
      @y -= 1
    end
  end
  #--------------------------------------------------------------------------
  # ● Move lower left
  #--------------------------------------------------------------------------
  def move_lower_left
    # When no direction fixation
    unless @direction_fix
      # Turn left when facing right, turn down when facing up
      @direction = (@direction == Input::RIGHT ? Input::LEFT : @direction == Input::UP ? Input::DOWN : @direction)
    end
    # When possible to move from down→left or from left→down
    if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::LEFT)) or
      (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::DOWN))
      # Update coordinates
      @x -= 1
      @y += 1
    end
  end
  #--------------------------------------------------------------------------
  # ● Move lower right
  #--------------------------------------------------------------------------
  def move_lower_right
    # When no direction fixation
    unless @direction_fix
      # Turn right when facing left, turn down when facing up
      @direction = (@direction == Input::LEFT ? Input::RIGHT : @direction == Input::UP ? Input::DOWN : @direction)
    end
    # When possible to move from down→right or from right→down
    if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::RIGHT)) or
      (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::DOWN))
      # Update coordinates
      @x += 1
      @y += 1
    end
  end
  #--------------------------------------------------------------------------
  # ● move upper left
  #--------------------------------------------------------------------------
  def move_upper_left
    # When no direction fixation
    unless @direction_fix
      # Turn left when facing right, turn up when facing down
      @direction = (@direction == Input::RIGHT ? Input::LEFT : @direction == Input::DOWN ? Input::UP : @direction)
    end
    # When possible to move from up→left or from left→up
    if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::LEFT)) or
      (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::UP))
      # Update coordinates
      @x -= 1
      @y -= 1
    end
  end
  #--------------------------------------------------------------------------
  # ● move upper right
  #--------------------------------------------------------------------------
  def move_upper_right
    # When no direction fixation
    unless @direction_fix
      # Turn right when facing left, turn up when facing down
      @direction = (@direction == Input::LEFT ? Input::RIGHT : @direction == Input::DOWN ? Input::UP : @direction)
    end
    # When possible to move from up→right or from right→up
    if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::RIGHT)) or
      (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::UP))
      # Update coordinates
      @x += 1
      @y -= 1
    end
  end

end

end

Support


some where in cyberspace...

Known Compatibility Issues
I'm certain there's a bunch! (ha! just threw it together)

  • trailing events don't fade or disappear when actors are dead.
  • when leader is knockedback trailing events don't regroup
  • damage pop appears on second actor

Restrictions
free to use must give credit!
Administrator
Show Signature
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr https://www.youtube.com/user/MrGameface101?feature=watch
Poster Mcposty
Poster Mcposty
#2 default Re: RMXP + XAS = CATERPILLAR!
Loading

MotionM

MotionM
Poster Mcposty
Poster Mcposty
Poster Mcposty
profile
trailing events don't fade or disappear when actors are knockedout.
So say if Actor#2 is KO'd then he would still be following? I rather like that idea. Very Happy Good work GF!
Poster Mcposty
Show Signature


[You must be registered and logged in to see this link.]
^Want the above userbar in your profile? Here's the code.
Code:
 [img]http://img718.imageshack.us/img718/7481/gfuserbar.jpg[/img][/URL]



View my blog, [You must be registered and logged in to see this link.]

Want a certain music album or game reviewed? Send me an Email at [You must be registered and logged in to see this link.]!

[You must be registered and logged in to see this image.]: MShinigaki
Add me for some League of Legends fun!
Poster Mcposty
https://www.dropbox.com/sh/l3s9sn0nmkaxmy7/Lrut_zZyWd http://motionmreview.blogspot.com/ https://twitter.com/_motionm
EVENTALIST
EVENTALIST
#3 default Re: RMXP + XAS = CATERPILLAR!
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
nice gface im gonna take a look at this when i get the time.
EVENTALIST
Show Signature
EVENTALIST
Administrator
Administrator
#4 default Re: RMXP + XAS = CATERPILLAR!
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
@wiggles - thanks man, maybe you can help me kill them bugs ^,^

and some compatibility issues with the platformer script.

oh and I used your script template! Very Happy
Administrator
Show Signature


Hey Guest, check out my demos!
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]




G101's theme colors
[You must be registered and logged in to see this image.]
[You must be registered and logged in to see this link.]

[You must be registered and logged in to see this image.]


shhh.... [You must be registered and logged in to see this link.]



[You must be registered and logged in to see this link.]
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr https://www.youtube.com/user/MrGameface101?feature=watch
Active Member
Active Member
#5 default Re: RMXP + XAS = CATERPILLAR!
Loading

LiTTleDRAgo

LiTTleDRAgo
Active Member
Active Member
Active Member
profile
is this updated?
it seems not compatible with falling system
Active Member
Show Signature
Active Member
http://littledrago.blogspot.com
Administrator
Administrator
#6 default Re: RMXP + XAS = CATERPILLAR!
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
is this updated?
it seems not compatible with falling system

this could sure use an update, not only for the falling system but for the latest switch leader as well. I still need to get it working so that when a player dies, that trailing events opacity lowers to appear ghost like.
Administrator
Show Signature


Hey Guest, check out my demos!
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]




G101's theme colors
[You must be registered and logged in to see this image.]
[You must be registered and logged in to see this link.]

[You must be registered and logged in to see this image.]


shhh.... [You must be registered and logged in to see this link.]



[You must be registered and logged in to see this link.]
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr https://www.youtube.com/user/MrGameface101?feature=watch
Active Member
Active Member
#7 default Re: RMXP + XAS = CATERPILLAR!
Loading

LiTTleDRAgo

LiTTleDRAgo
Active Member
Active Member
Active Member
profile
also, the trailing event can go through a wall / walking in the air should be fixed too
Active Member
Show Signature
Active Member
http://littledrago.blogspot.com
Administrator
Administrator
#8 default Re: RMXP + XAS = CATERPILLAR!
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
Yeah having a fully functional caterpiller for the ABS would kik@$$!

this being used with XAS makes it more complex. HELP!

haha
Administrator
Show Signature


Hey Guest, check out my demos!
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]




G101's theme colors
[You must be registered and logged in to see this image.]
[You must be registered and logged in to see this link.]

[You must be registered and logged in to see this image.]


shhh.... [You must be registered and logged in to see this link.]



[You must be registered and logged in to see this link.]
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr https://www.youtube.com/user/MrGameface101?feature=watch
Active Member
Active Member
#9 default Re: RMXP + XAS = CATERPILLAR!
Loading

LiTTleDRAgo

LiTTleDRAgo
Active Member
Active Member
Active Member
profile
i trying to edit this, but the character pose seems not working, could someone help me?

----edit----

nevermind, I guess I figured it out
Active Member
Show Signature
Active Member
http://littledrago.blogspot.com
Active Member
Active Member
#10 default Re: RMXP + XAS = CATERPILLAR!
Loading

LiTTleDRAgo

LiTTleDRAgo
Active Member
Active Member
Active Member
profile
test edit

-----removed-----
Active Member
Show Signature
Active Member
http://littledrago.blogspot.com
Administrator
Administrator
#11 default Re: RMXP + XAS = CATERPILLAR!
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
Yo Drago, is this for the stop character animation?
I'm still wrenching on the site but this may take a small edit or placing above cog's extra animation script but it sounds like you got it working. Cool
I will have to check this out.
Administrator
Show Signature


Hey Guest, check out my demos!
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]




G101's theme colors
[You must be registered and logged in to see this image.]
[You must be registered and logged in to see this link.]

[You must be registered and logged in to see this image.]


shhh.... [You must be registered and logged in to see this link.]



[You must be registered and logged in to see this link.]
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr https://www.youtube.com/user/MrGameface101?feature=watch
Active Member
Active Member
#12 default Re: RMXP + XAS = CATERPILLAR!
Loading

LiTTleDRAgo

LiTTleDRAgo
Active Member
Active Member
Active Member
profile
I'm still not finished though...
It still not cross engined
Active Member
Show Signature
Active Member
http://littledrago.blogspot.com
Active Member
Active Member
#13 default Re: RMXP + XAS = CATERPILLAR!
Loading

LiTTleDRAgo

LiTTleDRAgo
Active Member
Active Member
Active Member
profile
making this compatible with VX and XAS at the same time is quite a pain, I think I should give up on cross enginering it

Spoiler:
Code:
################################################################################
#※※※※※※※====== XAS CATERPILLAR script V1.1 by gameface101 2-4-2011 ======※※※※※※※
#based off of Fukuyama's original train_actor *free to use and must give credit
#
# ------edited
################################################################################

module XAS_CAT
  #-----------------------------------------------------------------------------
  # When TRANSPARENT_SWITCHES_INDEX is not nil,
  # transparency will be activated if the switch of this number is on
  TRANSPARENT_SWITCHES_INDEX = 3 # nil
  # WARNING = A bit of LAGG
  #-----------------------------------------------------------------------------
  # Maximum actors in your party
  XCAT_ACTORS_SIZE_MAX = 4
  #-----------------------------------------------------------------------------
  # Put any actor IDs who should have a "stopped animation" if in the caterpillar
  # i.e. if a party member "is floating" it will look stupid if he suddenly stops
  ACTOR_IDS = []#[2, 3, 4]
  # NOT WORKING !! (JUST USE XRXS - ANIMATED CHAR INSTEAD)
  #-----------------------------------------------------------------------------
  # Party can go through a wall?
  PARTY_THROUGH = false
  #-----------------------------------------------------------------------------
end

#==============================================================================
# ■ Spriteset_Map_Module
#------------------------------------------------------------------------------
# Caterpillar movement of actor is carried out on map
#==============================================================================

module XAS_CAT

module Spriteset_Map_Module
  def setup_actor_character_sprites?
    return @setup_actor_character_sprites_flag != nil
  end
 
  def setup_actor_character_sprites(characters)
    if !setup_actor_character_sprites?
      for character in characters.reverse
        @character_sprites.unshift(
          Sprite_Character.new(@viewport1, character)
        )
      end
      @setup_actor_character_sprites_flag = true
    end
  end
end

end


#==============================================================================
# ■ Scene_Map_Module
#------------------------------------------------------------------------------
# Caterpillar movement of actor is carried out on map
#==============================================================================

module XAS_CAT

module Scene_Map_Module
  def setup_actor_character_sprites(characters)
    @old_id = characters
    @spriteset.setup_actor_character_sprites(characters)
  end
end

end

module Kernel
  if !defined? rpgvx?
    def rpgvx?
      return true if defined? Graphics.resize_screen
      return false
    end
  end
end


#==============================================================================
# ■ Game_Party_Module
#------------------------------------------------------------------------------
# Caterpillar movement of actor is carried out on map
#==============================================================================

module XAS_CAT

DOWN_LEFT    = 1
DOWN_RIGHT    = 3
UP_LEFT      = 7
UP_RIGHT      = 9
JUMP          = 10
TOWARD_PLAYER = 11

module Game_Party_Module
 
  attr_reader :characters
 
  def update_party_order() return actors end

  def setup_actor_character_sprites
    if @characters.nil?
      @characters = []
      for i in 1 ... XCAT_ACTORS_SIZE_MAX
        @characters.push(Game_Party_Actor.new)
      end
    end
    setup_actors = update_party_order
    for i in 1 ... XCAT_ACTORS_SIZE_MAX
      @characters[i - 1].setup(setup_actors[i])
    end
    if $scene.class.method_defined?('setup_actor_character_sprites')
      $scene.setup_actor_character_sprites(@characters)
    end
  end

  def member
    return @characters
  end
 
  def update_party_actors
    update_party_order
    setup_actor_character_sprites
    transparent = $game_player.transparent
    if $XRXS_BreakActs and
      !$game_player.character_name.upcase.include?(XRXS_BreakActs::SUFFIX)
      $game_player.step_anime = false
    end
    if transparent == false and TRANSPARENT_SWITCHES_INDEX != nil
      transparent = $game_switches[TRANSPARENT_SWITCHES_INDEX]
    end
    for character in @characters
      character.transparent = transparent
      character.move_speed = $game_player.move_speed
      if ACTOR_IDS.include?(character.id) #for stopped animation
        character.step_anime = true #for stopped animation
      else #stopped animation
        if $XRXS_BreakActs and
          character.character_name.upcase.include?(XRXS_BreakActs::SUFFIX)
          character.step_anime = true
        else
          character.step_anime = false
        end
      end #for stopped animation
      character.update
    end
  end
 
  def moveto_party_actors( x, y )
    setup_actor_character_sprites
    for character in @characters
      character.moveto( x, y )
    end
    @move_list = [] if @move_list == nil
    move_list_setup
  end
 
  def move_party_actors
    if @move_list == nil
      @move_list = []
      move_list_setup
    end
    @move_list.each_index do |i|
    if @characters[i] != nil
      case @move_list[i].type
        when Input::DOWN  then @characters[i].move_down(@move_list[i].args[0])
        when Input::LEFT  then @characters[i].move_left(@move_list[i].args[0])
        when Input::RIGHT  then @characters[i].move_right(@move_list[i].args[0])
        when Input::UP    then @characters[i].move_up(@move_list[i].args[0])
        when DOWN_LEFT    then @characters[i].move_lower_left
        when DOWN_RIGHT    then @characters[i].move_lower_right
        when UP_LEFT      then @characters[i].move_upper_left
        when UP_RIGHT      then @characters[i].move_upper_right
when JUMP then @characters[i].jump(@move_list[i].args[0],@move_list[i].args[1])
        when TOWARD_PLAYER then @characters[i].move_toward_player
        end
      end
    end
  end

  class Move_List_Element
 
    def initialize(type,args)
      @type = type
      @args = args
    end
 
    def type() return @type end
 
    def args() return @args end
 
    end
 
    def move_list_setup
      for i in 0 .. XCAT_ACTORS_SIZE_MAX
        @move_list[i] = nil
      end
    end
 
    def add_move_list(type,*args)
      @move_list.unshift(Move_List_Element.new(type,args)).pop
    end

    def move_toward_player_party_actors(turn_enabled = true)
      move_party_actors
      add_move_list(TOWARD_PLAYER,turn_enabled)
    end
 
    def jump_party_actors(x_plus, y_plus)
      move_party_actors
      add_move_list(JUMP,x_plus, y_plus)
    end
 #----------------------NOT IMPORTANT CODE-----------------------------
    def move_down_party_actors(turn_enabled = true)
      move_party_actors
      add_move_list(Input::DOWN,turn_enabled)
    end
 
    def move_left_party_actors(turn_enabled = true)
      move_party_actors
      add_move_list(Input::LEFT,turn_enabled)
    end
 
    def move_right_party_actors(turn_enabled = true)
      move_party_actors
      add_move_list(Input::RIGHT,turn_enabled)
    end
 
    def move_up_party_actors(turn_enabled = true)
      move_party_actors
      add_move_list(Input::UP,turn_enabled)
    end
 
    def move_lower_left_party_actors
      move_party_actors
      add_move_list(DOWN_LEFT)
    end
 
    def move_lower_right_party_actors
      move_party_actors
      add_move_list(DOWN_RIGHT)
    end
 
    def move_upper_left_party_actors
      move_party_actors
      add_move_list(UP_LEFT)
    end
 
    def move_upper_right_party_actors
      move_party_actors
      add_move_list(UP_RIGHT)
    end
 #-------------------------------------------------------------------
  end

end


#==============================================================================
# ■ Game_Player_Module
#------------------------------------------------------------------------------
# Caterpillar movement of actor is carried out on map
#==============================================================================

module XAS_CAT

module Game_Player_Module
 
  attr_reader :move_speed
  attr_reader :step_anime
 
  def update
    if TRANSPARENT_SWITCHES_INDEX == nil or
      (TRANSPARENT_SWITCHES_INDEX != nil and
      not $game_switches[TRANSPARENT_SWITCHES_INDEX])
      $game_party.update_party_actors 
      $game_party.move_toward_player_party_actors
    end
    super
  end
 
  def moveto( x, y )
    $game_party.moveto_party_actors( x, y )
    super( x, y )
  end
 
  def jump(x_plus, y_plus)
    new_x = @x + x_plus
    new_y = @y + y_plus
    if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y, 0)
      $game_party.jump_party_actors(x_plus, y_plus)
    end
    super(x_plus, y_plus)
  end
end

end

#==============================================================================
# ■ Game_Event_Module
#------------------------------------------------------------------------------
# Caterpillar movement of actor is carried out on map
#==============================================================================

module XAS_CAT

module Game_Event_Module

  def passable?(x, y, d)
    result = super(x, y, d)
    if result
      new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
      new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
      for actor in $game_party.characters
        if not actor.character_name.empty?
          if actor.x == new_x and actor.y == new_y
            return false if self != $game_player
          end
        end
      end
    end
    return result
  end
 
end

end

#==============================================================================
# ■ Game_Party_Actor
#------------------------------------------------------------------------------
# Caterpillar movement of actor is carried out on map
#==============================================================================

module XAS_CAT

class Game_Party_Actor < Game_Character
  if $XRXS_BreakActs
    include XRXS_BreakActs
  end
   
  attr_reader :cp_id
  attr_writer :move_speed
  attr_writer :step_anime

  def initialize
    super()
  end
 
  def step_anime
    return @step_anime
  end
   
  def name
    return @actor.name
  end
 
  def battler
    return $game_actors[@cp_id]#0
  end

  def hp
    return $game_actors[@cp_id].hp if !@cp_id.nil?
  end
 
  def dead?
    return self.battler == nil ? false : self.battler.dead?
  end
 
  def setup(actor)
    @cp_id = $data_actors[actor.id].id
    @actor = $game_actors[@cp_id]
    if actor != nil
      @character_name = @actor.character_name
      @character_hue  = @actor.character_hue
    else
      @character_name = ""
      @character_hue = 0
    end
    if $xrxs_xas
      update_fall
      update_blink if !@fall
    end
    if @actor.hp == 0 or
      (TRANSPARENT_SWITCHES_INDEX != nil and
      $game_switches[TRANSPARENT_SWITCHES_INDEX])
      @opacity = 0
      @blend_type = 0
    elsif @actor.hp > 0
      @opacity = 255  if !@fall
      @blend_type = 0
    end
    @walk_anime = true
    @direction_fix = false
  end
 
  def return_to_position
    @animation_id = XAS::FALL_ANIMATION_ID
    @pre_opacity = @opacity
    @opacity = 0
    @fall = true 
    @fall_time = XAS::FALL_TIME + 10
  end
   
  def update_fall
    if @fall_time > 0
        @fall_time -= 1
        return if @fall_time > 0
        self.moveto($game_player.x,$game_player.y)
        self.animation_id = XAS::FALL_ANIMATION_ID2
        @fall = false
        @blink_duration = 40
    end 
  end
 
  def update_blink
    return if @blink_duration == 0
    @blink_duration -= 1
    ex = rand(3)
    @opacity = 100 + (ex * 50)     
    @opacity = @pre_opacity if @blink_duration == 0
  end 

  def controllable? 
      return false if @actor == nil
      return false if moving?
      return false if @move_route_forcing or $game_temp.message_window_showing
      return false if $game_system.map_interpreter.running?
      return false if self.action != nil
      return false if @character_name != @actor.character_name
      return false if terrain_tag == XAS::FALL_TERRAIN
      return true
  end
   
  def screen_z(height = 0)
    if $game_player.x == @x and $game_player.y == @y
      return $game_player.screen_z(height) - 1
    end
    super(height)
  end

  def move_down(turn_enabled = true)
    turn_down if turn_enabled
      if passable?(@x, @y, 2)
        turn_down
        @y += 1
      end
  end
 
  def move_left(turn_enabled = true)
    turn_left if turn_enabled
      if passable?(@x, @y, 4)
        turn_left
        @x -= 1
      end
  end
 
  def move_right(turn_enabled = true)
    turn_right if turn_enabled
      if passable?(@x, @y, 6)
        turn_right
        @x += 1
      end
 
  end
 
  def move_up(turn_enabled = true)
    turn_up if turn_enabled
    if passable?(@x, @y, 8)
      turn_up
      @y -= 1
    end
  end
 
  def move_lower_left
    unless @direction_fix
      @direction = (@direction == 6 ? 4 : @direction == 8 ? 2 : @direction)
    end
    if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 4)) or
          (passable?(@x, @y, 4) and passable?(@x - 1, @y, 2))
      @x -= 1
      @y += 1
    end
  end
 
  def move_lower_right
    unless @direction_fix
      @direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction)
    end
    if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 6)) or
      (passable?(@x, @y, 6) and passable?(@x + 1, @y, 2))
      @x += 1
      @y += 1
    end
  end
 
  def move_upper_left
    unless @direction_fix
      @direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)
    end
    if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 4)) or
      (passable?(@x, @y, 4) and passable?(@x - 1, @y, 8))
      @x -= 1
      @y -= 1
    end
  end
 
  def move_upper_right
    unless @direction_fix
      @direction = (@direction == 4 ? 6 : @direction == 2 ? 8 : @direction)
    end
    if ((passable?(@x, @y, 8) and passable?(@x, @y - 1, 6)) or
        (passable?(@x, @y, 6) and passable?(@x + 1, @y, 8)))
      @x += 1
      @y -= 1
    end
  end

  def move_toward_player
    sx = @x - $game_player.x
    sy = @y - $game_player.y
    i = $game_actors[@cp_id].index.to_i
    if (sx == 0 and sy == 0)
      return back_fall? ? move_forward : move_backward 
    elsif (sx <= i and sy <= i) and (sx >= -i and sy >= -i)
      return turn_toward_player
    end
    return if $xrxs_xas and (terrain_tag == XAS::SLIP_TERRAIN or
        terrain_tag == XAS::FALL_TERRAIN)
    abs_sx, abs_sy  = sx.abs, sy.abs
    rand(2) == 0 ? abs_sx += 1 : abs_sy += 1 if abs_sx == abs_sy
    if abs_sx
      if sx < 0 and sy > 0 then  move_upper_right
      elsif sx > 0 and sy > 0 then move_upper_left
      elsif sx > 0 and sy < 0 then move_lower_left
      elsif sx < 0 and sy < 0 then move_lower_right
      elsif sx < 0 then move_right
      elsif sx > 0 then move_left
      elsif sy > 0 then move_up
      elsif sy < 0 then move_down   
      end
    end
  end
 
  def back_fall?
    case @direction
    when 2 then new_x, new_y = @x, @y-1
    when 4 then new_x, new_y = @x+1, @y
    when 6 then new_x, new_y = @x-1, @y
    when 8 then new_x, new_y = @x, @y+1
    end
    tera = $game_map.terrain_tag(new_x, new_y)
    if !$game_map.passable?(new_x, new_y, @direction) then return true
    else
      for event in $game_map.events.values
        if event.x == new_x and event.y == new_y
          unless event.through
            if event.character_name != "" then return true end
          end
        end
      end
    end
    return false if !$xrxs_xas
    return (tera == XAS::SLIP_TERRAIN or tera == XAS::FALL_TERRAIN)
  end
 
  def passable?(x, y, d)
    new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
    new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
    return false unless $game_map.valid?(new_x, new_y)
    if @through then return true if PARTY_THROUGH end
    return false unless $game_map.passable?(x, y, d, self)
    return false unless $game_map.passable?(new_x, new_y, 10 - d)
    for event in $game_map.events.values
      if event.x == new_x and event.y == new_y
        unless event.through
          if self != $game_player then return false end
          if event.character_name != "" then return false end
        end
      end
    end
    if @x == new_x and @y == new_y
      unless @through
        if @character_name != "" then return false end
      end
    end
    return true
  end
 
  end
end

class Game_Party
  include XAS_CAT::Game_Party_Module
end

class Game_Player
 include XAS_CAT::Game_Player_Module
end

class Game_Event
  include XAS_CAT::Game_Event_Module
end

class Spriteset_Map
  include XAS_CAT::Spriteset_Map_Module
end

class Scene_Map
  include XAS_CAT::Scene_Map_Module
end

$xas_caterpillar = true
Active Member
Show Signature
Active Member
http://littledrago.blogspot.com
Administrator
Administrator
#14 default Re: RMXP + XAS = CATERPILLAR!
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
I can imagine, can't wait to try your latest edit..

once I'm done with this HTML, I'll get back to RGSS

having a fully functional caterpillar and leader switch for XAS that allows combos based upon your party would be awesome to have...
Administrator
Show Signature


Hey Guest, check out my demos!
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]




G101's theme colors
[You must be registered and logged in to see this image.]
[You must be registered and logged in to see this link.]

[You must be registered and logged in to see this image.]


shhh.... [You must be registered and logged in to see this link.]



[You must be registered and logged in to see this link.]
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr https://www.youtube.com/user/MrGameface101?feature=watch
Active Member
Active Member
#15 default Re: RMXP + XAS = CATERPILLAR!
Loading

LiTTleDRAgo

LiTTleDRAgo
Active Member
Active Member
Active Member
profile
forgot to mention, there is a bug

if you use hookshot when your character position is same as one of your party, the game will freeze
Active Member
Show Signature
Active Member
http://littledrago.blogspot.com
Active Member
Active Member
#16 default Re: RMXP + XAS = CATERPILLAR!
Loading

LiTTleDRAgo

LiTTleDRAgo
Active Member
Active Member
Active Member
profile
I need someone to edit this to fit with xas

Code:
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# [Xp] Caterpillar
# Version: 1.00
# Author : LiTTleDRAgo
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:

module Caterpillar
 
  ACTOR_MAX_PARTY = 4
  PARTY_SPEED = 4

end

#------------------------------------------------------------------------------
# SDK Check
#------------------------------------------------------------------------------
if Object.const_defined?('SDK')
 SDK.log('Caterpillar', 'LiTTleDRAgo', 2, '22.06.11')
 @drg_caterpillar_disabled = !SDK.enabled?('Caterpillar')
end

if !@drg_caterpillar_disabled
#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
#  This class handles the map. It includes scrolling and passable determining
#  functions. Refer to "$game_map" for the instance of this class.
#==============================================================================

class Game_Map
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias cater_game_map_setup setup
  #--------------------------------------------------------------------------
  # * Setup
  #--------------------------------------------------------------------------
  def setup(map_id)
    cater_game_map_setup(map_id)
    setup_caterpillar
  end
  #--------------------------------------------------------------------------
  # * Setup Train Actors
  #--------------------------------------------------------------------------
  def setup_caterpillar
    map_event = RPG::Event.new(0, 0)
    size = (2000+Caterpillar::ACTOR_MAX_PARTY)-1
    for i in 2001..size
      map_event.id = i
      @events[i] = Game_Event.new(0, map_event)
      @events[i].move_speed = Caterpillar::PARTY_SPEED
      @events[i].move_frequency = 6
      @events[i].follow_event_id = 0
      @events[i].uncensor = true
    end
    $game_party.caterpillar($game_party.caterpillar_visible)
  end
end
#==============================================================================
# ** 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 :caterpillar_visible
  #--------------------------------------------------------------------------
  # * Train Actors
  #--------------------------------------------------------------------------
  def caterpillar(visible)
    @caterpillar_visible = visible.nil? ? false : visible
    size = (2000+Caterpillar::ACTOR_MAX_PARTY)-1
    for i in 2001..size
      actor = $game_party.actors[i-2000]
      next if $game_map.events[i].nil?
      if $game_party.caterpillar_visible and actor
        $game_map.events[i].move_type = 5
        $game_map.events[i].moveto($game_player.x,$game_player.y)
        $game_map.events[i].character_name = actor.character_name
        $game_map.events[i].character_hue = actor.character_hue
      else $game_map.events[i].move_type = 4
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Add an Actor
  #    actor_id : actor ID
  #--------------------------------------------------------------------------
  def add_actor(actor_id)
    actor = $game_actors[actor_id]
    if @actors.size < Caterpillar::ACTOR_MAX_PARTY && !@actors.include?(actor)
      @actors.push(actor)
      $game_player.refresh
    end
  end
end
#==============================================================================
# ** Game_Character
#------------------------------------------------------------------------------
#  This class deals with characters. It's used as a superclass for the
#  Game_Player and Game_Event classes.
#==============================================================================
class Game_Character
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :character_name,:character_hue,
      :through,  :move_speed, :move_frequency, :move_type,
      :follow_event_id, :uncensor,
      :x2, :y2
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias init_cater_fusion initialize
  alias update_cater_fusion update
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    init_cater_fusion
    setup_caterpillar
  end
  #--------------------------------------------------------------------------
  # * Setup Caterpillar
  #--------------------------------------------------------------------------
  def setup_caterpillar
    @follow_event_id = 0
    @x2 = @y2 = 0
  end
  #--------------------------------------------------------------------------
  # * Fusion with Event
  #--------------------------------------------------------------------------
  def move_type_fusion_with_event
    event = (@follow_event_id == 0) ? $game_player : $game_map.events[@follow_event_id]
    return unless event
    @x, @y, @x2, @y2 = event.x, event.y, event.x2, event.y2
    unless @character_name.empty?
      sx, sy = (@real_x - event.real_x).abs, (@real_y - event.real_y).abs
      speed = 7
      if Math.hypot(sx, sy) < 2**speed * 2
        self.character_name = "" if sx == 0 && sy == 0
      else turn_toward_event(@follow_event_id)
      end
    else# @real_x, @real_y = @x2, @y2
    end
  end
  #--------------------------------------------------------------------------
  # * Move to Party Leader
  #--------------------------------------------------------------------------
  def move_type_to_leader
    sx, sy = (@x - $game_player.x), (@y - $game_player.y)
    return if $xrxs_xas && self.throw_active
    return (sx == 0 && sy == 0) ? move_random : move_toward_player
        turn_toward_event  if (sx <= 1 && sx >= -1) && (sy <= 1 && sy >= -1)
    method_defined?(:move_to_me) ?  move_to_me :
    unless moving? || @direction_fix
      x = @direction == 4 ? -1 : @direction == 6 ? 1 : 0
      y = @direction == 2 ? 1 : @direction == 8 ? -1 : 0
      passable?(@x+x, @y+y, @direction) && !(x == 0 && y == 0) ? jump(x*2,y*2) :
      move_toward_player
    end
    @wait_count = 30 * 2 - 1 if !moving?
  end
  #--------------------------------------------------------------------------
  # * Turn Toward Event
  #--------------------------------------------------------------------------
  $noupperleft = true if !method_defined?(:turn_upper_left)
  def turn_toward_event(event_id = 0)
    event = (event_id == 0) ? $game_player : $game_map.events[event_id]
    return unless event
    sx, sy = @x - event.x, @y - event.y
    return if sx == 0 and sy == 0
    if sx.abs == sy.abs
      return if $noupperleft
      sy > 0 ? (sx > 0 ? turn_upper_left : turn_upper_right) :
        (sx > 0 ? turn_lower_left : turn_lower_right)
    else
      sx.abs > sy.abs ? (sx > 0 ? turn_left : turn_right) :
                      (sy > 0 ?  turn_up : turn_down)
    end
  end
  #--------------------------------------------------------------------------
  # * Turn Away From Event
  #--------------------------------------------------------------------------
  def turn_away_from_event(event_id = 0)
    event = (event_id == 0) ? $game_player : $game_map.events[event_id]
    return unless event
    sx, sy = @x - event.x, @y - event.y
    return if sx == 0 and sy == 0
    if sx.abs == sy.abs
      return if $noupperleft
      sy > 0 ? (sx > 0 ? turn_lower_right : turn_lower_left) :
        (sx > 0 ? turn_upper_right : turn_upper_left)
    else
      sx.abs > sy.abs ? (sx > 0 ? turn_right : turn_left) :
                      (sy > 0 ?  turn_down : turn_up)
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    update_cater_fusion
    return if @wait_count > 0 or @move_route_forcing or @starting or lock?
    if @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
      case @move_type
      when 4 then move_type_fusion_with_event
      when 5 then move_type_to_leader
      end
    end
  end
end
#==============================================================================
# ** Game_Player
#------------------------------------------------------------------------------
#  This class handles the player. Its functions include event starting
#  determinants and map scrolling. Refer to "$game_player" for the one
#  instance of this class.
#==============================================================================
class Game_Player < Game_Character
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  alias cater_game_player_moveto moveto
  alias cater_game_player_refresh refresh
  alias passable_cater  passable?
  #--------------------------------------------------------------------------
  # * Moveto
  #--------------------------------------------------------------------------
  def moveto(x, y)
    cater_game_player_moveto(x, y)
    size = (2000+Caterpillar::ACTOR_MAX_PARTY)-1
    (2001..size).each {|i| $game_map.events[i].moveto(x, y)}
  end
  #--------------------------------------------------------------------------
  # * Move to Designated Position
  #    x : x-coordinate
  #    y : y-coordinate
  #--------------------------------------------------------------------------
  def originmoveto(x, y)
    @x,@y = x % $game_map.width, y % $game_map.height
    @real_x,@real_y = @x * 128, @y * 128
    @prelock_direction = 0
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    cater_game_player_refresh
    self.character_name = @character_name
    $game_party.caterpillar($game_party.caterpillar_visible)
  end
  #--------------------------------------------------------------------------
  # * Passable
  #--------------------------------------------------------------------------
  def passablecater?(x, y, d)
    result = passable_cater(x,y,d)
    new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
    new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
    return true if $xrxs_xas && self.is_a?(Game_Player) && $game_system.fly
    return false unless $game_map.valid?(new_x, new_y)
    return result if @through
    return false unless $game_map.passable?(x, y, d, self) &&
          $game_map.passable?(new_x, new_y, 10 - d)
    $game_map.events.each_value {|event|
      if event.x == new_x && event.y == new_y
        unless event.through
          return true if event.name =~ /<Tembus>/i or
                  event.id > 2000
          return false if self != $game_player
          return false if event.character_name != ""
        end
      end }
    if $game_player.x == new_x and $game_player.y == new_y
      unless $game_player.through
        return false if @character_name != ""
      end
    end
    return result
  end
  #--------------------------------------------------------------------------
  # * Passable
  #--------------------------------------------------------------------------
  def passable?(x, y, d)
    new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
    new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
    return true if $DEBUG and Input.press?(Input::CTRL)
    return false unless $game_map.valid?(new_x, new_y)
    return passablecater?(x, y, d)
  end
end
#===============================================================================
# ■ Patch for XAS
#===============================================================================
if $xrxs_xas
module XRXS_EnemySensor
 #--------------------------------------------------------------------------
 # ● Update Sensor
 #--------------------------------------------------------------------------
  alias update_sensor_uncensor update_sensor
  def update_sensor
    update_sensor_uncensor if !self.uncensor
  end
end
end
#--------------------------------------------------------------------------
# SDK Check End
#--------------------------------------------------------------------------
end
#--------------------------------------------------------------------------
# END OF SCRIPT
#--------------------------------------------------------------------------

to test it

$game_party.caterpillar(true/false)

btw, this forum is so laggy on computer with low bandwith :swt:
Active Member
Show Signature
Active Member
http://littledrago.blogspot.com
Administrator
Administrator
#17 default Re: RMXP + XAS = CATERPILLAR!
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
O.o what's this? You made a newer version!? Cool

maybe I can test this in the newer X-plat?
I would like to include the leader switch and caterpillar like in the old one.

more and more methods...

yeah, it could also be the host Forumotion, I use multiple pcz to test this site:

my netbook with good bandwidth and low processing can be laggy for anything video / flash

my desktop low bandwidth and high processing
just browsing can be choppy

my tower high bandwidth and high processing
runs like a charm ^,^

most of the time it's fine, but there are times where it's choppy like a mofo..

I've started a simple site, maybe I'll add more to it...? [You must be registered and logged in to see this link.]

ok, I hope to get a solid working version for X3.91 even when XAS4 comes out with the Ally System, I'll still be making projects with XAS3.91
Administrator
Show Signature


Hey Guest, check out my demos!
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]




G101's theme colors
[You must be registered and logged in to see this image.]
[You must be registered and logged in to see this link.]

[You must be registered and logged in to see this image.]


shhh.... [You must be registered and logged in to see this link.]



[You must be registered and logged in to see this link.]
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr https://www.youtube.com/user/MrGameface101?feature=watch
Active Member
Active Member
#18 default Re: RMXP + XAS = CATERPILLAR!
Loading

LiTTleDRAgo

LiTTleDRAgo
Active Member
Active Member
Active Member
profile
there are problems that I haven't fix,

1. if the actor dies the caterpillar still following the player as if nothing happened
2. when use leader switch, the position didn't swap
3. when party member fall, they didn't return
Active Member
Show Signature
Active Member
http://littledrago.blogspot.com
Active Member
Active Member
#19 default Re: RMXP + XAS = CATERPILLAR!
Loading

LiTTleDRAgo

LiTTleDRAgo
Active Member
Active Member
Active Member
profile
Here is another caterpillar script
ripped and modified from tons of addons to fit xas

credit to blizzard
Code:
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Caterpillar by Blizzard
# Version: 2.2b
# Type: Game Experience Improvement
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#
# Compatibility:
#
#  93% compatible with SDK v1.x. 60% compatible with SDK v2.x. You might
#  experience problems with pixel movement scripts or map graphic manipulating
#  scripts. Blizz-ABS disables this add-on automatically and uses the
#  Blizz-ABS Caterpillar system.
#
#
# Features:
#
#  - your party members follow you on the map
#  - less code than other caterpillar scripts
#  - use $game_player.update_buffer('reset') if you need all party members to
#    gather around the player
#
# To disable/enable = $game_system.CATERPILLAR = true/false
#
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# max number of party members
MAX_PARTY = 4
# actor IDs where the actor is animated even when not walking
ANIMATED_IDS = []
# 0 - shows all characters; 1 - shows "ghosts"; 2 - removes from caterpillar
DEAD_DISPLAY = 1
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#==============================================================================
# Game_Character
#==============================================================================
   
class Game_Character
 
  alias passable_caterpillar_later? passable?
  def passable?(x, y, d)
    result = passable_caterpillar_later?(x, y, d)
    return result if $BlizzABS && BlizzABS::VERSION >= 1.01
    return result if self.is_a?(Game_Player) || self.is_a?(Game_Member)
    new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)
    new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)
    unless @through
      $game_player.members.each {|member|
          if member.character_name != '' && member.x == new_x && member.y == new_y
            return false
          end}
    end
    return result
  end
end
#==============================================================================
# Game_Player
#==============================================================================
class Game_Player
  attr_reader :members
  attr_reader :move_speed
  alias init_caterpillar_later initialize
  def initialize
    init_caterpillar_later
    @members = []
    (1...MAX_PARTY).each {|i| @members.push(Game_Member.new(i))} unless $BlizzABS
  end
  alias upd_caterpillar_later update
  def update
    upd_caterpillar_later
    refresh if DEAD_DISPLAY > 0
    @members.each {|member| member.update}
    if  ANIMATED_IDS.include?(actor.id)
      @step_anime = true
    end
  end
  alias straighten_caterpillar_later straighten
  def straighten
    straighten_caterpillar_later
    @members.each {|member| member.straighten}
  end
  alias refresh_caterpillar refresh
  def refresh
    unless $game_system.CATERPILLAR
      refresh_caterpillar
      return
    end
    act, $game_party.actors[0] = $game_party.actors[0], actor
    $game_party.actors.pop if $game_party.actors[0] == nil
    refresh_caterpillar
    return if actor == nil
    $game_party.actors[0] = act
    if actor.dead? && DEAD_DISPLAY == 1
      @opacity = Graphics.frame_count % 4 / 2 * 255
      @blend_type = 1
    end
  end
  def actor
    if DEAD_DISPLAY > 0
      $game_party.actors.each {|actor| return actor unless actor.dead?}
    end
    return $game_party.actors[0]
  end
  def update_buffer(next_move)
    if next_move == nil
      @members.each {|member| member.buffer = []}
    else
      @members.each {|member| member.update_buffer(
          next_move == 'reset' ? nil : next_move)}
    end
  end
  alias move_down_caterpillar_later move_down
  def move_down(turn_enabled = true)
    update_buffer(2) if passable?(@x, @y, 2)
    move_down_caterpillar_later
  end
  alias move_left_caterpillar_later move_left
  def move_left(turn_enabled = true)
    update_buffer(4) if passable?(@x, @y, 4)
    move_left_caterpillar_later
  end
  alias move_right_caterpillar_later move_right
  def move_right(turn_enabled = true)
    update_buffer(6) if passable?(@x, @y, 6)
    move_right_caterpillar_later
  end
  alias move_up_caterpillar_later move_up
  def move_up(turn_enabled = true)
    update_buffer(8) if passable?(@x, @y, 8)
    move_up_caterpillar_later
  end
  alias move_lower_left_caterpillar_later move_lower_left
  def move_lower_left
    if passable?(@x, @y, 2) && passable?(@x, @y + 1, 4) ||
      passable?(@x, @y, 4) && passable?(@x - 1, @y, 2)
      update_buffer(1)
    end
    move_lower_left_caterpillar_later
  end
  alias move_lower_right_caterpillar_later move_lower_right
  def move_lower_right
    if passable?(@x, @y, 2) && passable?(@x, @y + 1, 6) ||
      passable?(@x, @y, 6) && passable?(@x + 1, @y, 2)
      update_buffer(3)
    end
    move_lower_right_caterpillar_later
  end
 
  alias move_upper_left_caterpillar_later move_upper_left
  def move_upper_left
    if passable?(@x, @y, 8) && passable?(@x, @y - 1, 4) ||
      passable?(@x, @y, 4) && passable?(@x - 1, @y, 8)
      update_buffer(7)
    end
    move_upper_left_caterpillar_later
  end
 
  alias move_upper_right_caterpillar_later move_upper_right
  def move_upper_right
    if passable?(@x, @y, 8) && passable?(@x, @y - 1, 6) ||
      passable?(@x, @y, 6) && passable?(@x + 1, @y, 8)
      update_buffer(9)
    end
    move_upper_right_caterpillar_later
  end
 
  alias jump_caterpillar_later jump
  def jump(x_plus, y_plus)
    if (x_plus != 0 || y_plus != 0) && passable?(@x + x_plus, @y + y_plus, 0)
      update_buffer([x_plus, y_plus])
    end
    jump_caterpillar_later(x_plus, y_plus)
  end
 
  alias moveto_caterpillar moveto
  def moveto(x, y)
    update_buffer(nil)
    moveto_caterpillar(x, y)
    @members.each {|member|
        member.moveto(x, y)
        case @direction
        when 2 then member.turn_down
        when 4 then member.turn_left
        when 6 then member.turn_right
        when 8 then member.turn_up
        end}
  end
 
end
 
#==============================================================================
# Game_Member
#==============================================================================

class Game_Member < Game_Character
 
  attr_accessor :buffer
  attr_reader :battler
 
  def dead?
    return actor != nil ? actor.dead? : false
  end
 
  def initialize(index)
    super()
    @index, @force_movement, @buffer, @through = index, 0, [], true
  end
 
  def refresh
    unless $game_system.CATERPILLAR && actor != nil
      @character_name, @character_hue = '', 0
      return
    end
    @character_name = actor.character_name
    @character_hue = actor.character_hue
    if actor.dead? && DEAD_DISPLAY == 1
      @opacity, @blend_type = Graphics.frame_count % 4 / 2 * 255, 1
    else
      @opacity, @blend_type = 255, 0
    end
  end
 
  def actor
    case DEAD_DISPLAY
    when 0 then return $game_party.actors[@index]
    when 1
      alive = 0
      $game_party.actors.each {|actor| alive += 1 unless actor.dead?}
      if @index >= alive
        ind, flag = @index - alive, true
      else
        ind, flag = @index, false
      end
      $game_party.actors.each_index {|i|
          ind -= 1 if (flag == $game_party.actors[i].dead?)
          return $game_party.actors[i] if ind < 0}
    when 2
      ind = @index
      $game_party.actors.each_index {|i|
          ind -= 1 unless $game_party.actors[i].dead?
          return $game_party.actors[i] if ind < 0}
    end
    return nil
  end
 
  def update
    refresh
    @transparent = $game_player.transparent
    @move_speed = $game_player.move_speed
    unless moving? || @buffer.size <= @index && @force_movement <= 0
      if @buffer.size > 0
        move = @buffer.shift
        if move.is_a?(Array)
          jump(move[0], move[1])
        else
          case move
          when 1 then move_lower_left
          when 2 then move_down(true)
          when 3 then move_lower_right
          when 4 then move_left(true)
          when 6 then move_right(true)
          when 7 then move_upper_left
          when 8 then move_up(true)
          when 9 then move_upper_right
          end
        end
        @force_movement -= 1 if @force_movement > 0
      end
    end
    super
    @step_anime = (ANIMATED_IDS.include?($game_party.actors[@index].id))
  end
 
  def update_buffer(next_move)
    if next_move == nil
      @force_movement = @buffer.size
    else
      @buffer.push(next_move)
      @force_movement = @buffer.size if next_move.is_a?(Array)
    end
  end
 
  def check_event_trigger_touch(x, y) # don't remove this, it's necessary...
  end
 
  def screen_z(height = 0)
    return (super - @index)
  end
 
end

#==============================================================================
# Spriteset_Map
#==============================================================================

class Spriteset_Map
 
  alias init_caterpillar_later initialize
  def initialize
    init_caterpillar_later
    return if $BlizzABS && BlizzABS::VERSION >= 1.01
    $game_player.members.each {|member|
        sprite = Sprite_Character.new(@viewport1, member)
        sprite.update
        @character_sprites.push(sprite)}
  end
 
end

#==============================================================================
# Scene_Map
#==============================================================================

class Scene_Map
 
  alias transfer_player_caterpillar_later transfer_player
  def transfer_player
    transfer_player_caterpillar_later
    return if $BlizzABS
    case $game_temp.player_new_direction
    when 2 then $game_player.members.each {|member| member.turn_down}
    when 4 then $game_player.members.each {|member| member.turn_left}
    when 6 then $game_player.members.each {|member| member.turn_right}
    when 8 then $game_player.members.each {|member| member.turn_up}
    end
  end
 
end

class Game_System
  attr_accessor :CATERPILLAR
  alias init_system_cater initialize
  def initialize
    init_system_cater
    @CATERPILLAR = true
  end
end
Active Member
Show Signature
Active Member
http://littledrago.blogspot.com
Active Member
Active Member
#20 default Re: RMXP + XAS = CATERPILLAR!
Loading

kimono

kimono
Active Member
Active Member
Active Member
profile
Hello G@mef@ce,

The script works perfectly, I suggest some minor improvement if you want to add this:
- the followers can use the _ANI graphic when they don't move.
- the script may add a "one step tower Hero" command rather than be stupidly stuck behind the hero.

Great script with Switch Leader, thanks for release it for XAS 3.91!
Active Member
Show Signature
Active Member
Active Member
Active Member
#21 default Re: RMXP + XAS = CATERPILLAR!
Loading

kimono

kimono
Active Member
Active Member
Active Member
profile
Thanks to Thunder, I found the Pickup graphic problem due to the Caterpillar script. Can you please take a look at it and fix the problem?
Edit: I've got also no hero_hit graphic with this script.
Active Member
Show Signature
Active Member
Administrator
Administrator
#22 default Re: RMXP + XAS = CATERPILLAR!
Loading

G@MeF@Ce

G@MeF@Ce
Administrator
Administrator
Administrator
profile
^ I'm positive that a certain class is being over written. maybe by placing the script above or below the xas scripts might do the trick.

if not I will look into this in time...
Administrator
Show Signature


Hey Guest, check out my demos!
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]




G101's theme colors
[You must be registered and logged in to see this image.]
[You must be registered and logged in to see this link.]

[You must be registered and logged in to see this image.]


shhh.... [You must be registered and logged in to see this link.]



[You must be registered and logged in to see this link.]
Administrator
https://www.dropbox.com/sh/i47rig99qhrvn8s/4m5HvsM2fD http://g4m3f4c3.deviantart.com https://www.facebook.com//pages/Gameface101/332331300127008 https://twitter.com//mr_gameface101 https://soundcloud.com/schurr https://www.youtube.com/user/MrGameface101?feature=watch
Active Member
Active Member
#23 default Re: RMXP + XAS = CATERPILLAR!
Loading

kimono

kimono
Active Member
Active Member
Active Member
profile
Ok, I placed the XAS Caterpillar script in the Add-on section.
I tried also to post it above the XAS Sprite but I've got the same problem.
Check the actual project demo, I'll release a new one with more content when the bug is repaired:
[You must be registered and logged in to see this link.]
Active Member
Show Signature
Active Member

Sponsored content

profile

View previous topic View next topic Back to top Message [Page 1 of 1]

 

Chatbox system disabled
Personal messaging disabled