Outfit mapping script test

Fluxxdog

Active member
This little bit of script requires zlib, more for simplicity than anything. If you're interested, I'd like you to try this simple script out and let me know if you have any errors (listed as "Confusion: <outfit name>")
PHP:
import <zlib.ash>;
string[int,string]outfitset;
string[string,int]catalog;
item[string,int]listing;
file_to_map("outfits.txt",outfitset);
foreach x,name in outfitset{
	catalog[name]=split_string(outfitset[x,name],",");
	foreach y in catalog[name]{
		listing[name,y]=to_item(catalog[name,y]);}}
clear(outfitset); clear(catalog);

foreach name in listing{
	boolean flag=true;
	foreach x in listing[name]{
		if(have_item(listing[name,x])<1 || !can_equip(listing[name,x])) flag=false;}
	if(flag) print("You own a "+name+"!");
	if(have_outfit(name) != flag){
		print("Confusion: "+name,"red");}}
The script is intended to create a map of outfits. In this example, the outfits are parsed and then gone through to see which ones you have and which ones you don't. Should the map conflict with what mafia reports you a having, the Confusion message will pop up. Thanks for any testing you do ^^

(And if you must ask, the whole purpose is to learn some of this script)
 
Last edited:

Grotfang

Developer
Code:
You own a Hodgman's Regal Frippery!
[COLOR="Red"]Confusion: Hodgman's Regal Frippery[/COLOR]
You own a Pyretic Panhandler Paraphernalia!
[COLOR="Red"]Confusion: Pyretic Panhandler Paraphernalia[/COLOR]
You own a Slimesuit!
[COLOR="Red"]Confusion: Slimesuit[/COLOR]
You own a Vile Vagrant Vestments!
[COLOR="Red"]Confusion: Vile Vagrant Vestments[/COLOR]

boolean have_outfit( string )
Reports on whether or not you're currently capable of equipping the specified (in-game or custom) outfit, based on your stats & inventory availability of all outfit pieces.

They will have returned that way because I have them, but can't equip them.
 
Last edited:

Fluxxdog

Active member
OK, updated the above with can_equip() (or rather !can_equip()) (Knew I was missing something.)
(Also, parentheses!)
 

morgad

Member
works for me, lists all the non-custom outfits in my equipment manager (except for the Birthday suit, obviously)

:)

Dave
 

Fluxxdog

Active member
Looks like that should work. Unfortunately I literally just ascended, so can't test it again. Sorry.
Heh, that actually would be a good way to run it through it's ropes, sannouncing when you have each outfit as you get them ^^ But any how, thanks fellas :) I gained a recent taste for abusing (if you can call it that) the data files stored in mafia to make information more readily available, especially recipes.
 
Top