Importing Terrain into omwgame

Involved development of the OpenMW construction set.
User avatar
psi29a
Posts: 5361
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: Importing Terrain into omwgame

Post by psi29a »

The original file is the OpenMW.esm file I posted above. Created many moons ago... ;)

As for the new template you made, how did you do it? ;)

How does this fix the not-listing bug?
User avatar
cc9cii
Posts: 523
Joined: 28 Mar 2013, 04:01

Re: Importing Terrain into omwgame

Post by cc9cii »

psi29a wrote:There is one bug though right Zini & cc9cii?

That if you select your omwgame file from the dropdown list, then check the box next to your omwaddon (or esp) then hit save... then the next time you open up OpenMW-CS, your omwgame is no longer in the dropdown list.
There is a bug here, but I'm not sure which one...

If a new omwgame is created and subsequently edited along with an esp, then OpenCS modifies the omwgame with the content from the esp, as if the esp is an esm (then marks the esp as a dependency, i.e. MAST).

1. Should the esp allowed to be selected with the new omwgame? (current behaviour)

2. If yes to 1, should omwgame treat the esp as if it is an esm? (current behaviour)

3. If yes to 2, should the file selector also list esp's for selection? (currently not shown)

4. If yes to 3, should omwgame's be listed as if it is an addon? (currently not shown)
psi29a wrote:As for the new template you made, how did you do it? ;)
I hacked OpenCS to do things that shouldn't be done in polite company...

By the way, the land textures had to be copied over. I hope they have the right licences.

Also, something is not quite right with the 3 scripts in the template. I've not investigated it (throws exceptions in debug builds)
How does this fix the not-listing bug?
It doesn't. The hacked version is needed.
User avatar
psi29a
Posts: 5361
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: Importing Terrain into omwgame

Post by psi29a »

The map was created by my tool: worldsynth, now worldengine
Http://world-engine.org
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Importing Terrain into omwgame

Post by Zini »

There is a bug here, but I'm not sure which one...

If a new omwgame is created and subsequently edited along with an esp, then OpenCS modifies the omwgame with the content from the esp, as if the esp is an esm (then marks the esp as a dependency, i.e. MAST).

1. Should the esp allowed to be selected with the new omwgame? (current behaviour)

2. If yes to 1, should omwgame treat the esp as if it is an esm? (current behaviour)

3. If yes to 2, should the file selector also list esp's for selection? (currently not shown)

4. If yes to 3, should omwgame's be listed as if it is an addon? (currently not shown)
Something is very wrong here. If you have an esp loaded you can't edit the omwgame file. That is not how OpenMW-CS is supposed to work. You will always edit the last file in the list and that can never be the omwgame file if there are other files too, because the omwgame must always come first in the list.
User avatar
cc9cii
Posts: 523
Joined: 28 Mar 2013, 04:01

Re: Importing Terrain into omwgame

Post by cc9cii »

Zini wrote: Something is very wrong here. If you have an esp loaded you can't edit the omwgame file.
But it is allowed, so I guess that is the bug.
That is not how OpenMW-CS is supposed to work. You will always edit the last file in the list and that can never be the omwgame file if there are other files too, because the omwgame must always come first in the list.
I guess that makes it rather difficult to use OpenCS to bootstrap something like the template. Maybe an expert option is needed?
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Importing Terrain into omwgame

Post by Zini »

But it is allowed, so I guess that is the bug.
How? I still don't get it how people end up with such a setup. I haven't been able to reproduce it in the content selector.
I guess that makes it rather difficult to use OpenCS to bootstrap something like the template. Maybe an expert option is needed?
As mentioned before, we are still missing the merge tool. Once that is available I do not see why there would be any problems.
User avatar
cc9cii
Posts: 523
Joined: 28 Mar 2013, 04:01

Re: Importing Terrain into omwgame

Post by cc9cii »

Zini wrote:
But it is allowed, so I guess that is the bug.
How? I still don't get it how people end up with such a setup. I haven't been able to reproduce it in the content selector.
I suspect that if an esp does not have a MAST subrecord then the file selector allows it to be selected at any time.

