RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Zeriab Caterpillar 1.1c [RMVX Edition]

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Zeriab's Caterpillar
Version: 1.1c
Author: Zeriab [ported to VX by modern algebra]
Date: February 21, 2010

Version History


  • <Version 1.1c (RMVX)> 02.21.2010 - Fixed an error that would keep the caterpillar actors visible (and immobile) even when the caterpillar switch was turned off. Also applied the passability features to 8D movement.
  • <Version 1.1b (RMVX)> 01.15.2010 - Fixed a little error with dashing - no more jarring movement. Also, the demo apparently wasn't set up correctly before - whoops! It is now.
  • <Version 1.1 (RMVX)> 12.08.2009 - Added compatibility with Composite Characters, as well as adding a feature to generate the graphic of actor caterpillar events automatically
  • <Version 1.0 (RMVX)> 10.13.2009 - RMVX conversion of original script. Added features:
    • Non-Party Followers
    • Pass Through Solid Followers
  • <Version 1.0 (RMXP)> 08.16.2008 - Original Release for RMXP

Description


Quote from: Zeriab
This script creates a caterpillar of the party members by using events present on the map. (You need to actually make the events in the editor)
When the caterpillar is deactivated they act just like any other event. Most event commands still works on the events when the caterpillar is activated, but the results be strange.

I also added the features of allowing events who are not in the party to follow the player as well (which I am pretty sure is unique to this caterpillar script), and also an ability to set the events to be solid and letting only the player pass through them automatically and to all other events they react as if they are solid, so other events can't just walk through your party members (unless you set them to Through)

For the most part, the basic functioning of the follower events noted by Zeriab remains the same.

Features

  • Party members will follow behind the player in a line, like Lufia and countless other RPGs
  • Event based, Event-based caterpillar, meaning that follower events can be interacted with as events
  • Can set regular events to follow even if they are not in the party.
  • Can set them to solid, so that other events are not able to walk through follower events while still allowing the player to pass through them.

Screenshots



Instructions

Quote from: Zeriab
Put \cat_actor[3] in the name of an event and it will be considered the event for the actor with id 3. The name could for example be "Cyrus\cat_actor[3]"

The switch number specified with CATERPILLAR_ACTIVE_SWITCH (default is 23) is used to determine whether the events should be positioned in the caterpillar or not. When the switch is off they are just like any other event.

The REMOVE_VISIBLE_ACTORS (default is true) is used to determine whether actor event not in the party should be erased or not. If it is set to an integer rather than true or false the switch with the corresponding id is used. For example REMOVE_VISIBLE_ACTORS = 21 will allow you to determine whether the events should be erased or not depending whether switch 21 is OFF or ON.

The MAX_ACTORS (default is 4) is used to determine how many player moves should be remembered. Only change this if you can have a party with more than 4 followers.

Features added for RMVX version by modern algebra

  ~Non-Party Followers
    This addon allows you to set events to follow the player in the caterpillar without having to be an actor in the party. It is set by page, rather than name, as that allows a number of conditions to be placed on  being able to follow. In order to set an event to be a follower, you MUST place a comment as the FIRST line of a page and in the first line of the comment there must be the code: \cat_event

  ~Pass Through Solid Followers
    This addon to Zeriab's Caterpillar Script allows the player to walk through a Caterpillar event that is not set to through - this will make it so that the events are treated as non-through in all cases except the player walking through them. To enable this, you must set PASS_SOLID_FOLLOWERS below to true. You can also set the MUST_FACE_FIRST constant, which forces the player to face the event before being allowed to pass through the follower event. It's useful if you want to allow the player the opportunity to interact with the 1st follower event for whatever reason.

  ~Auto Change Graphic

This is a simple feature. If AUTO_CHANGE_GRAPHIC at line 73 is true, then the graphic of the caterpillar actors will automatically change to the current graphic of the actor it represents, regardless of what you have the graphic in the event set as. If you use silver wind's addon, then it MUST be set to true. This feature is also recommended if you use Composite Characters, in order to have them show up with all their added equipment.

