Page 2 of 2

Re: Crime System

Posted: 21 Apr 2014, 00:34
by scrawl
The bug is that executing AI setting functions such as "SetFight X" changes this setting on every single instance of this object in the game, instead of just the instance that the script is being executed on.

Re: Crime System

Posted: 21 Apr 2014, 03:28
by silentthief
scrawl wrote:...There is no way to get off that "ordinator deathlist" once you are on it.
As well as wearing the indoril armor, this is also a reaction of the main quest/dialog when you claim to be "the incarnate". In fact, IIRC you can talk to the temple archanon Saryoni about stopping attacks: http://www.uesp.net/wiki/Morrowind:Cont ... Ordinators

ST

Re: Crime System

Posted: 21 Apr 2014, 03:35
by Chris
Scrawl, I'm not sure there's anything we can do to fix that, as it's just as likely that some scripts use SetFight to change all instances of an object. And the Fight setting is part of the base object, so you can't really change it on a single reference (it's like trying to set a static class variable only for a specific class instance).

Re: Crime System

Posted: 21 Apr 2014, 04:06
by scrawl
The AiSettings are part of CreatureStats, so they are changeable only for a specific instance:

Code: Select all

        enum AiSetting
        {
            AI_Hello = 0,
            AI_Fight = 1,
            AI_Flee = 2,
            AI_Alarm = 3
        };
        void setAiSetting (AiSetting index, Stat<int> value);
        void setAiSetting (AiSetting index, int base);
        Stat<int> getAiSetting (AiSetting index) const;
Changing anything on a base object is impossible in OpenMW's design, because the ESM classes are read-only.

Re: Crime System

Posted: 21 Apr 2014, 11:17
by Chris
scrawl wrote:The AiSettings are part of CreatureStats, so they are changeable only for a specific instance:

Code: Select all

        enum AiSetting
        {
            AI_Hello = 0,
            AI_Fight = 1,
            AI_Flee = 2,
            AI_Alarm = 3
        };
        void setAiSetting (AiSetting index, Stat<int> value);
        void setAiSetting (AiSetting index, int base);
        Stat<int> getAiSetting (AiSetting index) const;
I'm not sure it should be that way. The Fight/Alarm/Flee settings are part of the (base) NPC_ record, and given the way SetFight affects all actors based on the same NPC_ record, the data is apparently part of the base object that gets shared with individual references. If our "live" references don't share any mutable data, then I think this is a flaw in the design that's going to cause compatibility problems (not to mention wastes memory).

Re: Crime System

Posted: 23 Mar 2018, 23:04
by unelsson
About this bug report
https://bugs.openmw.org/issues/2798

What would be the solution for this?

- coding setfight to go through every instance of the type in the world (save)
- code an overriding variable that will be tied to esm-reading, like a workaround through the fact that base object can't be changed. Variable doesn't do anything by default, but when called by script, it will override every creature coming from base object.
- letting openmw go different path here
- coding something special to happen to, if WearingOrdinatorUni is 1.

About the WearingOrdinatorUni variable that gets changed in script OrdinatorUniform: I can't find anything related to that variable anywhere in the OpenMW project, yet ordinators do attack. Can't find the script from esm-files either, but I don't have proper search tools anyway.

Re: Crime System

Posted: 05 Apr 2018, 00:30
by Thunderforge
unelsson wrote: 23 Mar 2018, 23:04 About the WearingOrdinatorUni variable that gets changed in script OrdinatorUniform: I can't find anything related to that variable anywhere in the OpenMW project, yet ordinators do attack. Can't find the script from esm-files either, but I don't have proper search tools anyway.
Could it have been something that was hardcoded into the vanilla exe, rather than in the esm? I recall reading somewhere that corprus worked that way.

Re: Crime System

Posted: 10 Apr 2018, 05:03
by heilkitty
Ordinators attacking PC, if they greet 'em while wearing Indoril armor, is fully scripted, there's no need to refer it in OpenMW code.

Re: Crime System

Posted: 10 Apr 2018, 05:10
by heilkitty
unelsson wrote: 23 Mar 2018, 23:04Can't find the script from esm-files either, but I don't have proper search tools anyway.
viewtopic.php?p=23869#p23869