Record Cloning

Involved development of the OpenMW construction set.
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: Record Cloning

Post by sirherrbatka »

Sadly, I expirence problems not only in the Referencable table. At the moment Everything seems to work just fine when editing existing file (well, i tested only the Morrowind.esm, but I don't expect any surpises) but when working on the new file, situation looks quite different ─ and I suspect that this may related to some flaws in the OpenCS. Basicly: there is difference in beetwen added record, and base records, as I described. I don't think I can find the reason behind this behavior.

Well, I think I will focus now on usual checking for illformated code and illnamed variables and send a pull request in next few days.
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: Record Cloning

Post by sirherrbatka »

Ah, and one more thing. It seems that I need to know in the cell creator if I'm cloning exterior or interior (to show or not to show x/y controls). I guess I need to emit signal from this creator, pass it all way up to the table, search for record and pass it all the way down to the creator. That's the easy part.

But how I would actually set x and y in the exterior? I opt for checking for it at the runtime or with the help of specialised template in the collections, however collections do not know about any other objects in the OpenCS and they do not use signals/slots mechanism so I would have no way to request fetching x/y coordinates. It seems that instead I would have to x/y to some kind of buffor (avaible for collection<ESM::Cells>) but I have no idea how proper solution would look like. I'm still very new to the templates metaprogramming.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Record Cloning

Post by Zini »

I can not confirm the problem outside of referenceables that you describe. It took various samples and all the tables I checked looked okay.
I guess I need to emit signal from this creator, pass it all way up to the table, search for record and pass it all the way down to the creator.
No. You should check the table directly. Store a pointer/reference to the table in the creator.
But how I would actually set x and y in the exterior?
The cell coordinates are encoded in the ID. You just have to decode the ID again.


Edit: Actually, the CellCreator already stores a reference to the Data object from which you can get the tables. I presume you are either modeling a creator class based on that or derive from CellCreator.
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: Record Cloning

Post by sirherrbatka »

I can not confirm the problem outside of referenceables that you describe.
Sorry, I meant my cloning problem, not lack of ID problem.
The cell coordinates are encoded in the ID. You just have to decode the ID again.
Ok, this makes thing trivial.
No. You should check the table directly. Store a pointer/reference to the table in the creator.
And this will be not needed.

It is quite obvious once you know ^^'
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: Record Cloning

Post by sirherrbatka »

Ok, mostly working.

Another question! This time not related to my inability to read code ;-)

Is OpenCS should able to create new exterior cells in the Morrowind.esm?
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Record Cloning

Post by Zini »

Of course. Why shouldn't it?
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: Record Cloning

Post by sirherrbatka »

I was not sure if exterior cell matrix has any limitations. ;-)
User avatar
sirherrbatka
Posts: 2159
Joined: 07 Aug 2011, 17:21

Re: Record Cloning

Post by sirherrbatka »

Good point. But I now that there was some sort of limit in oblivion (in the engine itself, not in the file format).

Ok, status report. Types are added to data. Cloning works but not for base records ─ I don't know why but this may be some sort of bug. Cell cloning was the only interesting part. Decoding id to get coordinates works just fine, but feels hackish. I want to create something that is actually designed. Zini's patience seems to not be exhausted yet.
Post Reply