Script

See the Demo to retrieve the script

Addons

Spoiler for silver wind's Auto Generate Party:
This is an addon originally written by silver wind for the RMXP version and ported to RMVX by me. Basically, it automatically generates events for all the actors in your party, so you don't need to put them in every map. If you do have an actor event in a map, then it will take priority. Note that if you do this, the events will not be interactable, and you won't be able to custom set things, like Stepping Animation or any of that special stuff, thus actors that are autogenerated will be less functional than events that are manually set up. Also, please note that for this script to work, you must set the constant AUTO_CHANGE_GRAPHIC to true in the main script. In any case, put the code underneath the Caterpillar script, but still above Main:

Code: [Select]
#==============================================================================
#    Silver Wind's AutoParty
#      Addon to Zeriab's Caterpillar Script
#    Version: 1.1
#    Author: silver wind (converted to RMVX by modern algebra)
#    Date: December 6, 2009
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:                                                                
#   * Now you don't have to create events for each party member, in every map.                                          
#    This script will create them automatically. You may create events for some
#    of the actors, and let this system add the missing events.                          
#   * If you ever need to know the id of the event used for a certain actor,
#    use:                                            
#       event_id = $game_map.cat_event_id(actor_id)
#==============================================================================

#==============================================================================
# ** Game_Map
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - setup
#    new methods - make_cat_events; new_cat_event; cat_event_id
#==============================================================================
    
class Game_Map
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Setup
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias silwer_wind_cat_game_map_setup setup
  def setup(*args)
    silwer_wind_cat_game_map_setup(*args)
    make_cat_events
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Make Caterpillar Events
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def make_cat_events
    # if the caterpillar event doesn't exist, create it
    all_actors = []
    for i in 1...$data_actors.size
      all_actors.push ($game_actors[i].id)
    end
    actor_events = []
    for event in @events.values
      actor_events.push (event.caterpillar_actor)if event.caterpillar_actor != nil
    end
    for actor_id in all_actors
      # add a new event for this actor
      new_cat_event(actor_id) if !actor_events.include? (actor_id)
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Create new Caterpillar Event
  #    actor_id : the ID of the actor to create event for
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def new_cat_event(actor_id)
    # create unique ID for the event
    ids = @map.events.keys  
    event_id = (ids.size==0) ? 1 : ((ids.max) +1)
    # Set the event on the upper-left corner
    new_event = RPG::Event.new(0,0)
    new_event.name = "EV#{event_id} \\cat_actor[#{actor_id}]"
    new_event.pages[0].priority_type = 1
    new_event.pages[0].graphic.pattern = 1
    l = @map.events.keys.length
    @map.events.keys[l]=event_id
    @map.events[event_id]=new_event
    game_event = Game_Event.new(@map_id, new_event)
    @events[event_id] = game_event
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Retrieve Caterpillar Event ID
  #    actor_id : the ID of the actor you want event ID for
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def cat_event_id(actor_id)
    for i in @events.keys
      return i if @events[i].caterpillar_actor == actor_id
    end
    return false
  end
end

class Game_Caterpillar
  AUTO_CHANGE_GRAPHIC = true    # DO NOT CHANGE
end

Credit:
  • silver wind
  • modern algebra

Credit


  • Zeriab
  • modern algebra

Thanks

  • Zero2008, for bug reports

Support


Post in this topic at rmrk.net for support.

Demo


Download Demo

Note that only the main script is included in the demo. If you want silver wind's addon, get it above.

Author's Notes


Credit for this script is attributed solely to Zeriab because I took a very hands-off approach to converting this script. I only removed or changed what was necessary to allow it to work in RMVX. This ended up not being fully the case as I did add a few features to the basic script (I imagine Zeriab would take offense if I attributed such sloppy code to him), but as these were minor applications of the code already written by Zeriab I should not take credit for those modifications. I do, however, accept blame for anything that doesn't work and will try my best to resolve any issues you might have with the script.
« Last Edit: March 17, 2010, 01:14:32 PM by modern algebra »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Updated this script to 1.1.

