Crime System

Everything about development and the OpenMW source code.
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Crime System

Post 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.
User avatar
silentthief
Posts: 456
Joined: 18 Apr 2013, 01:20
Location: Currently traversing the Ascadian Isles

Re: Crime System

Post 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
Last edited by silentthief on 21 Apr 2014, 03:36, edited 1 time in total.
Chris
Posts: 1625
Joined: 04 Sep 2011, 08:33

Re: Crime System

Post 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).
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Crime System

Post 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.
Chris
Posts: 1625
Joined: 04 Sep 2011, 08:33

Re: Crime System

Post 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).
unelsson
Posts: 227
Joined: 17 Mar 2018, 14:57

Re: Crime System

Post 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.
User avatar
Thunderforge
Posts: 503
Joined: 06 Jun 2017, 05:57

Re: Crime System

Post 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.
User avatar
heilkitty
Posts: 158
Joined: 11 Aug 2011, 07:57
Location: Vivec City, MW
Contact:

Re: Crime System

Post 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.
User avatar
heilkitty
Posts: 158
Joined: 11 Aug 2011, 07:57
Location: Vivec City, MW
Contact:

Re: Crime System

Post 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
Post Reply