Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Zeriab's Caterpillar Script

Zeriab

Sponsor

Yes in a way since the actor graphic is used. If you change the actor's character graphic then it should change upon map change. You probably have to change the event's graphic manually though or use one of the following two commands in a call script after the graphic change:
Code:
$game_system.caterpillar.update
Code:
$game_system.caterpillar.refresh

If you want another graphic to show then the answer is currently no. (Well you can script it but it would be as a new feature and since the event graphic would be changed anyway there is not too much purpose)
If you are not talking about in relation with the Caterpillar script I would point to the Script Request or RGSS Support depending on the nature of what you want.

*hugs*
- Zeriab
 
I had intended it for a pet and owner system where the player could open the pet pen, run around with it in the party, then run back to it later, go to the tether pole and leave the pet back in the pen.
 

Zeriab

Sponsor

You can put the pet as a normal actor assuming you always have less than 4 other actors and then just add and remove the pet as fitting. When you remove an actor from the party the event associated with the actor should stop following you.

You may consider requesting a specific pet following system to bring more life to the pet. That would most likely give a better feeling.
 

Zeriab

Sponsor

Could you tell me what you have tried doing and how it does not work? (Does it give an error or is it just that nothing happens?)
 
Hi Zeriab...

I tried your script with XAS Hero Edition 3.2 and it's the only script which I got working without an error...
My problem is, that I can't see any character following my char... I think the problem is the XAS script, isn't it???

Is there any way to get this working??? Or is it impossible with this ABS script???

Would be nice, if ya can give me an answer...

Greetz,
Darkwonder
 
@DarkWonder

I was using this alongside XAS 3.2 aswell and I had it working fully and fine, so its deffinatly not a problem with the XAS system or anything... i'd check that all the things you've used in your game are the same as in Zeriabs demo, as it could be you've missed something out.

sorry i can't be of much more help though :(

but it does work fully with XAS ;)
 
Hi Drakan X,

thanx for ya reply...

I tried it once again, but for me it doesn't work...
I put an event on my map, with this "EV008\cat_actor[3]" as name.
Changed the switch inside of the script, made an event to activate the switch, but when I'm using it, only the event "EV008\cat_actor[3]" disappears, but there is no actor following me. :(

Maybe there's more I need to activate or change I forgot?
 

Zeriab

Sponsor

Do you have the actor with id 3 (in the database) in your party?
You must have that actor in your party and it must not be the hero.
 
Ahh yess... i remember now, i did have that same problem when i started usig this :P

i just made sure thre was an actor in the database with the same id mentioned in the event, then made a short autorun event on my map that put that actor in my party, then i worked fine :D

if u do that it should work XD
 
Okay... that was the mistake... ;)
Now I can see the character and it appears beside the event I was activating, but it won't follow me.. ;)
Is it also a stupid mistake? Or won't it work for me? ;)
 

Zeriab

Sponsor

You have to create events for each actor in the house. You have to do it for every map you can have your caterpillar on.
This is one of the drawbacks of this script compared to other caterpillar script. It requires a lot of work.
It also gives you more freedom since the event will be running normally so you easily have the actors in the caterpillar act differently on each map.

*hugs*
- Zeriab
 

Zeriab

Sponsor

silver wind has been so kind to make an add-on to my caterpillar script which creates events for the actors in the party which does not already have an event!

[ruby]# ---------------------------------------------------------- #
#     Add-on to Zeriab's caterpillar script                  #
# ---------------------------------------------------------- #
#  made by silver wind                                       #
#                                                            #
#    Instructions                                            #
#  * 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.            #
#  * Using ccoa's UMS, add \actor[id] in a message to        #
#    center a message above this actor.                      #
#  * 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)            #
# ---------------------------------------------------------- #
# Example- how to make new event:
#  sprite = "_mainHero10"
#  name = "EV000:SomeName"
#  through = false
#  $game_map.new_event(name, sprite, through)
# ---------------------------------------------------------- #
   