It should now work with Visual Equipment, and it has an added feature that actor caterpillar events can have their graphics autogenerated.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Not being good at life, I had forgotten to include functionality for the followers to dash when the player was dashing. I just added it now. In addition, the demo wasn't properly set up before, which is why there were people hanging out in the corners of the maps. That wasn't an error with the script, it was just me rushing the demo and not retesting after I took silver wind's addon out for distribution.

So, the demo is now fixed too.

**
Rep: +0/-0Level 82
Hey Modern Nice Job For Making This But I Got 1 Question....
Where Is The Link To The Demo?

-Thanks-

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
It's at the very end of the post, right above my signature and right below the Author's Notes section. I'll edit to include a hyperlink I suppose.

**
Rep: +0/-0Level 82
Thanks Modern:D

**
Rep: +0/-0Level 82
Sorry To Bug You Again :D
But This Keeps Buggin Me...
I'm Trying To Make An Event Folow Me But It Doesnt Work???
Can You Help Me Out

-Thanks-

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Well, umm - the ghost in the demo is an event. Make sure that it's set up like he is. It has to be the first comment on the page.

**
Rep: +0/-0Level 82
Oke So i Did This...
I Copied The Ghost From The Demo...
Then Pasted In My Own Game And Changed Event Graphic.
But Still Not Working Am I Missing Somthing?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Well, A) the switch that activates the caterpillar has to be ON - have you done that?

B) the event in the demo has to be on the second page before he will start following.

Does everything work in the demo?

**
Rep: +0/-0Level 82
Yes Every Thing Is Fine In The Demo  :D
So I Make An Switch And Call It Catipillar And Turn It On?

**
Rep: +0/-0Level 82
Never Mind Fixed It  :D

-Thanks-
« Last Edit: January 17, 2010, 07:19:09 PM by White Fang »

**
Rep: +0/-0Level 84
Current Project: RoSL
I must say I do like this caterpillar script. There's just one thing I'd like to see done, if possible.

I use Yanfly's Variable Dash Speed to set dashing to a more appropriate speed for my game. The problem arises with following characters. If the dash speed is set to anything but the default of 2x the trailing members will have jagged movement.

