Main Menu
  • Welcome to The RPG Maker Resource Kit.

Scrolls?

Started by Inferno, September 13, 2007, 10:50:40 PM

0 Members and 1 Guest are viewing this topic.

Inferno

i want scrolls that teach the user magic, i cant figure out how to do it
Bleach is bangin

Kokowam

Maybe link each scroll to a common event that will add a skill.

Inferno

yeah i kinda got that but i wat so only the member you pick gets it thats in your part
like if you have sparco(charter) and wings only one of them two...not angilus because you get her later
Bleach is bangin

Kokowam

That made no sense to me because I have no idea where the punctuation goes and who the characters you're talking about are.

Inferno

Quote from: Inferno on September 14, 2007, 01:03:11 AM
yeah i kinda got that but i wat so only the member you pick gets it thats in your part
like if you have sparco(charter) and wings only one of them two...not angilus because you get her later
yeah i kind of get get it.the thing i dont know is which charcter to choose.
lets say i have 2 members in my party,intotal lets say 4.i only want the one of the two charactes to learn it.How do i do that
Bleach is bangin

modern algebra

So you want to choose which character learns the ability? Well, as far as I know there's no really easy way to do that. You could make a selection scene using pictures, which isn't hard, but it probably looks sloppy. Here's what I'll do. I'll write a little scriptlet for that type of item. I don't have my computer (which has 3 complete scripts nearly ready to release and my assignment for Zeriab, not done yet, and one of them I did something similar for skill effects), as it is away on business. However, I do have RMXP, so we'll see what I can do from scratch.

Here:


#==============================================================================
# ** Data Item Teacher
#==============================================================================

class Data_Additional_Item_Effects
  #--------------------------------------------------------------------------
  # * Public Instance Variable
  #--------------------------------------------------------------------------
  attr_reader   :skill_teacher_effects
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    #----------------------------------------------------------------------
    # * Editable Region
    #----------------------------------------------------------------------
    #  For each item that you desire to teach a skill, merely place it in the
    #  array like this:
    #      [item_id, skill_id]
    #  where item_id is the ID of the item in the database which teaches
    #  the skill, and skill_id is the ID of the skill it teaches. By default,
    #  The 1st Item in the database (by default Potion) teaches the 5th skill
    #  in the database (by default Greater Remedy) and the 4th Item in the
    #  database (by default a Perfume) teaches the 2nd Skill in the database
    #  (by default, Greater Heal)
    #----------------------------------------------------------------------
    @skill_teacher_effects = [[1, 5], [4, 2]]
    #----------------------------------------------------------------------
    # * END Editable Region
    #----------------------------------------------------------------------
  end
end

#==============================================================================
# ** Game_Actor (Skill Teacher Modification)
#------------------------------------------------------------------------------
#  This class handles the actor. It's used within the Game_Actors class
#  ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================

class Game_Actor
  #--------------------------------------------------------------------------
  # * Item Effect
  #--------------------------------------------------------------------------
  #  Aliases Item Effect to add in the special effect
  #--------------------------------------------------------------------------
  def item_effect (item)
    # If item is a skill teacher effect
    for i in $data_additional_item_effects.skill_teacher_effects
      item_id, skill_id = i
      if item_id == item.id
        # Teach the skill to the actor
        learn_skill (skill_id)
        # Turn Used ON
        used = true
      end
    end
    # Run super method
    used |= super (item)
    return used
  end
end

#==============================================================================
# ** Scene_Title (Skill Teaching Item Modification
#------------------------------------------------------------------------------
#  This class performs title screen processing.
#==============================================================================

class Scene_Title
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  #  Aliases to intialize Data_Additional_Item_Effects
  #--------------------------------------------------------------------------
  alias add_new_data_item_effect main
  def main
    $data_additional_item_effects = Data_Additional_Item_Effects.new
    add_new_data_item_effect
  end
end


