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
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 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:
#============================================================================== # 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
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.