[OpenMW CS] Give two records of different types the same name

Feedback on past, current, and future development.
Post Reply
User avatar
MinerMan60101
Posts: 24
Joined: 09 Sep 2017, 15:40
Location: California: U.S.A.

[OpenMW CS] Give two records of different types the same name

Post by MinerMan60101 »

In vanilla morrowind, no two records can have the same ID. (i.e. if you have an exterior named Balmora, you can't also have a sword with the internal ID "Balmora")

So, it would be cool if OpenMW CS allows for two different kinds of records to have the same ID attached to them.

A good solution would be to follow the route of later TES games and allow interiors and exteriors to disconnect cell names from being IDs (of course defaulting to the name when no ID is present) (I also have no clue if this is in that master planning document already)
Chris
Posts: 1625
Joined: 04 Sep 2011, 08:33

Re: [OpenMW CS] Give two records of different types the same name

Post by Chris »

MinerMan60101 wrote: 14 Aug 2018, 04:18 In vanilla morrowind, no two records can have the same ID. (i.e. if you have an exterior named Balmora, you can't also have a sword with the internal ID "Balmora")

So, it would be cool if OpenMW CS allows for two different kinds of records to have the same ID attached to them.
Records are identified by their ID, so if something references a particular ID and finds two records for it, which is it supposed to use? Same if a mod tries to replace an object by redefining it, which record is it supposed to replace?

The reason later games can deal with it is because the ID is stored in those games' esm/esp files as a 24-bit integer (plus an 8-bit file index), rather than its name. The 8-bit index can be remapped as needed on load given the content file name, and with its 24-bit ID is enough to uniquely identify every record in a play session. In Morrowind/OpenMW, a record is first identified with its name, and an integer ID generated from that as needed.
Equinox
Posts: 19
Joined: 31 Jul 2018, 20:13

Re: [OpenMW CS] Give two records of different types the same name

Post by Equinox »

Perhaps a post 1.0 feature..
User avatar
AnyOldName3
Posts: 2666
Joined: 26 Nov 2015, 03:25

Re: [OpenMW CS] Give two records of different types the same name

Post by AnyOldName3 »

In MWScript, you access stuff in scripts by just using its name as a variable name. If a script said

Code: Select all

"Balmora"->Disable
, there's no way to tell if you're trying to hide the bow or make the place inaccessible. I'm not a big fan of this system, but it's what all existing content uses, so it has to remain.

Personally, I'd have preferred a system where it was contained within a function, so you could access things like

Code: Select all

Actor fargoth = World.Get<Actor>("Fargoth")
Weapon bow = World.Get<Weapon>("chitin short bow")
fargoth->addItem(bow, 1)
Ref balmora = World.Get("Balmora")
balmora->doStuff()
but with some better-designed syntax, because this example is really verbose (e.g. allowing strings to be cast to record types to cut down on the World.Get<Type>). It does add an optional type system, which I think the original language simply doesn't have when dealing with content by ID. Also, as things are functions and variables and types, it should involve less hacking on top of whichever language we choose for NewScript.
Chris
Posts: 1625
Joined: 04 Sep 2011, 08:33

Re: [OpenMW CS] Give two records of different types the same name

Post by Chris »

It's not just scripts. Say a mod creates a book with the book record "my_super_weapon" which talks about a super-secret weapon, and also creates a weapon record "my_super_weapon". Now lets say you place a "my_super_weapon" object into a cell. Are you placing the book or the weapon? Now imagine a patch to the mod which edits the super weapon, changing it into an armor (with powerful castable enchantments), so it creates a modified "my_super_weapon" that's now an armor record. Which of the previous records is it supposed to replace, the book record or the weapon record?

The only way to change this would be to update the omwgame/addon format so records are given unique integer IDs in the content file, leaving the name just for display purposes, like the newer games do. But as it is, Morrowind's esm/esp format can't cope with multiple records having the same name like that.
User avatar
xirsoi
Posts: 21
Joined: 21 Oct 2014, 21:14

Re: [OpenMW CS] Give two records of different types the same name

Post by xirsoi »

Alternatively it could be a convenience feature used by OpenCS that hides some of the details.

It could pre-pend the record type to the name behind the scenes, allowing the user to create two records with the "same" id.

However, I don't see much utility in such a feature.
Post Reply