Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[Resolved] Removing ALL equipment from party using scripts

Status
Not open for further replies.
I remember seeing this somewhere... I think Trickster told someone how to do it in a post. but I can't find it anymore.

I'm just looking for an easy way to remove the parties equipment from an event without knowing what equipment that person actually has and without having to go and event it for every piece of armor, for every party member.
 

arev

Sponsor

<_< Still not sure, but try to call this code from "Script" command:
Code:
$game_party.actors.each{ |a|
  a.equip(0,0)
  a.equip(1,0)
  a.equip(2,0)
  a.equip(3,0)
  a.equip(4,0)
}
 
All i'm trying to do is automatically [using a call script] drop all the equipoment the player has on.

Let say there is 3 party members. They have a sword, hat, shield, armor, and an accessory. I want to remove all that equipment and erase it from their inventory all in one fail swoop.

So basically I want to make them naked and burn their burn their clothes. :evil:XD
 

khmp

Sponsor

Code:
class Game_Party
  def destroy_equip
    @actors.each do |actor|
      # Continue if the actor doesn't exist
      next if actor == nil
      
      # Save the ids of the current equipment.
      n_ids = [actor.weapon_id,
              actor.armor1_id,
              actor.armor2_id,
              actor.armor3_id]
           
      for i in 0...n_ids.size
        # Unequip the item.
        actor.equip(i,0)
        # Destroy the equipment.
        case i 
          when 0
            lose_weapon(n_ids[i], 1)
          else
            lose_armor(n_ids[i], 1)
        end
      end
    end
  end
end

Add that into a section you create above main. Use call script and say:

Code:
$game_party.destroy_equip

Good luck with it Firestalker5! :thumb:

PS Congrats on the kid!
 

arev

Sponsor

This topic has been resolved. If Firestalker5 or any other users have any questions or further problems regarding this topic, please create a new thread about them.

Thank you!
 
Status
Not open for further replies.

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top