class Game_Character #-------------------------------------------------------------------------- # Public instance variables #-------------------------------------------------------------------------- attr_accessor :priority_type end
class Game_Player #-------------------------------------------------------------------------- # Public instance variables #-------------------------------------------------------------------------- attr_reader :move_speed #-------------------------------------------------------------------------- # Update #-------------------------------------------------------------------------- alias pet_game_player_update update unless $@ def update $game_party.update_pet pet_game_player_update end #-------------------------------------------------------------------------- # Move to #-------------------------------------------------------------------------- alias pet_game_player_moveto moveto unless $@ def moveto(x, y) $game_party.moveto_pet(x, y) pet_game_player_moveto(x, y) end #-------------------------------------------------------------------------- # Move down #-------------------------------------------------------------------------- alias pet_game_player_move_down move_down unless $@ def move_down(turn = true) if passable?(@x, @y + 1) $game_party.move_pet(2, turn) end pet_game_player_move_down(turn) end #-------------------------------------------------------------------------- # Move left #-------------------------------------------------------------------------- alias pet_game_player_move_left move_left unless $@ def move_left(turn = true) if passable?(@x - 1, @y) $game_party.move_pet(4, turn) end pet_game_player_move_left(turn) end #-------------------------------------------------------------------------- # Move right #-------------------------------------------------------------------------- alias pet_game_player_move_right move_right unless $@ def move_right(turn = true) if passable?(@x + 1, @y) $game_party.move_pet(6, turn) end pet_game_player_move_right(turn) end #-------------------------------------------------------------------------- # Move up #-------------------------------------------------------------------------- alias pet_game_player_move_up move_up unless $@ def move_up(turn = true) if passable?(@x, @y - 1) $game_party.move_pet(8, turn) end pet_game_player_move_up(turn) end #-------------------------------------------------------------------------- # Move down left #-------------------------------------------------------------------------- alias pet_game_playermove_lower_left move_lower_left unless $@ def move_lower_left if passable?(@x - 1, @y + 1) $game_party.move_pet(1) end pet_game_playermove_lower_left end #-------------------------------------------------------------------------- # Move down right #-------------------------------------------------------------------------- alias pet_game_playermove_lower_right move_lower_right unless $@ def move_lower_right if passable?(@x + 1, @y + 1) $game_party.move_pet(3) end pet_game_playermove_lower_right end #-------------------------------------------------------------------------- # Move up left #-------------------------------------------------------------------------- alias pet_game_player_move_upper_left move_upper_left unless $@ def move_upper_left if passable?(@x - 1, @y - 1) $game_party.move_pet(5) end pet_game_player_move_upper_left end #-------------------------------------------------------------------------- # Move up right #-------------------------------------------------------------------------- alias pet_game_player_move_upper_right move_upper_right unless $@ def move_upper_right if passable?(@x + 1, @y - 1) $game_party.move_pet(7) end pet_game_player_move_upper_right end #-------------------------------------------------------------------------- # Jump #-------------------------------------------------------------------------- alias pet_game_player_jump jump unless $@ def jump(pet_x, pet_y) new_x = @x + pet_x new_y = @y + pet_y if (pet_x == 0 and pet_y == 0) or passable?(new_x, new_y) $game_party.move_pet(9, [pet_x, pet_y]) end pet_game_player_jump(pet_x, pet_y) end end
class Spriteset_Map #-------------------------------------------------------------------------- # Create characters #-------------------------------------------------------------------------- alias pet_spriteset_map_create_characters create_characters unless $@ def create_characters pet_spriteset_map_create_characters @character_sprites << Sprite_Character.new(@viewport1, $game_party.pet) end end
To use: setup the enable switch and the pet ID (top of the script) NOTE: The pet ID refers to the ID of an actual actor in the database, but only the walking graphic needs to be set.
class Game_Character #-------------------------------------------------------------------------- # Public instance variables #-------------------------------------------------------------------------- attr_accessor :priority_type end
class Game_Player #-------------------------------------------------------------------------- # Public instance variables #-------------------------------------------------------------------------- attr_reader :move_speed #-------------------------------------------------------------------------- # Update #-------------------------------------------------------------------------- alias pet_game_player_update update unless $@ def update $game_party.update_pet pet_game_player_update end #-------------------------------------------------------------------------- # Move to #-------------------------------------------------------------------------- alias pet_game_player_moveto moveto unless $@ def moveto(x, y) $game_party.moveto_pet(x, y) pet_game_player_moveto(x, y) end #-------------------------------------------------------------------------- # Move down #-------------------------------------------------------------------------- alias pet_game_player_move_down move_down unless $@ def move_down(turn = true) if passable?(@x, @y + 1) $game_party.move_pet(2, turn) end pet_game_player_move_down(turn) end #-------------------------------------------------------------------------- # Move left #-------------------------------------------------------------------------- alias pet_game_player_move_left move_left unless $@ def move_left(turn = true) if passable?(@x - 1, @y) $game_party.move_pet(4, turn) end pet_game_player_move_left(turn) end #-------------------------------------------------------------------------- # Move right #-------------------------------------------------------------------------- alias pet_game_player_move_right move_right unless $@ def move_right(turn = true) if passable?(@x + 1, @y) $game_party.move_pet(6, turn) end pet_game_player_move_right(turn) end #-------------------------------------------------------------------------- # Move up #-------------------------------------------------------------------------- alias pet_game_player_move_up move_up unless $@ def move_up(turn = true) if passable?(@x, @y - 1) $game_party.move_pet(8, turn) end pet_game_player_move_up(turn) end #-------------------------------------------------------------------------- # Move down left #-------------------------------------------------------------------------- alias pet_game_playermove_lower_left move_lower_left unless $@ def move_lower_left if passable?(@x - 1, @y + 1) $game_party.move_pet(1) end pet_game_playermove_lower_left end #-------------------------------------------------------------------------- # Move down right #-------------------------------------------------------------------------- alias pet_game_playermove_lower_right move_lower_right unless $@ def move_lower_right if passable?(@x + 1, @y + 1) $game_party.move_pet(3) end pet_game_playermove_lower_right end #-------------------------------------------------------------------------- # Move up left #-------------------------------------------------------------------------- alias pet_game_player_move_upper_left move_upper_left unless $@ def move_upper_left if passable?(@x - 1, @y - 1) $game_party.move_pet(5) end pet_game_player_move_upper_left end #-------------------------------------------------------------------------- # Move up right #-------------------------------------------------------------------------- alias pet_game_player_move_upper_right move_upper_right unless $@ def move_upper_right if passable?(@x + 1, @y - 1) $game_party.move_pet(7) end pet_game_player_move_upper_right end #-------------------------------------------------------------------------- # Jump #-------------------------------------------------------------------------- alias pet_game_player_jump jump unless $@ def jump(pet_x, pet_y) new_x = @x + pet_x new_y = @y + pet_y if (pet_x == 0 and pet_y == 0) or passable?(new_x, new_y) $game_party.move_pet(9, [pet_x, pet_y]) end pet_game_player_jump(pet_x, pet_y) end end
class Spriteset_Map #-------------------------------------------------------------------------- # Create characters #-------------------------------------------------------------------------- alias pet_spriteset_map_create_characters create_characters unless $@ def create_characters pet_spriteset_map_create_characters @character_sprites << Sprite_Character.new(@viewport1, $game_party.pet) end end
To use: setup the enable switch and the pet ID (top of the script) NOTE: The pet ID refers to the ID of an actual actor in the database, but only the walking graphic needs to be set.
Sorry how do u use this im nwe to RPG maker VX and well im really not taht good could you please make a tiny beginers guild of how to use this thanks i would be truly grateful and thank you fro the scrpit
Update (per Woratana's question): this script IS compatible with Trickster's caterpillar script (the one I use) However, if you use both, the pet will overlap the first actor in the caterpillar.
There is a fix though: find and replace the line I specified with the code below it ....
CODE
#-------------------------------------------------------------------------- # Update Followers #-------------------------------------------------------------------------- def update_followers flag = $game_player.transparent || $game_switches[CATERPILLAR] @followers.each_with_index do |char, i| char.actor = @actors[i + 1] <======= replace this line with the code below
if $game_switches[1] and i == 0 char.actor = @actors[i + 6] elsif $game_switches[1] char.actor = @actors[i] else char.actor = @actors[i + 1] end
... where the switch specified is the same switch specified in the Pet Script AND the number "6" is the actor ID of a blank actor EDIT: you also need to increase the caterpillar size by 1 to make room for the blank character (where the pet will appear)
@ Kakeru 1) insert the script in the materials section above main in the script window 2) specify the switch and the pet ID at the top of the script (change them to fit your game) 3) turn on the switch in the game (using an event command) to activate the pet (or switch off to deactivate)
This post has been edited by originalwij: Dec 11 2008, 01:45 PM
Group: Member
Posts: 34
Type: Event Designer
RM Skill: Beginner
Am I missing something? What does it actually do? Like does the pet fight in battle? I may sound like a complete tard for asking, but for some odd reason I can't figure out what the script is for. Well, besides pets, but what about the pets? Like do they follow you? Fight for you? Join your party? Do you have to feed them & take care of them? I'm really lost. All i know is that it's a script about pets, but no one said what it does.
@Oralom it just adds the pet to follow you, without being in the party, that's it. the pet in this script does nothing. I scripted it as a request. it's up to you to add scripts/events to make it do what you want it to (ex. auto-battle in a party, find items, etc.)
i'm not sure if it could be converted to XP or not. i've never worked with XP (went from 2003 to VX) but, if someone else can port it to XP, you have my permission ...
Group: Member
Posts: 56
Type: None
RM Skill: Advanced
I've been looking for a script like this for a really long time. Thanks originalwij! I have a question though. Is there a way to allow more than one pet? Like if I have a princess that follows you at one point of the game, and a dog that follows you at another point, is there a way to do that and have different switches activate each one?
@nobodyreal just change the graphic for the pet (actor) using the corresponding event command to do so. that way you could have unlimited pets (actors) (just not at the same time)
@kamster94 try pasting it into Notepad/Wordpad first .... (usually works) (if not i'll post a demo, let me know)
Group: Member
Posts: 77
Type: Event Designer
RM Skill: Advanced
Is it possible to disable the jump for the pet (I have a huge bird for a pet, but I was having difficulty figuring this out), preferably with a switch or variable so that in some cases, I can enable the jump?
Here is the results of some personality quiz I have no idea about: "You are helium. After hydrogen, helium is the most abundant element in the universe. Helium is stable. Chemically speaking, it tends to keep to itself, with no real inclination to react with other elements. Helium is a gas that is lighter than air. Helium has the lowest melting point of any element. The melting point is so low that it would not solidify even at absolute zero under ordinary pressure."
After doing this personality quiz, it became apparent that I need a life....
[Show/Hide] VX Mini Tutorial: How to check the leader of the party
Create a condition branch. Go to page 4 of this condition branch and select script. Type in this:
CODE
$game_party.members[#] == $game_actors[#]
Change the # in $game_party.members[#] to whichever party member you want to check (0 = leader, 3 = 4th member). Change the # in $game_actors[#] to whatever actor you want to check (from the database. (according to the actor id number) 1 = first person in database)
If I'm not being helpful, don't shoot me. I'm still Canadian.