I don't know if it has bugs; it might. There is almost certainly a better way to execute this thing, but it is not something I'm concerned about. Naturally, the scope of the items you give this effect to should be towards an actor or all actors. It will not work on enemies (it shouldn't cause an error if you do though). Tell me if anything goes wrong, and I'll fix it.

Nightwolf

I haven't used Rpg in a while, but isn't there like "If Character pick up scroll then Skill bla bla to be gained?"
or am i just gone mad?
Arlen is hot.

modern algebra

There is, but if you want any character to be able to use the scoll to learn the skill, then you need a way to select which hero. Through events, this is quite a bit more complicated. The script allows you to select which hero learns the skill, rather then giving it to a preset hero.

Nightwolf

Oh, now i see.
I need to start over on this rpg stuff now.
Arlen is hot.

Inferno

srry hvent really been on ive been wrking on the game like crazy.
is this right?


Code:
#==============================================================================
# ** Data Item Teacher
#==============================================================================

class Data_Additional_Item_Effects
  #--------------------------------------------------------------------------
  # * Public Instance Variable
  #--------------------------------------------------------------------------
  attr_reader   :skill_teacher_effects
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    #----------------------------------------------------------------------
    # * Editable Region
    #----------------------------------------------------------------------
    #  For each item that you desire to teach a skill, merely place it in the
    #  array like this:
    #      [item_id, skill_id]
    #  where item_id is the ID of the item in the database which teaches
    #  the skill, and skill_id is the ID of the skill it teaches. By default,
    #  The 1st Item in the database (by default Potion) teaches the 5th skill
    #  in the database (by default Greater Remedy) and the 4th Item in the
    #  database (by default a Perfume) teaches the 2nd Skill in the database
    #  (by default, Greater Heal)
    #----------------------------------------------------------------------
    @skill_teacher_effects = [[1, 5], [4, 2]]
    #----------------------------------------------------------------------
    # * END Editable Region
    #----------------------------------------------------------------------
  end
end

#==============================================================================
# ** Game_Actor (Skill Teacher Modification)
#------------------------------------------------------------------------------
#  This class handles the actor. It's used within the Game_Actors class
#  ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================

class Game_Actor
  #--------------------------------------------------------------------------
  # * Item Effect
  #--------------------------------------------------------------------------
  #  Aliases Item Effect to add in the special effect
  #--------------------------------------------------------------------------
  def item_effect (item)
    # If item is a skill teacher effect
    for i in $data_additional_item_effects.skill_teacher_effects
      item_id, skill_id = i
      if item_id == item.id
        # Teach the skill to the actor
        learn_skill (095)
        # Turn Used ON
        used = true
      end
    end
    # Run super method
    used |= super (46)
    return used
  end
end

#==============================================================================
# ** Scene_Title (Skill Teaching Item Modification
#------------------------------------------------------------------------------
#  This class performs title screen processing.
#==============================================================================

class Scene_Title
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  #  Aliases to intialize Data_Additional_Item_Effects
  #--------------------------------------------------------------------------
  alias add_new_data_item_effect main
  def main
    $data_additional_item_effects = Data_Additional_Item_Effects.new
    add_new_data_item_effect
  end
end
Bleach is bangin

modern algebra

Ummm no.

The only part you should edit is the part within the editable region. If you want items 3, 4, and 8 to teach skills 7, 9, and 10 respectively, then that array would look like this:


@skill_teacher_effects = [[3, 7], [4, 9], [8, 10]]

And that's the only part you need to look at and edit. Do not touch any other part of the script.

Inferno

forget it is there a way only a certain charcter learns it
like i pick up pontus scroll....only pontus can learn it....is this possible
Bleach is bangin

modern algebra

Yeah, through events. Make a consumable item that has no stats but calls a common event. In that common event just have Pontus learn the skill using the Change Skills command. I hope you're not changing your mind because you think the script is too complicated. Because it is really really easy to use.

Inferno

ok got it...thatss simple i would try to use the script but i  dnt know how to use it
Bleach is bangin

modern algebra

Basically, this is the script:


#==============================================================================
# ** Data Item Teacher
#==============================================================================

class Data_Additional_Item_Effects
  #--------------------------------------------------------------------------
  # * Public Instance Variable
  #--------------------------------------------------------------------------
  attr_reader   :skill_teacher_effects
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    #----------------------------------------------------------------------
    # * Editable Region
    #----------------------------------------------------------------------
    #  For each item that you desire to teach a skill, merely place it in the
    #  array like this:
    #      [item_id, skill_id]
    #  where item_id is the ID of the item in the database which teaches
    #  the skill, and skill_id is the ID of the skill it teaches. By default,
    #  The 1st Item in the database (by default Potion) teaches the 5th skill
    #  in the database (by default Greater Remedy) and the 4th Item in the
    #  database (by default a Perfume) teaches the 2nd Skill in the database
    #  (by default, Greater Heal)
    #----------------------------------------------------------------------
    @skill_teacher_effects = [[1, 5], [4, 2]]
    #----------------------------------------------------------------------
    # * END Editable Region
    #----------------------------------------------------------------------
  end
end

#==============================================================================
# ** Game_Actor (Skill Teacher Modification)
#------------------------------------------------------------------------------
#  This class handles the actor. It's used within the Game_Actors class
#  ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================

class Game_Actor
  #--------------------------------------------------------------------------
  # * Item Effect
  #--------------------------------------------------------------------------
  #  Aliases Item Effect to add in the special effect
  #--------------------------------------------------------------------------
  def item_effect (item)
    # If item is a skill teacher effect
    for i in $data_additional_item_effects.skill_teacher_effects
      item_id, skill_id = i
      if item_id == item.id
        # Teach the skill to the actor
        learn_skill (skill_id)
        # Turn Used ON
        used = true
      end
    end
    # Run super method
    used |= super (item)
    return used
  end
end

#==============================================================================
# ** Scene_Title (Skill Teaching Item Modification
#------------------------------------------------------------------------------
#  This class performs title screen processing.
#==============================================================================

class Scene_Title
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  #  Aliases to intialize Data_Additional_Item_Effects
  #--------------------------------------------------------------------------
  alias add_new_data_item_effect main
  def main
    $data_additional_item_effects = Data_Additional_Item_Effects.new
    add_new_data_item_effect
  end
end


And as you can see, there are instructions here:


#----------------------------------------------------------------------
    # * Editable Region
    #----------------------------------------------------------------------
    #  For each item that you desire to teach a skill, merely place it in the
    #  array like this:
    #      [item_id, skill_id]
    #  where item_id is the ID of the item in the database which teaches
    #  the skill, and skill_id is the ID of the skill it teaches. By default,
    #  The 1st Item in the database (by default Potion) teaches the 5th skill
    #  in the database (by default Greater Remedy) and the 4th Item in the
    #  database (by default a Perfume) teaches the 2nd Skill in the database
    #  (by default, Greater Heal)
    #----------------------------------------------------------------------
    @skill_teacher_effects = [[1, 5], [4, 2]]
    #----------------------------------------------------------------------
    # * END Editable Region
    #----------------------------------------------------------------------


To sum it up, all you have to do is be able to use it is to modify this line:



@skill_teacher_effects = [[1, 5], [4, 2]]


Basically, [1, 5] means that Item 1 will teach skill 5 and [4, 2] means that Item 4 will teach skill 2. The numbers represent the Database IDs of the items and skills, respectively. If you go into the Database (the main editing tool, where you set everything up) and go to the Items and Skills Tabs, you will see that each item or skill has a number next to it. That is the ID of the item or skill. So, in the default, Item 1 is a Potion and Skill 5 is Greater Remedy, meaning that if you use Potion, the actor who you use it on will learn Greater Remedy. Item 4 is a perfume and Skill 2 is Greater Heal, and so using a Perfume on an actor will teach them Greater Heal.

If we wanted to add new items. Say, we make a Scroll as Item 33, and we want it to teach Skill 1: Heal, and that is the only item that should teach a skill, our array would look like this:


@skill_teacher_effects = [[33, 1]]


And then if we wanted to make another scroll as Item 34 and have it teach Skill 2: Greater Heal, our array would look like this:


@skill_teacher_effects = [[33, 1], [34, 2]]


And you can continue adding items to the array just like that

Inferno

aaah makes sence where should i place this though
Bleach is bangin

modern algebra

In a new slot in the script editor right above main