class Game_Map
  alias silwer_wind_cat_game_map_setup setup
  def setup(*args)
    silwer_wind_cat_game_map_setup(*args)
    make_cat_events
  end
 
  def make_cat_events
    # if the caterpillar event doesn't exist, create it
    party = $game_party.actors.dup
    # Remove the first element- it's the player.
    party.shift
    for actor in party
      if (!cat_event_exist?(actor.id) )
        # add a new event for this actor
        new_cat_event(actor.id)
      end
    end
  end
 
  def cat_event_exist?(id)
    # Check for caterpillar actor id
    for i in @map.events.keys
      if @events.caterpillar_id == id
        return true
      end
    end
    # if no event has that id
    return false
  end
 
  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 = "EV00" + event_id.to_s + "\\" + "cat_actor[" + actor_id.to_s + "]"
    # set the graphic of the event to be the actor's sprite.
    sprite = $data_actors[actor_id].character_name
    new_event.pages[0].graphic.character_name = sprite
    # set event to through
    new_event.pages[0].through = true
    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
 
  def new_event(name, sprite, through)
    # create unique ID for the event
    event_id = @map.events.keys.max + 1
    # find an empty tile to place the event on.
    new_event = RPG::Event.new(0,0)
    new_event.name = name.nil? ? "EV00" + event_id.to_s  : name
    new_event.pages[0].graphic.character_name = sprite
    new_event.pages[0].through = through
    # now, create a map event from the new RPG::Event
    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
 
  # return : ID of the event used for this actor
  def cat_event_id(actor_id)
    for i in @map.events.keys
      if @events.caterpillar_id == actor_id
        return i
      end
     end
  end
end
 
class Game_Event
  def caterpillar_id
    # Copied from the caterpillar script
    # search for \cat_actor[id] in event's name, return the id or nil.
    @event.name.gsub(/\\cat_actor\[([0-9]+)\]/i) {@caterpillar_actor = $1 }
    # Check if an valid denomination is found.
    if @caterpillar_actor.is_a?(String)
      id = @caterpillar_actor.to_i
      if $data_actors[id].nil?
        id = 0
      end
      return id
    end
    return nil
  end
end
 
# ---------------- edit Ccoa's UMS -------------------------#
#  Use \actor[id] in a message to show it above this actor. #
#  * Useful if the actor event was created automatically.   #
#    You can't use \e 
 
How can I make compatible with

Dargor's Party Changer script ?

can you help me ?

viewtopic.php?f=156&t=23508&hilit=+party
 

Zeriab

Sponsor

I just tested it and I found no compatibility problems with Dargor's Party Changer script ?_?
If you place the Caterpillar script after Dargor's script you can change the MAX_ACTOR constant to:
[ruby]  MAX_ACTORS = Dargor::Large_Party::Max_Size
[/ruby]

That way you only have to change the max size of the party in Dargor's script.
 
okay.. thanks for ur reply

but i still have problem maybe i didnt understand how to use ur scrip perfectly

i put ur caterpillar script under Dargor's party changer script

there was no error but the party members didnt appear

of course i turned swich 23 on

and second, i heard that ur caterpillar system uses event as a party member. can u further explain about this ?

THANKS !
 

Zeriab

Sponsor

It's good that you have turned switch 23 on ^^
You must create events and put something in the name of those events
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 can also try using silwer wind's add-on: viewtopic.php?f=11&p=639063#p639063
Should you not have created an event for each possible actor on that map the add-on should take care of create and add the events for you.

*hugs*
- Zeriab
 
Thank you Zeriab !

Almost everything works well now

I also added ur additional script that make event automatically.

but when I play the game

there are only 4 actors following although i set max actor as 9

can U help me with this ?

and also, if I change the arrange the arrange of the party member doenst change..

I'll wait for ur help again

THANKS !~
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top