Jump to content

Announcing our new website

To find out the latest about our new website, visit Game Dev Unlimited

- - - - -

Zeriab's Caterpillar Script


  • You cannot reply to this topic
5 replies to this topic

#1 Zeriab

    Loyal Member

  • Member
  • 186 posts

Posted 25 August 2008 - 06:06 PM

Zeriab's Caterpillar Script
Version: 1.0


Introduction

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.

Screenshot

Posted Image

Demo

Currently I can only present a demo which includes Wachunga's Multiple Message Windows which requires SDK 1.5: http://www.sendspace.com/file/s5hkl7
This is because Wumpi and Despain requested it to work with that message system. (Only the caterpillar script is my work. I had nothing to do with the rest)

Script

http://zeriab.plesk3.freepgs.com/root/scri...pillar-v1.0.txt

Instructions

There are instructions in the header, but they might be hard to understand.
I have tried to break down the instructions so they hopefully are easier to understand.

Big and evil instructions

The script uses map events with special tags in their name.
The map events are tied to specific actors.
If you want an event to represent the actor with id 1 in the database then somewhere in the name of the event put this: \cat_actor[1]
If you want an event to represent the actor with id 19 then use this instead: \cat_actor[19]
Basically you put in \cat_actor[id of actor] in the name of the event in question.
Note that you need to do this for every map. Yes, a lot of work.

You copy the script and paste it just above main. (I.e. you open the script editor, scroll to the bottom of the left form, click on main, press insert and paste the script into the right form)

In the script pay attention to the area just below the script header:
#==============================================================================
class Game_Caterpillar
  CATERPILLAR_ACTIVE_SWITCH = 23
  REMOVE_VISIBLE_ACTORS = true
  MAX_ACTORS = 4
  #--------------------------------------------------------------------------

This is the area of script where you can customize the script. I will go through each of the lines and explain what they do:

CATERPILLAR_ACTIVE_SWITCH = 23
This line will allow you to control whether the caterpillar is active or not by specifying a switch.
By default you can see that we have CATERPILLAR_ACTIVE_SWITCH = 23 which means you can turn the caterpillar ON and OFF by turning switch 23 ON and OFF.
Notice that switch 23 by default start on OFF and you must turn the switch ON before the caterpillar 'works'.
Feel free to change the number 23 to any number you want, i.e. which switch you want.
If you for example want to use switch 0169 instead it should be CATERPILLAR_ACTIVE_SWITCH = 169.

REMOVE_VISIBLE_ACTORS = true
This determines whether events for actors not currently in the party should be erased or not.
You can set this to a number like REMOVE_VISIBLE_ACTORS = 21 if you want to specify it with a switch. In this example you can turn it ON and OFF by turning switch 21 ON and OFF.

MAX_ACTORS = 4
I believe this is self-explonatory. Only change this if you can have more than 4 actors. No harm is done if you have a lower max.

A little word of caution: Do not put leading 0's in front of numbers in ruby. The reason is that Ruby considers numbers with leading 0's as octadecimal. I.e. 0, 1, 2, ... , 6, 7, 10, 11, ... No 8 nor 9. So for example 15 oct = 13 and 8 oct and 9 oct gives an error.


Here are two call scripts you can use if you feel the caterpillar isn't updated properly like problems with the graphic. Also highly useful should you have custom scripts and need to tell the caterpillar script has changed: (The call script is the event command on the bottom-right of page 3)

This will update the caterpillar to make sure the right events and right graphics are used.
$game_system.caterpillar.update

This will refresh the caterpillar which pretty much 'starts on a fresh'. All the events will be placed the same place as the player. As if you were teleported. Only use this if the update don't work.
$game_system.caterpillar.refresh


FAQ

Why did you make a caterpillar script when so many are around?
Despain requested a script that worked with a particular message script and Wumpi requested a script which used map events.
It didn't seem like there was such a caterpillar script out there although I admittedly didn't search hard.
So I made this believing it would work differently from other caterpillars scripts.

How do you get the events to act differently when they walk in the caterpillar and when they don't?
Create a page which has the caterpillar activation switch as precondition. If that is the top page (the one with the highest number) then that will be the event's functionality when in the caterpillar.
If you have problems with the graphic of some events not being what they are supposed to be then add a 1 frame wait and a script call:
$game_system.caterpillar.update
This should solve the problem. The 1 frame wait is necessary or the page change will not have been registered before the update and the result is the same.

The caterpillar made me stuck
Set the events of the caterpillar to Through. (Options area to the lower right)

Compatibility

This script will most likely not work with any other caterpillar system.
Saves made with this caterpillar script cannot be used should you remove it again. (Saves without it will work with it)
It should work both without and with the SDK and I believe it should with both SDK 1.x and SDK 2.x although I have only tested SDK 1.5.

Credits and Thanks

Credits goes to Zeriab for creating the system

I would like to thank Despain and Wumpi for requesting the script.
I would like to thank everyone using their time to try and use my system.
I would like to thank everyone reading this topic.

Thanks.

Author's Notes

I would be delighted if you report any bug, errors or issues you find.
In fact I would be delighted if you took the time and replied even if you have nothing to report.
Suggestions are more than welcome

And finally: ENJOY!

