Third color for things whose owner is dead

Feedback on past, current, and future development.
Post Reply
Lywzc
Posts: 4
Joined: 14 Jul 2022, 14:20

Third color for things whose owner is dead

Post by Lywzc »

Currently white means you can freely take it and red means you can not. However if the owner is dead then although you still can not freely take it meaning guards will still arrest you if they see it, anything you take will not be marked as stolen meaning guards will not confiscate them if you are caught stealing later which is an important difference.

Therefore I suggest if the owner is dead then use a third color such as yellow or green to differentiate.
User avatar
akortunov
Posts: 900
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation

Re: Third color for things whose owner is dead

Post by akortunov »

Red color is irrelevant to Stolen map at all, it just means that the current action will be a crime. It handles cases when you pick a lock on the owned door, take an owned item, try to use a pickpocketing, or sleep on owned bed.
Lywzc
Posts: 4
Joined: 14 Jul 2022, 14:20

Re: Third color for things whose owner is dead

Post by Lywzc »

akortunov wrote: 16 Jul 2022, 10:08 Red color is irrelevant to Stolen map at all, it just means that the current action will be a crime. It handles cases when you pick a lock on the owned door, take an owned item, try to use a pickpocketing, or sleep on owned bed.
Which is tied to the owner of the thing may it be a door, a chest or a bottle and does not change what I say.

Currently both tooltip and crosshair use isOwned which is bool. By changing it and related function to a three state thingy in which 0 is as before excluding owned but dead owner, 1 is as before and 2 is owned but dead owner, the tooltip and crosshair can be more useful without having to turn on tfh to see the owner since onwership in Morrowind sometimes may not be the same as one would expect. Crime detection will not change much. 1 is not crime while 0 and 2 is crime.
Last edited by Lywzc on 16 Jul 2022, 17:32, edited 2 times in total.
User avatar
akortunov
Posts: 900
Joined: 13 Mar 2017, 13:49
Location: Samara, Russian Federation

Re: Third color for things whose owner is dead

Post by akortunov »

Lywzc wrote: 16 Jul 2022, 16:29 Which is tied to the owner
Not directly. For example, when you use a pickpocketing, a target actor has no owner. Items in owned container, IIRC, have no owner too. As I said, colored crosshair is binded to crime mechanics, not to way in which we mark items for confiscation.
Lywzc
Posts: 4
Joined: 14 Jul 2022, 14:20

Re: Third color for things whose owner is dead

Post by Lywzc »

akortunov wrote: 17 Jul 2022, 16:50
Lywzc wrote: 16 Jul 2022, 16:29 Which is tied to the owner
Not directly. For example, when you use a pickpocketing, a target actor has no owner. Items in owned container, IIRC, have no owner too. As I said, colored crosshair is binded to crime mechanics, not to way in which we mark items for confiscation.
You overly concentrate on small details that are not important at all. Read the next paragraph. It certainly can be done since the code already checks the owner. The pickpocket part is another thing and is checked separately in the code so has nothing to do with this suggestion. And containers have owners, why are you talking about items in a container? The game does not magically determine if an action is a crime. The process is divided into roughly 2 parts, 1 is when the target is an npc and then check if you are pickpocketing when they are alive and not in combat, and 2 is check if the target that is not an npc or creature is owned by an actor or a faction. There are other small parts like an unlocked door or owned bed but for this discussion only the second part needs some change.

Code: Select all

    bool isOwned(const MWWorld::Ptr& ptr, const MWWorld::Ptr& target, MWWorld::Ptr& victim)
    {
        const MWWorld::CellRef& cellref = target.getCellRef();

        const std::string& owner = cellref.getOwner();
        bool isOwned = !owner.empty() && owner != "player";

        const std::string& faction = cellref.getFaction();
        bool isFactionOwned = false;
        if (!faction.empty() && ptr.getClass().isNpc())
        {
            const std::map<std::string, int>& factions = ptr.getClass().getNpcStats(ptr).getFactionRanks();
            auto found = factions.find(Misc::StringUtils::lowerCase(faction));
            if (found == factions.end() || found->second < cellref.getFactionRank())
                isFactionOwned = true;
        }

        const std::string& globalVariable = cellref.getGlobalVariable();
        if (!globalVariable.empty() && MWBase::Environment::get().getWorld()->getGlobalInt(globalVariable))
        {
            isOwned = false;
            isFactionOwned = false;
        }

        if (!cellref.getOwner().empty())
            victim = MWBase::Environment::get().getWorld()->searchPtr(cellref.getOwner(), true, false);

        return isOwned || isFactionOwned;
    }
since you already getOwner(), I don't think you can not check if this owner is dead or not and give a third result. And since crosshair and tooltip all use this and similar function to determine if it should be red a third result can be assigned to a third color.
Post Reply