To reproduce, get the file below and rename it as OpenMW.esp. Select openmw-template.omwgame to edit. You'll find that OpenMW.esp is listed as well.
psi29a wrote:Some more info,

I was hoping that perhaps the data was somehow merged, at least for cell 0,0.

I created 0,0 and room in the omwgame, saved, then opened with my esp file which looked like it "modified" the 0,0 entry.

The file is here:
http://www.mindwerks.net/wp-content/upl ... esm.tar.gz
Selecting the esp should change the savefile name (because we should be working on the plugin OpenMW.esp which has a dependency on openmw-template.omwgame now) but it doesn't. Any changes made are still done on the original selection, i.e. openmw-template.omwgame, and the omwgame now has a dependency on the esp.
Also, something is not quite right with the 3 scripts in the template. I've not investigated it (throws exceptions in debug builds)
Had a quick look at the script issue. The saved scripts do not have the precompiled info, which OpenMW does not need. However the loader (ironically) does not handle that very well. Something like below will fix the issue for debug builds:

Code: Select all

 components/esm/loadscpt.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/components/esm/loadscpt.cpp b/components/esm/loadscpt.cpp
index 0c2bdd4..60b4a33 100644
--- a/components/esm/loadscpt.cpp
+++ b/components/esm/loadscpt.cpp
@@ -77,8 +77,13 @@ namespace ESM
                     break;
                 case ESM::FourCC<'S','C','D','T'>::value:
                     // compiled script
-                    mScriptData.resize(mData.mScriptDataSize);
-                    esm.getHExact(&mScriptData[0], mScriptData.size());
+                    if (mData.mScriptDataSize)
+                    {
+                        mScriptData.resize(mData.mScriptDataSize);
+                        esm.getHExact(&mScriptData[0], mScriptData.size());
+                    }
+                    else
+                        esm.skipHSub();
                     break;
                 case ESM::FourCC<'S','C','T','X'>::value:
                     mScriptText = esm.getHString();
User avatar
cc9cii
Posts: 523
Joined: 28 Mar 2013, 04:01

Re: Importing Terrain into omwgame

Post by cc9cii »

psi29a wrote:The original file is the OpenMW.esm file I posted above. Created many moons ago... ;)

As for the new template you made, how did you do it? ;)
psi29a wrote:The map was created by my tool: worldsynth, now worldengine
Http://world-engine.org
@psi29a, I didn't copy over the rest of the cells to the template because they didn't have LAND records. Are you able to re-generate the missing ones?
User avatar
psi29a
Posts: 5361
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: Importing Terrain into omwgame

Post by psi29a »

Sadly I don't know the process, Greendogo did all the magic way back when.

Greendogo, can you explain the process?

I used tesannyn to convert a bmp to create an land based esp, does it do a good enough job?

https://dl.dropboxusercontent.com/u/396 ... annwyn.esp
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Importing Terrain into omwgame

Post by Zini »

I suspect that if an esp does not have a MAST subrecord then the file selector allows it to be selected at any time.

To reproduce, get the file below and rename it as OpenMW.esp. Select openmw-template.omwgame to edit. You'll find that OpenMW.esp is listed as well.
Yes, it is listed as a game file. Which is kinda bad, but still does not explain how this all happened. When I select the file, there are no other files listed to be loaded with it. So the situation we see here can not have been created that way.
Selecting the esp should change the savefile name (because we should be working on the plugin OpenMW.esp which has a dependency on openmw-template.omwgame now) but it doesn't.
Selecting the esp will change the save name to OpenMW.omwgame. And there is no dependency on any other file. There can't be. If there were any dependencies OpenMW.esp would not have been listed under game file.

Sorry, I still don't get it.
Had a quick look at the script issue. The saved scripts do not have the precompiled info, which OpenMW does not need. However the loader (ironically) does not handle that very well. Something like below will fix the issue for debug builds:
Is the problem that getHExact doesn't handle 0 sized data? If that is the case maybe getHExact should be fixed.
Post Reply