VX Caterpillar System by Woratana

posted on 16 Feb 2009 16:55 by boxsuke in Resources, ScriptsVX, WoraScripts

* สคริปต์สร้างตัวละครในปาร์ตี้เดินตามเราฮะ มีตัวเดินตามได้ไม่จำกัด =w=/ ขึ้นอยู่กับว่าในปาร์ตี้มีกี่คนอะน้อ~อันนี้ลองเขียนอะน้อ ถ้ามีบั๊กอะไรช่วยแจ้งด้วยฮะ ^^/ โค้ดแค่ 200 บรรทัดเองอะ หุหุ (ถ้าไม่นับคอมเม้นท์ก็ 150 กว่าบรรทัดเอง~) สคริปต์อยู่ด้านล่างน้อ เลื่อนลงไปเล้ย~


Caterpillar System
Version 2.0
by Woratana
Release Date: 02/03/2009

It's just that one day I feel like scripting caterpillar system. I've never done it before, and it would teach me something.

So I tried, and here is the result.

It's probably need more work to make it perfect. tongue.gif Because I think my algorithm so far is not the best one.
Please let me know if you find any bugs. ^^/


Version 2.0
- Fix direction bug
- Fix vehicle bug
- Add max following members
- Fix dash bug
- More compatible with script that edit Spriteset_Map.create_characters
Version 1.0
- Unlimited following members
- Switch to hide/show following members temporarily


# ● [VX] ◦ Plug 'n Play Caterpillar System ◦ □
# * Create party members follow the player on map *
# ◦ by Woratana [woratana@hotmail.com]
# ◦ Thaiware RPG Maker Community
# ◦ Released on: 29/02/2009
# ◦ Version: 2.0
# ◦ Update:
# □ Version 2.0 (29/02/2009)
# - Fix direction bug
# - Fix vehicle bug
# - Add max following members
# □ Version 1.5 (17/02/2009)
# - Fix dash bug
# - More compatible with script that edit Spriteset_Map.create_characters
# ◦ Compatibility:
# □ This script will rewrite 0 method(s):
# □ This script will alias 14 method(s):
#     Spriteset_Map.create_characters
#     Spriteset_Map.update_characters
#     Game_Player.move_down
#     Game_Player.move_left
#     Game_Player.move_right
#     Game_Player.move_up
#     Game_Player.move_lower_left
#     Game_Player.move_lower_right
#     Game_Player.move_upper_left
#     Game_Player.move_upper_right
#     Game_Player.jump
#     Game_Player.get_off_vehicle
#     Game_Player.moveto
#     Game_Map.setup
# □ This script should work with most scripts
# ◦ Installation:
# 1) This script should be placed JUST BEFORE ▼ Main Process.
# □ Like this:
# ▼ Materials
# ...
# ...
# * Caterpillar System
# ▼ Main Process
# Main
# 2) Setup this script in Setup Part below.
# ◦ How to use:
# □ Place this script and setup in the setup part.

module Wora

  # ++ Setup Part

  # Turn ON this switch to HIDE caterpillar actors
  # Turn OFF this switch to SHOW caterpillar actors

  # Maximum number of the following actors


  def self.add_upd_cater(code = nil)
    # Add new move action to caterpillar
    $game_cateracter.each_index do |i|
      act = $game_cateracter[i]
      eval($cater_movelist[$cater_movelist.size - 1 - i])
    $cater_movelist.push(code) unless code.nil?

  def self.reset_cater_pos
    # Reset caterpillar position
    $game_cateracter.each_index {|i| $game_cateracter[i].refresh }
    $cater_movelist = Array.new(Wora::CATERPILLAR_MAX_ACTORS - 1) {''}

class Game_WCateracter < Game_Character
  attr_accessor :actor

  def initialize(member_id)
    @wmember_id = member_id

  def update(*args)
    actor = $game_party.members[@wmember_id]
    unless actor.nil?
      @character_name = actor.character_name
      @character_index = actor.character_index
      @transparent = ($game_switches[Wora::CATERPILLAR_HIDE_SWITCH] or
    $game_player.in_vehicle? or $game_player.transparent)
      @opacity = $game_player.opacity
      @move_speed = $game_player.move_speed + ($game_player.dash? ? 1 : 0)
      @character_name = ''
      @character_index = 0

  def screen_z
    return $game_player.screen_z

  def check_event_trigger_touch(x, y)
    return false

  def passable?(x, y)
    return true

  def refresh
    @direction = $game_player.direction
    moveto($game_player.x, $game_player.y)

