Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> 


———
Before you ask! Read! ;)

You must have 30+ Posts to create a topic here!

Thanks for reading!
———

> (RGSS) [REQ] Equip when added, Change equipment thingy.
Redd
post Jun 18 2012, 08:58 AM
Post #1


:<
Group Icon

Group: Revolutionary
Posts: 2,314
Type: Developer
RM Skill: Advanced




So, I am in need of a script. Is it possible to make it so that when you use the "Add Equipment" command, it automatically equips it to the character and removes what they are currently wearing and puts that into oblivion somewhere? xD Like, they could only have the one thing equipped, so if you tried to change it you couldn't because you wouldn't have the right stuff. It would be nice if it removed EVERYTHING that the actor was wearing with a separate call script as well, because I have an accessory for one outfit and not for the other.
If anyone could do this for me, that'd be awesome happy.gif full credits will be given.

This post has been edited by Redd: Jun 18 2012, 08:59 AM


__________________________
Go to the top of the page
 
+Quote Post
   
 
Start new topic
Replies
Night_Runner
post Jul 3 2012, 06:13 AM
Post #2


Level 50
Group Icon

Group: +Gold Member
Posts: 1,525
Type: Scripter
RM Skill: Undisclosed




1 script command to remove it from the party, coming up!

CODE
#==============================================================================
# ** XP: NR's Lose Equipment Script
#------------------------------------------------------------------------------
# History:
#  Date Created: 4/July/2012
#  Created for: Redd
#   @> http://www.rpgrevolution.com/forums/index.php?showtopic=56973
#
# Description:
#  Have a event run the scripted command:
#       $game_party.actors[123].lose_equip(0)
#  to have the 123rd member of the party enequip their weapon (
#     0 => Weapon
#     1 => Shield
#     2 => Head
#     3 => Body
#     4 => Accessory
#  ), and to have that weapon removed from the party.
#
#==============================================================================


#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
#  Edited to lose their equipment.
#==============================================================================

class Game_Actor
  #--------------------------------------------------------------------------
  # * Lose Equipment
  #     equip_type : type of equipment
  #--------------------------------------------------------------------------
  def lose_equip(equip_type)
    when 0 # Weapon
      # Backup the id
      last_weapon_id = @weapon_id
      # Unequip
      equip(equip_type, 0)
      # Remove from the party
      $game_party.lose_weapon(last_weapon_id, 1)
      return
    when 1, 2, 3, 4 # Shield, Head, Body, Accessory
      # Backup the id
      last_equipment_id = eval("@armor#{equip_type}_id")
      # Unequip
      equip(equip_type, 0)
      # Remove from the party
      $game_party.lose_armor(last_equipment_id, 1)
    else
      # If its invalid, raise an alert
      raise("#{equip_type} is not a valid equipment type ID")
    end
  end
end


#==============================================================================
# ** End of Script
#==============================================================================


__________________________
K.I.S.S.
Want help with your scripting problems? Upload a demo! Or at the very least; provide links to the scripts in question.

Most important guide ever: Newbie's Guide to Switches
Go to the top of the page
 
+Quote Post
   

Posts in this topic
- Redd   (RGSS) [REQ] Equip when added   Jun 18 2012, 08:58 AM
- - Night_Runner   Ummmm, I'm confused. The 'Add Equipment...   Jun 20 2012, 05:14 AM
|- - Redd   QUOTE (Night_Runner @ Jun 20 2012, 07:14 ...   Jul 1 2012, 12:34 PM
- - Redd   Thanks   Jul 14 2012, 03:08 PM


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 24th May 2013 - 03:03 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker