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!
———

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


:<
Group Icon

Group: Revolutionary
Posts: 2,327
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
   
Night_Runner
post Jun 20 2012, 05:14 AM
Post #2


Level 50
Group Icon

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




Ummmm, I'm confused.

The 'Add Equipment' command, do you mean the evented command 'Change Equipment' (Page 1), which adds a weapon to the party, or the evented command 'Change Equipment' (Page 3) which forcefully equips armours?
And by putting the old equipment into oblivion, you mean the list of items that aren't equipped, or did you want to remove that equipment from the party (i.e. use the 'lose equipment' command)?

By 1 thing equipped, you mean 1 thing equipped in that slot, so only 1 type of shield, as opposed to only 1 type of equipment (shield, helmet, armour, accessory) could be equipped at a time?

I' suppose I'm trying to get an example of how to use this potential script, so I can get a better idea of how these features work.


__________________________
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
   
Redd
post Jul 1 2012, 12:34 PM
Post #3


:<
Group Icon

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




QUOTE (Night_Runner @ Jun 20 2012, 07:14 AM) *
Ummmm, I'm confused.

The 'Add Equipment' command, do you mean the evented command 'Change Equipment' (Page 1), which adds a weapon to the party, or the evented command 'Change Equipment' (Page 3) which forcefully equips armours?
And by putting the old equipment into oblivion, you mean the list of items that aren't equipped, or did you want to remove that equipment from the party (i.e. use the 'lose equipment' command)?

By 1 thing equipped, you mean 1 thing equipped in that slot, so only 1 type of shield, as opposed to only 1 type of equipment (shield, helmet, armour, accessory) could be equipped at a time?

I' suppose I'm trying to get an example of how to use this potential script, so I can get a better idea of how these features work.


Ohhh I didn't realize that the Change Equipment was every there o.0 but yeah... Change Equipment haha. And I want to completely remove it from the party... but there isn't a lose equipment command, is there? And yes, that is what I mean by 1 thing equipped. 1 type of shield, 1 type of helmet... like it's locked in there and you can't take it off.


__________________________
Go to the top of the page
 
+Quote Post
   
Night_Runner
post Jul 3 2012, 06:13 AM
Post #4


Level 50
Group Icon

Group: +Gold Member
Posts: 1,529
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
   
Redd
post Jul 14 2012, 03:08 PM
Post #5


:<
Group Icon

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




Thanks biggrin.gif biggrin.gif


__________________________
Go to the top of the page
 
+Quote Post
   

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: 18th June 2013 - 05:23 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker