Save-Point

Full Version: Save-Point
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Board Message
Sorry, you do not have permission to access this resource.
Save-Point - [Resolved] A script to unequip all party members

Save-Point

Full Version: [Resolved] A script to unequip all party members
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone,

I've been searching for a script that will allow me to remove all equipment from all party members during gameplay. (Similar to the npc who did this in the airship in FF6). Does anyone have it or know how to make it? Thanks for your time and help!
Well, you could take a look at the default script named Interpreter (XP) or Game_Interpreter (VX), or maybe in Game_Party or Actor class script, there's a way to unequip an actor. I don't have the code at hand so that's pretty much what I can now tell you about it.
It turned out that there was already a Sandgolem script for this. I'll post it below:

Quote:Any non-fixed items they're equipped with will be given back to the player.



Code:
def sg_unequipactor(actor)
  actor = $game_actors[actor]
  for i in 0...4
    if !actor.equip_fix?(i)
      actor.equip(i,0)
    end
  end
end

Put the code block into your script editor somewhere. To use it, use this in a call script:
Code:

Code:
sg_unequipactor(ActorNumber)

If you're using something that adds new equipment, you'll need to add them into this mini script as well.


The site is down, but I found it on a pen drive where I had a couple of old projects stored.
Even so you'd still need to call this method 4 times or less if you don't have 4 party members by then... either using a for each or an each or a times iterator. It'd be something like this...

Code:
def unequip_all_party_members
  $game_party.actors.size.times do |n|
    sg_unequipactor(n)
  end
end

def sg_unequipactor(actor)
  actor = $game_actors[actor]
  for i in 0...4
    if !actor.equip_fix?(i)
      actor.equip(i,0)
    end
  end
end

I haven't test it yet, so it's up to you to verify if it works properly. I don't know if there was a real need to create that SandGolem's method. I guess I'd need to check it out later...

Edit...

Who said I was an expert? I'm just a humble scripter who never made a single BS.
Ah, excellent, thanks a ton. I'm extremely limited in my knowledge of scripting (i.e., a disaster) and have understood everything only in bits and pieces. It would be great to have an expert opinion. =D