How can I ensure that a custom outfit has all the pieces?

philmasterplus

Active member
I've been living with a shattered hippy stone for a while, and occasionally my farming gear is stolen while I'm away. Is there a built-in method that retrieves any missing pieces of an outfit?

Edit: Nevermind. This should probably work:

Code:
boolean ensure_outfit(string outfit_name) {
  int [item] pieces;
  foreach _, it in outfit_pieces(outfit_name) {
    pieces[it]++;
  }
  foreach piece, qty in pieces {
    if (!retrieve_item(piece, qty)) {
      return false;
    }
  }
  return true;
}
 
Last edited:

fronobulax

Developer
Staff member
If there is one, I didn't use it.

The attached takes an outfit name, looks for pieces in inventory or already equipped and pulls missing pieces from the closet or display case. My stone remains unbroken and I don't rely on Custom outfits when ascending, so if I ever had the complete outfit, those are where the pieces are likely to end up. It shouldn't be difficult to mallbuy if you're willing to trust a script to do that.
 

Attachments

  • GetOutfit.ash
    831 bytes · Views: 2
Top