class Spriteset_Map
  alias wora_cater_sprmap_crechara create_characters
  alias wora_cater_sprmap_updchara update_characters
  # * Create Character Sprite
  def create_characters(*args)
    # Remove Game_Player sprite, this will be add later
    ((@character_sprites.size-1)..0).each do |i|
      next if @character_sprites[i].nil?
      if @character_sprites[i].character.is_a?(Game_Player)
    # Create party members sprite
    (1..(Wora::CATERPILLAR_MAX_ACTORS-1)).each do |n|
      @character_sprites.push(Sprite_Character.new(@viewport1, $game_cateracter[n-1]))
    @character_sprites.push(Sprite_Character.new(@viewport1, $game_player))
  # * Update Character Sprite
  def update_characters(*args)
    $game_cateracter.each {|cater| cater.update }

class Game_Player < Game_Character
  attr_reader :move_speed
  unless method_defined?('wora_cater_gampla_movdown')
    alias wora_cater_gampla_movdown move_down
    alias wora_cater_gampla_movleft move_left
    alias wora_cater_gampla_movright move_right
    alias wora_cater_gampla_movup move_up
    alias wora_cater_gampla_movll move_lower_left
    alias wora_cater_gampla_movlr move_lower_right
    alias wora_cater_gampla_movul move_upper_left
    alias wora_cater_gampla_movur move_upper_right
    alias wora_cater_gampla_jump jump
    alias wora_cater_gampla_getoffveh get_off_vehicle
    alias wora_cater_gampla_moveto moveto

    # * Move Down
    def move_down(turn_ok = true)
      Wora.add_upd_cater("act.move_down(#{turn_ok})") unless @move_failed
    # * Move Left
    def move_left(turn_ok = true)
      Wora.add_upd_cater("act.move_left(#{turn_ok})") unless @move_failed
    # * Move Right
    def move_right(turn_ok = true)
      Wora.add_upd_cater("act.move_right(#{turn_ok})") unless @move_failed
    # * Move up
    def move_up(turn_ok = true)
      Wora.add_upd_cater("act.move_up(#{turn_ok})") unless @move_failed
    # * Move Lower Left
    def move_lower_left
      Wora.add_upd_cater('act.move_lower_left') unless @move_failed
    # * Move Lower Right
    def move_lower_right
      Wora.add_upd_cater('act.move_lower_right') unless @move_failed
    # * Move Upper Left
    def move_upper_left
      Wora.add_upd_cater('act.move_upper_left') unless @move_failed
    # * Move Upper Right
    def move_upper_right
      Wora.add_upd_cater('act.move_upper_right') unless @move_failed
    # * Jump
    def jump(x, y)
      wora_cater_gampla_jump(x, y)
    # * Get Off Vehicle
    def get_off_vehicle(*args)
    # * Move to Designated Position
    def moveto(*args)

class Game_Map
  attr_accessor :events

  alias wora_cater_gammap_setup setup
  def setup(*args)
    # Create caterpillar actors
    $game_cateracter = []
    (1..(Wora::CATERPILLAR_MAX_ACTORS-1)).each do |n|
    $cater_movelist = Array.new(Wora::CATERPILLAR_MAX_ACTORS - 1) {''}
- Setup script in the SETUP part
- The complete instruction is included in the script

Author's Notes
Free for use in your work if credit is included.
If you want to post it on any forum, please link to this topic.

Bug Report?
Please give me these informations:
- What is it says in error window?
- When is it get error? (Right after run game, when you choose something, etc.)
- What have you changed in setting part?
- Do you have any other scripts running in your game that may crash with this script?



edit @ 2 Mar 2009 20:43:36 by [+Boxsuke+]




Mine keeps saying line 196 name error occured. unitialized constant game_map::wora??? whats it all about?

#210 By ( on 2011-03-30 00:08