- Zeriab

#2 Heretic86

    Extreme Member

  • Member
  • 262 posts

Posted 11 October 2011 - 12:25 PM

Sorry for the necropost, but I have to say that this script is abolutely awesome!

Since your post, even if it is old, requests comments, I'll be more than happy to make a few.

First off, a question about the script. At a certain point, I've found it useful to temporarily pause the caterpillar, like during cutscenes. I was able to manipulate the script so that I could pause the caterpillar, run a cutscene where all the actors move around, and when the caterpillar is unpaused, the actors dont run around and follow all of the movement evetns registered during the cutscene. So that part I added in is working fine.

What I'd like to do now is to get rid of one or two of the last move events, but I am stuck on how to do that. Basically what I have is a style that I am trying to stay consistent to. The main actor walks on a bridge, then automatically backs up using an event, and the bridge falls away. Once the player takes control of the main actor again, everyone else in the caterpillar walks over that bridge that just fell away as if it were still there, so my solution was to delete those registered move events, but Im banging my head aginst a wall getting it to work.

How can I implement a command like $game_system.caterpillar.delete_last_move so that the rest of the actors in the caterpillar continue on and ignore the last move the actor makes and dont follow his path into the now defunct area, while still maintaining the illusion that the caterpillar was never altered?

---

Bug: Only found one behavior that appears buggy. Non caterpillar actors with random move events can move over the actors in the caterpillar. I know a guy named Modern Algebra (rmrk.net) was able to fix that with a modified version of the script updated for VX, but it isnt compatible. Any way of incorporating that into the XP version?

He did have one other cool new feature in his modification, which was to allow a "ghost follower", basically a non party member, used for like escort missions and what not. Not essencial, but pretty neat.

#3 Kiriashi

    Activity Whore

  • RMXPU Legend
  • PipPipPipPipPipPipPipPipPipPip
  • 4,486 posts

Posted 11 October 2011 - 06:57 PM

A necropost is one thing but a three year necropost... =.=

Alas, your post was more than a thankyou so we'll let it slide..


Anyways, Zeriab has left the RPG Maker Scene quite a few months ago. :<

He still pops around now and then, but chances are he's not going to work on this script again.

#4 Heretic86

    Extreme Member

  • Member
  • 262 posts

Posted 11 October 2011 - 10:21 PM

View PostKiriashi, on 11 October 2011 - 06:57 PM, said:

A necropost is one thing but a three year necropost... =.=

Alas, your post was more than a thankyou so we'll let it slide..


Anyways, Zeriab has left the RPG Maker Scene quite a few months ago. :<

He still pops around now and then, but chances are he's not going to work on this script again.

Thats quite a shame as his community contributions are incredible! But, I understand. People want to move on to bigger and more satisfying things in their lives. So, is this the right place for Support, or is that in another sub-forum?

#5 Kiriashi

    Activity Whore

  • RMXPU Legend
  • PipPipPipPipPipPipPipPipPipPip
  • 4,486 posts

Posted 11 October 2011 - 10:38 PM

Well the ironic thing is that... he just posted a few hours ago:

http://www.rmxpunlim...dpost__p__67306

And to make things even more ironic, something related to character following.

But you should make a new topic in the parent forum.

#6 Heretic86

    Extreme Member

  • Member
  • 262 posts

Posted 13 November 2011 - 10:12 AM

I added 3 features to make this script more Cutscene Friendly. Still looking for anyone to figure out how to prevent NPC's with move events from moving through the other Actors in the Caterpillar, then, this script will be perfect!

Spoiler


Feature 1: Caterpillar Pause

Turning the Caterpillar Active Switch ON and OFF causes all Cat Actors to snap on top of the Players Sprite, which is bad during cutscenes. If you use Caterpillar Pause (I set it as 22 Default, Customizable), you can move all the Actors including the Player around during cutscenes and have them get back into a Caterpillar without that snap on top of the player. Looks natural.

Feature 2: Clear Moves

Call with $game_system.caterpillar.clear_moves

Feature erases all of the recorded events that the Cat Actors have not executed yet. This is useful during cutscenes when you turn Caterpillar Pause ON in one location, the OFF in another location, the Cat Actors try to move to the old locations stored before going to your new updated location. Looks buggy. This dumps the whole move list. You can fake the caterpillar with events, or just allow the player to take control, although there will be a one step lag if you dont event new steps to follow

Feature 3:

Delete Last Move (del_last_move)

Call with $game_system.caterpillar.del_last_move

Useful if the Player steps someplace that you do not want the rest of the Caterpillar Actors to move to, such as a bridge that falls away. This is tricky to explain. Let's go with the Bridge example. When the player steps onto the bridge, even if you turn Cat Pause on there, the Cat Script will still register that move onto the tile that you dont want the cat actors to follow. Its unavoidable. All you can do is delete the last recorded move, then use an event to have each actor in the Caterpillar take one step backwards. Caterpillar remains active and controlled by the player, except for the stepping backwards part.

Now, if we can fix the script to prevent NPC's with move events from being allowed to pass thru the other Cat Actors...

Edited by Heretic86, 13 November 2011 - 10:13 AM.






0 user(s) are reading this topic

members, guests, anonymous users