Example: I set the dash speed to be 1.5x (150 in the script's setup), and when the player dashes, the caterpillar members still try to go the normal 2x speed (so it seems) and they "run into" the player.

Any way to make the caterpillar recognize the new dash speed?


-Heart of Shadow-

"How can I be expected to save the world, when I can't even save myself?" --Sysolos(Return of a Shadow Lord)

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Hmm, try going to around line 59 in Yanfly's script and changing:

Code: [Select]
class Game_Player < Game_Character

to:

Code: [Select]
class Game_Character

That change makes it a little more likely to be incompatible with other scripts that affect movement, so you should put Yanfly's script above all your other custom scripts but still below the default scripts.

**
Rep: +0/-0Level 84
Current Project: RoSL
Awesome.

Runs smoothly now. (hah.. pun) Thanks for the help!


-Heart of Shadow-

"How can I be expected to save the world, when I can't even save myself?" --Sysolos(Return of a Shadow Lord)

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Updated to version 1.1c. Before, the caterpillar actors wouldn't disappear when the caterpillar switch was turned off. That is now fixed. Also, the PASS_SOLID_ACTORS feature now works for 8D movement, in case anyone is using a script for that or force 8D movement through move events.

**
Rep:
Level 84
I think there is a problem with Silverwind's Auto genereate addon cuz when you use it all together and stop walking on a map where the events are not present the following party members are shown with a walking sprite instead of a standing one...

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
You're right. Thanks for noticing that. The tall grass in my demo made it unnoticable for me :)

Anyway, to fix it, go to line 64 of the addon to see this:

Code: [Select]
   new_event.pages[0].priority_type = 1

Put a new line directly under it with this:

Code: [Select]
   new_event.pages[0].graphic.pattern = 1


Thank you for all your help and patience in working out the issues with me, Zero2008.
« Last Edit: February 23, 2010, 02:58:56 PM by Modern Algebra »

**
Rep:
Level 84
You're welcome!

And thank you for coming up with a solution to my diagonal movement dilemma!

**
Rep:
Level 84
Sry for double posting...

Uhh MA i have a question. Could it be possible to set the Silverwind add on to make the caterpillar events "Bellow hero"?

I know it's supposed to let you walk through, but when I put the scripts in the game, it only lets me walk through the caterpillar where the original caterpillar event is located if it's set to bellow hero.

Also in the map where the original caterpillar event is located when I stop walking the following member stays in a walking position again...

I think it might be one of the other scripts i am using...


Edit:
I figured our which script is messing with the Diagonal movement ones.
It appears that the add on or caterpillar script is not compatible with KGC's TilesetExtension script.
I hope this helps...


If you need a list of the ones I'm using then just say so and I'll have ready in no time!

thanks again!
« Last Edit: February 24, 2010, 10:12:11 PM by Zero2008 »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
No, I don't think the problem you mention is an incompatibility - it's intentional if it's occuring as a result of what I think you're doing. The event's stationary pose will be the one you set it to in its event, as with any other event. So, if you're  setting the graphic to a moving pose (or leaving it without a graphic), then when it's stationary it will return to that pose. I prefer to leave that much control open to the users of the script, since they could be using scripts that alter the way sprites are interpreted that may not have the middle pose be the one they want to use for stationary events, for instance.

So, to fix it, all you have to do is set it to the stationary pose of the sprite, or if you are using AUTO_CHANGE_GRAPHIC, to the stationary pose of any sprite.

However, if you want it to do it automatically, pasting in something like the following might work:

Code: [Select]
class Game_Event
  attr_writer   :original_pattern
end

Then go into the script around line 228 and see:

Code: [Select]
         rescue
            event.set_graphic ($game_actors[actor.id].character_name, $game_actors[actor.id].character_index)
          end

and put this line right below that end command:

Code: [Select]
         event.original_pattern = 1

**
Rep:
Level 84
Awesome!
But does this fix the walking through problem too?

Also where am I suppose to paste the first edit piece you gave me?
« Last Edit: March 02, 2010, 10:57:51 PM by Zero2008 »

*
Rep: +0/-0Level 82
I was just wondering if there was a way to use the character zoom script ( http://rmrk.net/index.php/topic,34543.0.html ) with this script.  Seeing as that script is around 8 lines and yours is quite a bit more, i was hoping maybe you would have a possible idea where to insert the call line in yours.

**
Rep: +0/-0Level 82
There is no end to learning!
I'm using Modern algebra's reserve party script and when I change the party order,it doesn't reflect in the caterpillar order.any solution?

P.S:Can I use this script for sharewares/commercial projects?
"A thing of beauty is a joy forever" - Keats

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
You'd have to PM Zeriab to see if you can use it in a commercial project - that determination I leave entirely to him. As for changing the party order, try to put this code in its own slot below the Reserve Party in the Script Editor:

Code: [Select]
#==============================================================================
# ** Game_Party
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - ma_switch_actor_order
#==============================================================================

class Game_Party
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Switch Party Order
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  if self.method_defined? (:ma_switch_actor_order)
    alias mlgb_zcat_irp_swtcpyordr_7uh1 ma_switch_actor_order
    def ma_switch_actor_order (*args)
      mlgb_zcat_irp_swtcpyordr_7uh1 (*args)
      $game_system.caterpillar.refresh
    end
  end
end

@b00radley - I may look into it in the future, but not right now - it's a matter of applying the same zoom to events; probably not hard

@Zero2008 - sorry I must have missed that the first time. To do it, go to the same place where you put:

Code: [Select]
   new_event.pages[0].graphic.pattern = 1

and place underneath it:

Code: [Select]
   new_event.pages[0].priority_type = 0
« Last Edit: March 04, 2010, 08:15:50 PM by Modern Algebra »