Announcement

Collapse
No announcement yet.

Capture a rare pet and make it follow you around, World clock, and show age [RMXP]

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Capture a rare pet and make it follow you around, World clock, and show age [RMXP]

    This will show you how to make a rare pet and show how it progresses through age.

    First of all you need to have a world clock system in place.
    If you don’t I will show you a simple one here.
    The pet can be what ever you like. I will use a dragon as an example.

    I will provide the graphics for this example but take no credit in the creation of any of them.




    These are some baby pics that you can use for the creature when it is starting out. There is also an adult dragon and sea creature.


    This tutorial will be based on the dragon pet; you can change it to what you like
    *Note. The battlers in the stock “rmxp” work well for middle aged pets.

    Make a new hero and name it Baby horned dragon put him at LVL: 7
    Use the red dragon monster character that is in rmxp

    Make a new class and call it pet
    You can make skills weapons or anything like that for your pet

    Next make an item and name it “dragon egg”
    Make the item so that you can’t do anything with it.

    Now that you have done this it is time to make the world clock.
    I have to say that is one of my favorite parts of my game, watching it turn into day and night.

    Time Specs:
    1 day = 24m
    1 month = 31d
    1 year = 12m
    You can alter these if you feel they are too long.

    Make a common event and call it “WORLD CLOCK”
    Make it a parallel process event to a switch, call the switch “clock” as well
    Put the switch on the map that you player is starting out on.
    This switch should also be parallel
    Make a switch called “World Clock” for this common event.


    The code is as follows:

    <>Conditional Branch: Switch [001: world clock] = = ON
    <>Erase Event
    <>
    Else Handler
    <>Switch: [002: noon] = ON
    <>Timer Operation: Start (24 Minutes and 1 Seconds)
    <>Switch: [001: world clock] = ON
    <>
    : End
    <>





    Now make a new switch called “Day”
    After that make another common event
    Name it “Day”
    It should be a parallel process to the switch “day”
    The code is as follows:

    <>Conditional Branch: Switch [002: Day Switch] = = OFF
    <>Change map settings: Fog = ‘002-Clouds01’, 0, 90, Normal, 27
    <>Fade out BGS: 10 Sec
    <>Play BGS: (*your choice, something like birds or a river*)
    <>
    : Else Handler
    <>Loop
    <>Play BGS: ‘Cricket’, 80, 90
    <>Wait: 20 Frames
    <>Play BGS: ‘Wind3’, 100, 150
    <>Wait: 100 Frames
    <>
    : Repeat
    <>
    : End
    <>




    Now make a switch called ‘noon’
    Next make a New Common Event called ‘Noon’
    It should also be parallel to the ‘noon’ switch

    The code is as follows:

    <>Conditional Branch: Timer Below 12 Minutes and 1 Seconds
    <>Play BGS: (*your choice, something you would hear in the morning*)
    <>Tint Screen: (0,0,-255,0), @200
    <>Conditional Branch: Timer Below 6 Minutes and 1 Seconds
    <>Switch: [002: Day] = ON
    <>Tint Screen: (-102, -153, 20, 170), @200
    <>Switch: [004: Night time activities] <--(*This is for any events that you would like to happen only at night time, all you have to do to so this is to make an event and have this switch checked in the prediction box, or you can use different pages so that an existing npc can say different things in the night*)
    <>
    : Else Handler
    <>
    : End
    <>
    : Else Handler
    <>
    : End
    <>




    For this New Common Event you need to first make it a parallel process event to the ‘Clock’ switch
    Make a new variable and call it ‘Days’
    Name the Common Event ‘Day Transition’
    The code is as follows:

    <>Conditional Branch: Timer Below 0 Minutes and 1 Second
    <>Variable: [001: Days] += 1
    <>Switch: [002: World Clock] = OFF
    <>Switch: [004: Night Time Activities] = OFF\
    <>Switch: [003: Day] = OFF
    <>Tint Screen: (0, 0, 0, 0), @200
    <>Play SE: ‘rooster-8, 80, 100
    <>Wait: 10 Frames
    <>Stop SE
    <>
    : Else Handler
    <>
    : End
    <>




    Make this New Common Event parallel to the ‘clock’ switch
    Name it “date control’
    *You can edit these dates if you want just change the variable values
    Make 3 New Variables
    1. Months
    2. Years
    3. age




    The code for this is as follows:

    <>Conditional Branch: Variable: [001: Days] >31
    <>Variable: [months] += 1
    <>
    : Else Handler
    <>Conditional Branch: Variable [002: Months] >12
    <>Variable: [003: Years] += 1
    <>Variable: [004: Age] += 1
    : Else Handler
    <>Conditional Branch: Variable: [004: Years] > (*how much years you want the game to go on for*)
    <>
    : Else Handler
    <>
    : End
    <>
    : End
    <>
    : End
    <>




    You need to make a switch called ‘dragon egg’
    This Common Event will make your dragon egg hatch.
    *Note the baby dragon cannot be in your party before the egg has hatched.

    Make it a parallel process trigger to a switch. (*the switch ‘dragon egg’*)
    The code is as follows:

    <>Conditional Branch: [Horned Dragon egg] possessed
    <>Conditional Branch: Variable [004: Age] = = 1
    <>Message: Your dragon egg has hatched!
    <>Change Items: [Horned dragon egg] – 1
    <>Play ME: ‘oo4-Victory04’, 100, 100
    <>Change Party Members: Add [Baby Horned Dragon] Initialize
    <>Switch: [00?: Dragon egg] = OFF*****
    <>
    : Else Handler
    <>
    : End
    <>






    Now to make the dragon progress in age
    Make this a parallel trigger to the ‘clock’ switch
    Call this New Common Event “Hero’s Age”
    This can also work for other player in your game to show age progression

    The code is as follows:

    <>Conditional Branch: Variable: [004: Age] = = (*input teen dragon’s age here*)
    <>Change Hero Name: [Baby Horned Dragon], ‘Horned Dragon’
    <>Change hero Graphic: [Baby Horned Dragon], 099-Monster13, 099-Monster13
    <>
    : Else Handler
    <>Conditional Branch: Variable: [004: Age] = = (* input adult dragon age here*)
    <>Change Hero Name: [Baby Horned Dragon], ‘Elder Horned Dragon’
    <>Change hero Graphic: [Baby Horned Dragon], 099-Monster13, 099-Monster13 (*Change Color*)
    <>
    : Else Handler
    <>Condition Branch: Variable [004: Age] = = (*input high rank dragon age here*)
    <>Change Hero Name: [Baby Horned Dragon], ‘Elite Dragon Defender ’
    <>Change hero Graphic: [Baby Horned Dragon], 099-Monster13, Copy of Monster
    <>
    : Else Handler
    <>
    : End
    <>
    : End
    <>
    : End
    <>






    You should have a working day and night system, a working date system, a working age system, and the ability to have a pet.


    ----------------------------------------------------------------------


    *Optional:
    If you want to actually catch a pet here is the way to do it.
    Make a monster of the pet you want in your game, (*don’t use the baby sprites because you need to get the egg from the monster*)
    Now Make a Monster group with the pet you want
    Next make a new skill called ‘hunt’
    This can be learned through level progression or given to the player from an NPC
    After this pick a location for you pet to be found or a bunch of the same creatures
    For an example: a map named; Dragon Canyon
    A map named: Serpents forest
    These would be maps where you would only find these creatures

    In this map create a new event and put the creature sprite you want as a pet

    There will be two pages to this pet.

    Page 1:
    Trigger should be hero touch
    Make a new variable called ‘Capture Pet’
    You can edit the variables so that there is a greater chance that you might catch the pet
    The code is as follows:

    <>Variable: [005: Capture Pet] = Random (1..200)
    <>Conditional Branch: Variable: [005: Capture Pet] = = 150
    <>Conditional Branch: Hero [hero name] [Hunt] usable
    <>Enemy Encounter: Horned Dragon
    <>Message: You found a Dragon egg!
    <>Change Items: [Horned Dragon egg] + 1
    <>Local Switch: A = ON
    <>
    : End
    <>
    : Else Handler
    <>Enemy Encounter: Horned Dragon
    <>Local Switch: A = ON
    <>
    : End
    <>








    Page 2:
    The local switch a prediction should be checked
    No Sprite graphic

    The code is as follows:

    <>Wait: 200 Frames
    <>Local Switch: A = OFF
    <>


    (*Essential for this to work*)
    enter this variable operation in a new or existing common event but the trigger must be parallel to the ‘clock’ switch.
    If you put it in an existing common event make sure it does not interfere with anything.

    The variable is as follows:
    Variable: [006: egg] = [Horned Dragon egg] possessed


    -------------------------------------------------------------------------------



    Script By: Fukuyama
    Script Name: Caterpillar System

    Instructions: Just right click on the menu in the script editor and click on the Insert button.
    This will bring up a clear space in your script editor, now all you need to do is copy this script directly into the large empty space you see next to the list.

    This script is separated into different parts if you want it to work properly you need to put the different parts into their own blank script space


    *My Note: If you start up the game when you are finished entering the script and it shows an error with all question marks this means that the game is recognizing the script. Just start it over and it should work properly.
    If an error comes up showing you a line that has a syntax error go the script editor and it will bring you directly to the line you need to fix, in most instances this line is blank

    Just type the word: end in this blank space and it should fix itself.


    If you want your pet to follow wherever you go, enter the following scripts into your script editor:







    Code:
    TRAIN_ACTOR_TRANSPARENT_SWITCH = true
    TRAIN_ACTOR_TRANSPARENT_SWITCHES_INDEX = 20
    # ------------------------------------
    DOWN_LEFT = 1
    DOWN_RIGHT = 3
    UP_LEFT = 7
    UP_RIGHT = 9
    JUMP = 5
    # ------------------------------------
    class Game_Party_Actor < Game_Character
    # ------------------------------------
    def initialize
    super()
    @through = true
    end
    # ------------------------------------
    def setup(actor)
    if actor != nil
    @character_name = actor.character_name
    @character_hue = actor.character_hue
    else
    @character_name = ""
    @character_hue = 0
    end
    @opacity = 255
    @blend_type = 0
    end
    # ------------------------------------
    def screen_z(height = 0)
    if $game_player.x == @x and $game_player.y == @y
    return $game_player.screen_z(height) - 1
    end
    super(height)
    end
    # ------------------------------------ 
    def move_down(turn_enabled = true)
    if turn_enabled
    turn_down
    end
    if passable?(@x, @y, Input::DOWN)
    turn_down
    @y += 1
    end
    end
    # ------------------------------------ 
    def move_left(turn_enabled = true)
    if turn_enabled
    turn_left
    end
    if passable?(@x, @y, Input::LEFT)
    turn_left
    @x -= 1
    end
    end
    # ------------------------------------
    def move_right(turn_enabled = true)
    if turn_enabled
    turn_right
    end
    if passable?(@x, @y, Input::RIGHT)
    turn_right
    @x += 1
    end
    end
    # ------------------------------------ 
    def move_up(turn_enabled = true)
    if turn_enabled
    turn_up
    end
    if passable?(@x, @y, Input::UP)
    turn_up
    @y -= 1
    end
    end
    # ------------------------------------
    def move_lower_left
    unless @direction_fix
    @direction = (@direction == Input::RIGHT ? Input::LEFT : @direction == Input::UP ? Input::DOWN : @direction)
    end
    if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::LEFT)) or
    (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::DOWN))
    @x -= 1
    @y += 1
    end
    end
    # ------------------------------------ 
    def move_lower_right
    unless @direction_fix
    @direction = (@direction == Input::LEFT ? Input::RIGHT : @direction == Input::UP ? Input::DOWN : @direction)
    end
    if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::RIGHT)) or
    (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::DOWN))
    @x += 1
    @y += 1
    end
    end
    # ------------------------------------ 
    def move_upper_left
    unless @direction_fix
    @direction = (@direction == Input::RIGHT ? Input::LEFT : @direction == Input::DOWN ? Input::UP : @direction)
    end
    if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::LEFT)) or
    (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::UP))
    @x -= 1
    @y -= 1
    end
    end
    # ------------------------------------
    def move_upper_right
    unless @direction_fix
    @direction = (@direction == Input::LEFT ? Input::RIGHT : @direction == Input::DOWN ? Input::UP : @direction)
    end
    if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::RIGHT)) or
    (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::UP))
    @x += 1
    @y -= 1
    end
    end
    # ------------------------------------
    def set_move_speed(move_speed)
    @move_speed = move_speed
    end
    end
    
    
    
    
    
    
    
    ----------------DO NOT ENTER THIS SEPERATION LINE---------------
    
    
    class Spriteset_Map
    # ------------------------------------
    def setup_actor_character_sprites?
    return @setup_actor_character_sprites_flag != nil
    end
    # ------------------------------------
    def setup_actor_character_sprites(characters)
    if !setup_actor_character_sprites?
    index_game_player = 0
    @character_sprites.each_index do |i|
    if @character_sprites.character.instance_of?(Game_Player)
    index_game_player = i
    break
    end
    end
    for character in characters.reverse
    @character_sprites.unshift(
    Sprite_Character.new(@viewport1, character)
    )
    end
    @setup_actor_character_sprites_flag = true
    end
    end
    end
    
    
    
    
    
    
    
    
    ----------------DO NOT ENTER THIS SEPERATION LINE---------------
    
    class Scene_Map
    # ------------------------------------
    def setup_actor_character_sprites(characters)
    @spriteset.setup_actor_character_sprites(characters)
    end
    end
    
    
    
    
    
    
    ----------------DO NOT ENTER THIS SEPERATION LINE---------------
    
    
    class Game_Party
    # ------------------------------------
    def set_transparent_actors(transparent)
    @transparent = transparent
    end
    # ------------------------------------
    def setup_actor_character_sprites
    if @characters == nil
    @characters = []
    for i in 1 .. 4
    @characters.push(Game_Party_Actor.new)
    end
    end
    if @actors_chach == nil
    @actors_chach = []
    end
    if @actors_chach != @actors
    @actors_chach = @actors.clone
    for i in 1 .. 4
    @characters[i - 1].setup(actors)
    end
    end
    if $scene.instance_of?(Scene_Map)
    $scene.setup_actor_character_sprites(@characters)
    end
    end
    # ------------------------------------
    def update_party_actors
    setup_actor_character_sprites
    transparent = $game_player.transparent
    if transparent == false
    if TRAIN_ACTOR_TRANSPARENT_SWITCH
    transparent = $game_switches[TRAIN_ACTOR_TRANSPARENT_SWITCHES_INDEX]
    else
    transparent = $game_player.transparent
    end
    end
    for character in @characters
    character.transparent = transparent
    character.set_move_speed($game_player.get_move_speed)
    character.update
    end
    end
    # ------------------------------------
    def moveto_party_actors( x, y )
    setup_actor_character_sprites
    for character in @characters
    character.moveto( x, y )
    end
    if @move_list == nil
    @move_list = []
    end
    for i in 0 .. 10
    @move_list = nil
    end
    end
    def move_party_actors
    if @move_list == nil
    @move_list = []
    for i in 0 .. 10
    @move_list = nil
    end
    end
    @move_list.each_index do |i|
    if @characters != nil
    case @move_list.type
    when Input::DOWN
    @characters.move_down(@move_list.args[0])
    when Input::LEFT
    @characters.move_left(@move_list.args[0])
    when Input::RIGHT
    @characters.move_right(@move_list.args[0])
    when Input::UP
    @characters.move_up(@move_list.args[0])
    when DOWN_LEFT
    @characters.move_lower_left
    when DOWN_RIGHT
    @characters.move_lower_right
    when UP_LEFT
    @characters.move_upper_left
    when UP_RIGHT
    @characters.move_upper_right
    when JUMP
    @characters.jump(@move_list.args[0],@move_list.args[1])
    end
    end
    end
    end
    
    
    
    
    
    
    
    
    ----------------DO NOT ENTER THIS SEPERATION LINE---------------
    
    
    
    
    
    class Move_List_Element
    # ------------------------------------
    def initialize(type,args)
    @type = type
    @args = args
    end
    def type() return @type end
    def args() return @args end
    end
    # ------------------------------------
    def add_move_list(type,*args)
    @move_list.unshift(Move_List_Element.new(type,args)).pop
    end
    # ------------------------------------
    def move_down_party_actors(turn_enabled = true)
    move_party_actors
    add_move_list(Input::DOWN,turn_enabled)
    end
    # ------------------------------------
    def move_left_party_actors(turn_enabled = true)
    move_party_actors
    add_move_list(Input::LEFT,turn_enabled)
    end
    # ------------------------------------
    def move_right_party_actors(turn_enabled = true)
    move_party_actors
    add_move_list(Input::RIGHT,turn_enabled)
    end
    # ------------------------------------
    def move_up_party_actors(turn_enabled = true)
    move_party_actors
    add_move_list(Input::UP,turn_enabled)
    end
    # ------------------------------------
    def move_lower_left_party_actors
    move_party_actors
    add_move_list(DOWN_LEFT)
    end
    # ------------------------------------
    def move_lower_right_party_actors
    move_party_actors
    add_move_list(DOWN_RIGHT)
    end
    # ------------------------------------
    def move_upper_left_party_actors
    move_party_actors
    add_move_list(UP_LEFT)
    end
    # ------------------------------------
    def move_upper_right_party_actors
    move_party_actors
    add_move_list(UP_RIGHT)
    end
    # ------------------------------------
    def jump_party_actors(x_plus, y_plus)
    move_party_actors
    add_move_list(JUMP,x_plus, y_plus)
    end
    end
    
    
    
    
    
    ----------------DO NOT ENTER THIS SEPERATION LINE---------------
    
    
    
    
    module Game_Player_Module
    # ------------------------------------
    def update
    $game_party.update_party_actors
    super
    end
    # ------------------------------------
    def moveto( x, y )
    super
    $game_party.moveto_party_actors( x, y )
    end
    # ------------------------------------
    def move_down(turn_enabled = true)
    if passable?(@x, @y, Input::DOWN)
    $game_party.move_down_party_actors(turn_enabled)
    end
    super(turn_enabled)
    end
    # ------------------------------------
    def move_left(turn_enabled = true)
    if passable?(@x, @y, Input::LEFT)
    $game_party.move_left_party_actors(turn_enabled)
    end
    super(turn_enabled)
    end
    # ------------------------------------
    def move_right(turn_enabled = true)
    if passable?(@x, @y, Input::RIGHT)
    $game_party.move_right_party_actors(turn_enabled)
    end
    super(turn_enabled)
    end
    # ------------------------------------
    def move_up(turn_enabled = true)
    if passable?(@x, @y, Input::UP)
    $game_party.move_up_party_actors(turn_enabled)
    end
    super(turn_enabled)
    end
    # ------------------------------------
    def move_lower_left
    if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::LEFT)) or
    (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::DOWN))
    $game_party.move_lower_left_party_actors
    end
    super
    end
    # ------------------------------------
    def move_lower_right
    if (passable?(@x, @y, Input::DOWN) and passable?(@x, @y + 1, Input::RIGHT)) or
    (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::DOWN))
    $game_party.move_lower_right_party_actors
    end
    super
    end
    # ------------------------------------
    def move_upper_left
    if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::LEFT)) or
    (passable?(@x, @y, Input::LEFT) and passable?(@x - 1, @y, Input::UP))
    $game_party.move_upper_left_party_actors
    end
    super
    end
    # ------------------------------------
    def move_upper_right
    if (passable?(@x, @y, Input::UP) and passable?(@x, @y - 1, Input::RIGHT)) or
    (passable?(@x, @y, Input::RIGHT) and passable?(@x + 1, @y, Input::UP))
    $game_party.move_upper_right_party_actors
    end
    super
    end
    # ------------------------------------
    def jump(x_plus, y_plus)
    new_x = @x + x_plus
    new_y = @y + y_plus
    if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y, 0)
    $game_party.jump_party_actors(x_plus, y_plus)
    end
    super(x_plus, y_plus)
    end
    # ------------------------------------
    def get_move_speed
    return @move_speed
    end
    end
    
    
    
    ----------------DO NOT ENTER THIS SEPERATION LINE---------------
    
    class Game_Player
    include Game_Player_Module
    end
    
    
    
    
    
    
    ----------------DO NOT ENTER THIS SEPERATION LINE---------------
    All the things separated need to go in different script spaces!!!
Working...
X