-Script 'CATERPILLAR' line 159: NoMethodError occured.
undefined method `[]' for nil:NilClass
-It happens when I try to load a save file.
-I've not changed anything in setting part.
-I haven't got any other scripts, I tried it in a new project.

#209 By Cengiz Han ( on 2010-10-29 03:15

comment6, buy xanax without a prescription, effexor drug side effects, valtrex cold sores, stopping neurontin, camel cigarettes, valium dosage for cats, cafergot suppositories, lasix fluid pill, valium, meridia health, information on the drug levaquin, xanax, valiums, propecia, adverse lasix reaction, buy nolvadex, vermox 60 pills, nexium free, xanax without script, elimite cream, buy levaquin, ambien, cheap prednisone,

#208 By neurontin autism ( on 2010-10-20 00:36

comment3, diazepam, zolpidem overdose, drug female new viagra, zolpidem.com, glucophage insulin, baclofen, clomid.com, buy zolpidem, paroxetine, stromectol scabies, side effects of glucophage, stromectol.com,, klonopin.com, 60 cymbalta mg, elimite.com, stromectol, zoloft.com, cytotechnologist salary, cytotechnologist, clomid.com, propranolol, cytotec, clomid fertility,

#207 By 34 klonopin ( on 2010-10-19 21:42

comment5, Viagra, Adult Dating, Discount Cigarettes, Viagra, Cialis, colorado free dating sites, order cialis, Rimonabant, heart failure viagra, Sex Dating, web dating services, Levitra,

#206 By online dating ( on 2010-10-19 12:47

comment6, adult dating service, newport cigarettes website, newport cigarettes, Acomplia, viagra.com, skinny people's dating services, Phentermine, Levitra,

#205 By diet pill acomplia ( on 2010-10-19 09:44

comment5, viagra, cialis, dating online dating, newport cigarettes, buy viagra, Acomplia, cialis generic capsule, top ten dating sites, Adipex, Cialis, Viagra, rimonabant price usa, Dating Services, levitra pill size, phentermine no prescription, gay dating sites,

#204 By Adult Dating ( on 2010-10-19 08:11

comment2, viagra online, free adult dating sites, free online dating, viagra 25mg buy, Cigarettes, Adult Dating, christian dating web sites, Adipex, cialis.com, viagra, free sex dating, internet dating services online, phentermine 37.5, free gay teen dating,

#203 By Discount Cigarettes ( on 2010-10-19 05:13

comment3, Online Dating, acomplia.com, adipex no script, Viagra, Phentermine, vardenafil levitra online, free online gay dating,

#202 By generic viagra review ( on 2010-10-19 03:44

comment6, Viagra, free adults dating site, cialis, agency dating free online, cigarettes discount cigarettes, Viagra, acomplia aventis rimonabant sanofi, adult dating, adipex, cialis, Viagra, rimonabant 120 pills, free sex dating, Dating Services, Phentermine, Levitra,

#201 By Cialis ( on 2010-10-19 02:14

comment6, music, US and Canadian Cyclists, Cialis, levitra,

#200 By naruto ( on 2010-10-18 20:15

comment1, prednisolone, antabuse, prednisone dose pack, neurontin, Predcor, purchase imported cigarettes, lipitor australia, lexapro, nexium, buy cafergot, propecia birth defect, discount propecia pills, lexapro canada, lasix diet carrots, lipitor coupons, lexapro coupons, lasix interesting facts, side effects for valtrex, overdose paxil, xenical, contraindications xanax hydrocodone, effexor,

#199 By nexium protonix ( on 2010-10-14 23:52

comment3, tetracycline teeth, buy reductil, dangers of paxil, order tetracycline, bactrim.com, paroxetine, alprazolam, diazepam.com, female uk viagra, glucophage and weight loss, fluoxetine, baclofen 25 mg, reductil.com, deconstructivism deconstructivism deconstructivisms deconstructivisms delimit delimited delimited d, baclofen side effects, alternative female natural viagra, abortion cytotec, buy glucophage, order baclofen, case studies diazepam, klonopin with vyvanse, buy baclofen, benicar side effects, ivermectin, alprazolam, snorting zolpidem, alprazolam brand, cytotech, bactrim, reductil, paxil paroxetine tablets, discount zolpidem, diazepam, glucophage diet, avodart cialis clomid diflucan dostinex glucophage, allopurinol 60 pills, zolpidem, baclofen 10 mg, fluoxetine side affect, adverse effects inderal propranolol, fluoxetine gemfibrozil prescription prescription rxusa.net tamoxifen, efectos secundarios del paxil, cymbalta and pregnancy, clomid 100mg, zoloft drug interactions, stromectol.com, female leave reply viagra, effects propranolol side, klonopin drug,

#198 By baclofen effects side ( on 2010-10-14 14:43

comment2, rimonabant for sale, amoxil co, rimonabant, 2006 doxycycline january mt tb.cgi, nolvadex, buying tamiflu, clomid ovulation induction, alcohol and prednisone, buspar.com, consumer cymbalta rating, diflucan and pregnancy, rimonabant for sell, orapred odt, cymbalta and pregnancy, crysticillin 300 a.s., antabuse disulfiram, clomid, levaquin side effects, lasix.com, valtrex forum, latest nexium research, bactrim 60 pills, levitra, female viagra online, viagra propecia, prednisolone canine, valtrex, lexapro and rash, tamiflu shelf life, how buspar works, nexium,

#197 By zithromax and infants ( on 2010-10-13 16:12

comment4, slimona, propranolol, generic name for lipitor, amoxil 500mg, acomplia sanofi, lexapro abuse, buspar, retin-a, propecia pharmacy cheap, xenical diet pill results, amoxil, clomid.com, picture propecia result, cialis, cytotechnology job, antabuse.com, propecia hair loss medication, lasix renal scan, antabuse 30 pills,

#196 By prednisone dosage chart ( on 2010-10-13 12:25

comment2, effectiveness of acomplia, online viagra supply,

#195 By acomplia no generic ( on 2010-10-13 09:43

comment3, Nexium, Alprazolam, valium, Zolpidem, lipitor, buy ambien, reductil, cialis without prescription, Viagra, clomid 25mg,

#194 By levaquin and biaxin ( on 2010-10-13 08:24

comment3, cheapest viagra, cialis, cheap discount viagra, viagra online pharamcy, impotence treatment viagra, medicine acomplia, cialis super active 10 pills, viagra, viagra plus 120 pills, cialis blindness, free levitra sample, levitra viagra online, prescription medication acomplia, viagra sales online in uk, viagra joke sheet off leg, does buspar work, norvasc and levitra, viagra and online, viagra cialis levitra, herbal viagra reviews, viagra, cheap cialis, viagra and eating a meal, viagra music group, prednisone weight gain, metformin 850 mg, viagra pill splitter, best viagra replacements, cialis, is viagra legal, viagra pill cutter, viagra rrp australia, cialis 2 doses, cialis.com, cialis super active 60 pills, viagra soft tabs 90 pills,

#193 By acomplia buy online ( on 2010-10-12 03:26

comment2, lasix kidney, buy now diflucan, amoxil, retin zoloft, generic valtrex, propranolol 20 mg, clomid, zimulti 20mg, buspar, mauritius tamiflu, Nu-Cloxi,

#192 By lipitor ( on 2010-10-11 18:42

xMWaTS <a href="http://ornpbqyungmy.com/">ornpbqyungmy</a>, [url=http://nlakvzvsrvcv.com/]nlakvzvsrvcv[/url], [link=http://nwfgbqjypguk.com/]nwfgbqjypguk[/link], http://nlttdzbqllkg.com/

#191 By lvlzxtlgffo ( on 2010-10-11 16:04

g161Rw <a href="http://lkryqwumfdfs.com/">lkryqwumfdfs</a>, [url=http://wywravuodzrz.com/]wywravuodzrz[/url], [link=http://qljthosrcuea.com/]qljthosrcuea[/link], http://nsahccdumcxh.com/

#190 By cxvqhjaz ( on 2010-10-11 08:38

comment5, cafergot generic, cigarette discount kent, buy ativan, gay teen dating, buy soma, black christian dating services, zolpidem tatrate, zoloft, cheap propecia, jewish dating service, lorazepam, zolpidem, lasix without a prescription, brandon internet dating, buy discount cigarettes, vogue cigarettes, free christian dating site, propecia, dating sites for women, cytotec, thelimitedtoo, klonopin side effects, baclofen drug effects side, lasix surgery, parliament cigarette charcoal, paroxetine pregnancy, kent cigarette, levaquin 750 mg, abortion cytotec drug,

#189 By gay chatting dating ( on 2010-10-10 17:47

comment5, adipex phentermine online pharmacy, antabuse, nexium, accutane, Viagra, Cialis, doxycycline and alcohol, side effects lipitor medicine, Viagra, finalo, Valtrex, reductil, meridia testimonials, phentermine cheap no prescription, generic retin a, rimonabant.com, online viagra consultation, Clomid,

#188 By clomid and multiple birth ( on 2010-10-09 18:52

comment4, adipex, 500 antabuse cheap generic mg, nexium versus prilosec, alprazolam, viagra 25mg buy, cheap propecia usa, reductil slimming tablets, Cialis, Retin-A, buy levaquin,

#187 By order alprazolam ( on 2010-10-09 16:26

comment3, female viagra, zolpidem, allopurinol, tramadol hcl 50, does gout lasix remove, celebrex long term use, propranolol, disadvantages of internet dating, cytotechnology history, diflucan, fluoxetine.com, prozac, propecia and buy, alprazolam identification, effexor xr, vogue cigarettes,

#186 By kent ( on 2010-10-09 14:19

comment1, kent cigarettes, internet dating lunch dublin, lorazepam hallucination, sumial, neurontin, lexapro.com, buy rothmans cigarettes, celebrex, clonazepam and depression, elimite, buy alprazolam,

#185 By cigarette discount ( on 2010-10-09 12:14

comment5, diazepam, online cigarettes, jewish dating services online, free online dating, vermox, internet dating murder, buy xenical, feline prednisone, baclofen neurontin, soma, side effects of somas, diflucan fluconazole, celebrex, tretinoin cream and pregnancy, lipitor package insert pfizer, free christian dating, abortion cytotec drug, buy clonazepam, soma, effexor, side effects of benicar,

#184 By migracet-pb ( on 2010-10-09 06:09

comment5, Nexium, alprazolam, cialis 20 pills, Zolpidem, order valium no prescription, Cialis, lipitor vs simvastatin, herbal viagra, get propecia prescription, Ambien, meridia for depression, Cialis, buy reductil uk, buy rimonabant,

#183 By phentermine ( on 2010-10-09 03:48

comment4, adipex, lexapro without prescription, buy alprazolam, Cialis, valium, ambien lawsuit value, cialis, buying viagra, clomid iui,

#182 By Propecia ( on 2010-10-09 01:24

comment1, Adipex, nexium, tapering off lexapro, xanax klonopin, accutane birth defects, Viagra, alprazolam, Cialis, zolpidem.com, Atridox, valium sales, cheapest cialis, Prednisone, viagra equivalent, valtrex dose for herpes, Meridia, sentiments retin a, flomax and viagra, clomid counter over,

#181 By doxycycline.com ( on 2010-10-08 22:59

comment6, acomplia.com, viagra.com,

#180 By acomplia 90 pills ( on 2010-10-08 04:30

comment4, Lasix, klonopin, accutane litigation, viagra, cialis online, zolpidem, doxycycline long term effects, prednisone shot, propecia online consultation, Acomplia, generic ambien adverse side effects, meridia results, online retin a pharmacy, levaquin 500mg tablets, order rimonabant, over the counter clomid,

#179 By Viagra ( on 2010-10-07 23:18

comment6, Acomplia, cheap viagra pills,

#178 By buy viagra ( on 2010-10-07 18:18

comment1, Acomplia, female viagra,

#177 By Acomplia ( on 2010-10-07 05:07

comment4, free dating websites, soma to take effect, jewish dating sites, metformin, prednisone online, minoxidil with tretinoin, kent, lorazepam, winston, paroxetine,

#176 By gay dating sites ( on 2010-10-06 16:23

comment4, zolpidem.com, pall mall, tretinoin cream.com, glucophage, nolvadex tablet, clomid, tramadol, cytotec.com, levaquin, zolpidem online mexico, benicar side effects, winston,

#175 By cymbalta for panic disorder ( on 2010-10-06 14:10

comment1, acomplia.com, retin-a, free online dating sites, antabuse no online prescription, camel cigarette ads, cheap marlboro cigarettes, zithromax.com, antabuse, adult sim dating games, phentermine, retin-a, doxycycline, cigarettes, valium images pictures, real take viagra, accutane, cigarettes brands australia, adult dating sites password, acomplia diet,

#174 By viagra verses cialis ( on 2010-10-05 22:55

comment1, acomplia.com, retin-a, free online dating sites, antabuse no online prescription, camel cigarette ads, cheap marlboro cigarettes, zithromax.com, antabuse, adult sim dating games, phentermine, retin-a, doxycycline, cigarettes, valium images pictures, real take viagra, accutane, cigarettes brands australia, adult dating sites password, acomplia diet,

#173 By viagra verses cialis ( on 2010-10-05 22:55

comment4, viagra, rimonabant, cafergot online, free cialis samples, clomid pharmacy purchase,

#172 By cigars vs cigarettes ( on 2010-10-01 19:03

comment4, levitra price, genetic viagra, buy cheap cialis, cialis.com, cheap xanax, viagra,

#171 By best.optus.nu site tetracycline ( on 2010-10-01 09:05

comment1, doxycycline, viagra kvinnor,, 500 antabuse cheap generic mg, handla levitra, marlboro cigarettes, generic cialis online, indian dating sites, nolvadex,

#170 By doxycycline lyme disease ( on 2010-10-01 07:00

comment6, clomid ovulation cycle, herbal thyroid remedies, generic acomplia pills, diet pill rimonabant, female viagra cream, alternative female natural viagra, health insurance, acomplia verses phentermine, marlboro, Herbal Weight Loss,, life insurance quotes, Propranolol, Cialis, Viagra,

#169 By Marlboro ( on 2010-09-30 08:40

comment3, new online casinos, adipex-p, Cialis, free casino online gold, online casinos for sale, online casino gambling worldwide, online casino, zithromax 500 mg, accutane discussion, online casinos no deposit bonuses, viagra mens health,

#168 By accutane taxol interferon ( on 2010-09-26 10:04

comment4, travel information online casino, acomplia from trusted, Phentermine, branded cialis drugstore, prednisone 40mg, american online casinos, online casino no desposit, top 10 online casinos recommended, free cash online casinos, zithromax z pack, accutane effects side, online casinos accepting usa deposits,

#167 By online casinos ( on 2010-09-26 07:16

comment3, live online casino, rimonabant acomplia, Adipex, soft pill cialis, prednisone.com, online casinos no deposit, casinos online microgaming, side effects of zithromax, accutane after pregnancy, discount viagra,

#166 By online casinos us players ( on 2010-09-26 04:28

JD4jy5 <a href="http://rvjdkgbdywgf.com/">rvjdkgbdywgf</a>, [url=http://sfsyvpcutshk.com/]sfsyvpcutshk[/url], [link=http://ihsdhpavumej.com/]ihsdhpavumej[/link], http://cwdvuhzhtneq.com/

#165 By aiwnkicw ( on 2010-09-24 18:39

comment2, doxycycline effects side, levitra, on line viagra, herbal remedies, dating and sex romance, rothmans royals cigarettes, cipro 1000mg,

#164 By renters insurance orlando florida ( on 2010-09-22 03:16

comment6, online viagra, lipitor, celebrex alternatives, xanax, order cialis, neurontin autism, cheap cialis, nexium, clomid dosage, acomplia treatment, Phentermine, online viagra consultation, buy accutane, viagra, acomplia diet rimonabant smoke, adipex, valtrex teeth, zithromax z pak,

#163 By nexium and increased extrogen ( on 2010-09-21 17:48

comment3, lipitor, generic zoloft, adipex-p, acomplia buy brand, Cialis, levitra professional 60 pills, viagra, Levitra, diet pill rimonabant, levaquin antibiotics, adipex buy, zithromax no prescription,

#162 By levitra order ( on 2010-09-21 05:06

comment2, Cialis, viagra side effect headaches, xanax, zoloft, cialis, Adipex, neurontin treatment, cialis western open ticket, cialis professional 10 pills, clomid online, viagra, viagra cialis levitra, buy valtrex, Zithromax,

#161 By Valium ( on 2010-09-20 23:13