[XP] Skill Items

Started by G_G, May 05, 2009, 07:57:42 pm

Previous topic - Next topic

G_G

May 05, 2009, 07:57:42 pm Last Edit: May 10, 2009, 02:04:23 am by Youngster Gi Gi
Skill Items
Authors: game_guy
Version: 1.0
Type: Skill Teaching Items
Key Term: Misc Add-on



Introduction

FIRST OF ALL
WILL BE AVAILABLE IN TONS OF ADD ONS

Items now teach actors skills!


Features


  • Items that teach actors skills.




Screenshots

Spoiler: ShowHide
The actors skills before the item

The item used on the actor

The actors skills after the item



Demo

Demo


Script

Script
Spoiler: ShowHide

=begin
#==============================================================================#
# Script : Skill Items                                                         #
# Auther : Game_Guy                                                            #
# Version : 1.0                                                                #
#==============================================================================#

Intro:
Makes items teach players skills.

Instructions:
First go in the database, go to the System Tab and make a new element id and name
it Skill Item. Come back in here and change the 17 below in the module to the id
of the element you just made.

Now go further below and you'll see
# CONFIG use
follow those instructions to set skills to item id's. Then you're set.

One more thing, in items, the ones that are skill items make sure to mark the
element id that you chose in the Elements or else it wont work.

Features:
Makes items teach actors skills.
=end

module GameGuy
  ElementId = 17 # The elemental id in the System tab
end

module RPG
  class Item
    def skill
      case id
      # CONFIG use
      # when x return y
      # x = item id, y = skill id
      # when 2 then return 13
      # The above will make item id 2 make an actor learn the skill id of 13
      when 2 then return 13
      when 1 then return 1
      end
    end
  end
end

class Scene_Item
 
  #--------------------------------------------------------------------------
  # * Frame Update (when target window is active)
  #--------------------------------------------------------------------------
  def update_target
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # If unable to use because items ran out
      unless $game_party.item_can_use?(@item.id)
        # Remake item window contents
        @item_window.refresh
      end
      # Erase target window
      @item_window.active = true
      @target_window.visible = false
      @target_window.active = false
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If items are used up
      if $game_party.item_number(@item.id) == 0
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # If target is all
      if @target_window.index == -1
        # Apply item effects to entire party
        used = false
        for i in $game_party.actors
          used |= i.item_effect(@item)
        end
      end
      # If single target
      if @target_window.index >= 0
        # Apply item use effects to target actor
        target = $game_party.actors[@target_window.index]
        if @item.element_set.include?(GameGuy::ElementId)
          $game_actors[$game_party.actors[@target_window.index].id].learn_skill(@item.skill)
          used = true
        else
          used = target.item_effect(@item)
        end
       
       
      end
      # If an item was used
      if used
        # Play item use SE
        $game_system.se_play(@item.menu_se)
        # If consumable
        if @item.consumable
          # Decrease used items by 1
          $game_party.lose_item(@item.id, 1)
          # Redraw item window item
          @item_window.draw_item(@item_window.index)
        end
        # Remake target window contents
        @target_window.refresh
        # If all party members are dead
        if $game_party.all_dead?
          # Switch to game over screen
          $scene = Scene_Gameover.new
          return
        end
        # If common event ID is valid
        if @item.common_event_id > 0
          # Common event call reservation
          $game_temp.common_event_id = @item.common_event_id
          # Switch to map screen
          $scene = Scene_Map.new
          return
        end
      end
      # If item wasn't used
      unless used
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
      end
      return
    end
  end
end





Instructions

First go in the database, go to the System Tab and make a new element id and name
it Skill Item. Come back in here and change the 17 below in the module to the id
of the element you just made.

Now go further below and you'll see
# CONFIG use
follow those instructions to set skills to item id's. Then you're set.

One more thing, in items, the ones that are skill items make sure to mark the
element id that you chose in the Elements or else it wont work.


Compatibility

None yet found. Not tested with SDK.


Credits and Thanks


  • game_guy ~ making the script
  • Beta Testers ~ Krause, Sally, and another person I cant speak of



Author's Notes

If you only want certain Skill Items to work on certain actors I recommend Tons of Add Ons. Fantasist has an add on in there for actor specific items.

Ryex

interesting like an HM/TM system JC will LOVE you for thing he will want it for his Pokemon Neon Online game
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

G_G

YAY I feel loved! I always loved this feature from RPG Maker 2003 and I wanted to bring it back.

King Munkey

Me likes. I may try it out later kinda tired at the moment and don't feel like opening up RMXP ^_^.

But it does seem pretty cool.

G_G Is my hero!
Munkey != monkey
Munkey > monkey

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

May 06, 2009, 05:16:57 pm #5 Last Edit: May 06, 2009, 05:22:31 pm by Youngster Gi Gi
Me in the tons? OH HELL YEA! I'll need to shorten the Scene_Item thing to just overwrite Update_target.

YESS thnx blizzard!

Though is this still gonna be in this topic? Or deleted doesnt matter.

Oh and unconfuse the instructions too if you could. They sound confusing to me and I'm the one who made them. If you dont understand them I could explain better but if you do get them could you make them less confusable?

Blizzard

Leave the topic, but leave a note on top that this script can now be found in Tons. You don't need to change anything, I will optimize the entire script anyway. Do you mind if I scavenge through some of your other scripts? I saw several of your scripts that fit for Tons.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

May 07, 2009, 09:13:11 am #7 Last Edit: May 07, 2009, 09:15:38 am by Youngster Gi Gi
Really? Awesome!!!

Of course of course go right ahead! I'm just glad something got put into tons! :D

What other scripts of mine do plan on putting in there if you do?

Blizzard

IDK, but I remember seeing a few that might be useful in Tons. I'll do that when I have time. >.<
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.