Feature - Rejected Option to re-equip item

Pazleysox

Member
I got my "I Voted!" Sticker today, and had the option to equip it right away in the accessory slot of my choice. I chose #1, which un-equipped my bejeweled pledge pin. I needed my pin equipped to finish the level 12 quest.

My request is when an item is equipped, can we have the option to re-equip the item that was just removed from the screen that's loaded, rather than having to go into inventory if we make a mistake? Or even on the top of the inventory page after an item is equipped, have the (same) option, to re-equip the item we just removed?

I love having the ability to equip items we have just received, and think it would be great to always have the option to equip something.
 

fronobulax

Developer
Staff member
I think you need to think this through.

I will say as a counterpoint that I would not find the feature useful because I use outfits and almost never use the equip link. In this specific case, I don't want the sticker equipped all of the time and so there is between adventure scripting that equips and unequips the sticker as needed.

Regardless of my opinion the implementation might be awkward. If the pin is in slot 3, it is replaced by the sticker and at some point the pin ends up in slot 1 then what is expected? Nothing because the pin is equipped? Unequip the sticker and then do nothing because the pin is equipped and the sticker is not? Unequip the pin and the sticker, equip the pin in slot 3 and leave slot one empty? In general equipment can sometimes be frustrating because which slots are used for what matters to people but not to KOL.
 

Pazleysox

Member
I understand what you're saying. It was my choice to put the sticker in slot 3, not remembering I had the pin there. I just thought it would be nice to be able to pick a new slot for the pin right away, instead of having to go into my inventory page, find it, and pick a different slot is all.

Most of what I do is run from scripts, and I rarely use the relay browser to adventure. I just happened to be doing so today on a character that I need to ascend, and hasn't been run in a long time.

And above all else, it was just a thought. The only bad question is the one never asked. :)
 

Saklad5

Member
I wrote a script for automatically using the Vote Monster free fights in aftercore (starting with areas that unlock latte ingredients, followed by areas like Dreadsylvania where lovebugs can help). I encountered a similar annoyance. What’d I really like is an ASH function that mimics the “checkpoint” CLI command. This could be as simple as a function that returns an item [slot] map of your current equipment, assuming that is all the checkpoint system actually does.

Since there is only one checkpoint buffer, it’s not really safe for use in scripts. It can’t be nested, and abstraction is the foundation of any decent program. Besides, CLI commands are extremely messy, as they can only return whether they succeeded or failed, and the distinction between the two is poorly documented for most commands.
 

Saklad5

Member
Code:
boolean fight_vote_monster(location loc)
{
    slot get_slot()
    {
        foreach acc in $slots[acc2, acc3]
        {
            if(equipped_item(acc) == $item[none])
                return acc;
        }
        return $slot[acc1];
    }


    if(get_counters("Vote Monster", 0, 0) == "Vote Monster")
    {
        location original_location = my_location();
        boolean already_equipped = have_equipped($item["I Voted!" sticker]);
        item original_accessory;
        slot sticker_slot;
        if(!already_equipped)
        {
            sticker_slot = get_slot();
            original_accessory = equipped_item(sticker_slot);
            equip(sticker_slot, $item["I Voted!" sticker]);
        }
        try
        {
            return adv1(loc, to_int(get_property("_voteFreeFights")) < 3 ? 0 : -1, "");
        }
        finally
        {
            set_location(original_location);
            if(!already_equipped)
                equip(sticker_slot, original_accessory);
        }
    }
    else
        return false;
}
 

Saklad5

Member
I wrote a script for automatically using the Vote Monster free fights in aftercore (starting with areas that unlock latte ingredients, followed by areas like Dreadsylvania where lovebugs can help). I encountered a similar annoyance. What’d I really like is an ASH function that mimics the “checkpoint” CLI command. This could be as simple as a function that returns an item [slot] map of your current equipment, assuming that is all the checkpoint system actually does.

I checked the code, and it actually does appear to just do that, so I wrote a little library for getting and equipping item [slot] maps. I’ve already retrofitted a lot of my scripts with it, it works quite well. I tried to make the equip function relatively atomic, so it should be reliable enough for arbitrary use. Note that it does not include familiars, only familiar equipment. I’m considering using a record with the item [slot] map and a familiar variable instead, but it would make things a little less clear.

Code:
item [slot] equipped_items(){
    item [slot] current_equipment;
    foreach sl in $slots[]
        current_equipment[sl] = equipped_item(sl);
    return current_equipment;
}


boolean equip_items(item [slot] new_equipment)
{
    item [slot] previous_equipment = equipped_items();
    boolean success = true;
    foreach sl,it in new_equipment
        if(success && equipped_item(sl) != it)
            success = equip(sl, it);
    if(!success)
        equip_items(previous_equipment);
    return success;
}
 
Top