Jump to content

Question

Posted (edited)

I am currently trying to use TES4LL and/or MPGUI with MO, but unfortunately I run into a bunch of problems.

 

The main problems I see so far, are:

- tes4ll_ultimate.bat does not create any meshes, only three empty folders

- the process of creating meshes with MPGUI crashes

 

Nexus user malonn also is currently trying to get those tools to work with Mod Organizer, but as it seems he has the exact same problems as I do.

 

I will now write a complete report on what I have found out until now, how I do things and where my problems are. I hope, that either Tannin or gruftikus, or the STEP community could help me out here.

 

=======================================================

 

First, in order to mod Oblivion, I searched around what I would need to do, how to do it and in particular, in which order. I come to the conclusion, that all necessary things should be done in this order:

 

- Sorting out mods I want to use (downloading & activating)

- Sorting the Loadorder via LOOT

-- Consider running Land Magic

- Run TES4ll - generating distant meshes for terrain

- Run TES4qLod (from within TES4ll) - generating textures for distant land meshes

- Run TES4ll_normalmaps

- Create the Bashed Patch with Wrye Bash

- Run TES4LODGen.exe (renamed TES5Edit.exe) - generating .lod files based on distant objects provided by mods and low poly distant object meshes ( _far.nif )

 

Instead of running the individual batch files of TES4ll one could also use MPGUI - Multi Purpose GUI.

 

 

But first, I tried to run TES4ll just by itself. So I downloaded it and extracted the content of the .7z archive into the following folder:

..\Steam\SteamApps\common\Oblivion\Data\..

 

I then opened MO and added tes4ll_ultimate.bat with the arguments -f "...,makemeshes,..." as an executable:

Image 1

 

When I now run "tes4ll_ultimate.bat" through MO, a dos window opens and the following happens:

Image 2

 

At the end there is the line: "Please close this window." So one would think that everything is done. I press enter and close that window. But, back in MO:

Image 3

 

Besides the three folders, no meshes have been created.

 

 

So, after that wasn't as successfull as I had hoped, I downloaded MPGUI.

 

 

I installed MPGUI outside of my Oblivion folder:

C:\Spiele\Modding\0_Programme\MPGUI

 

Spiele = Games

 

 

I then added MPGUI in MO as a new executable file:

Image 4

 

If I run it through MO I see this:

Image 5

 

File --> Open Batch... --> select "tes4ll_all.mpb" in:

C:\Spiele\Steam\SteamApps\common\Oblivion\Data\Ini\tes4ll

 

Once the .mpb file is opened .. and I have selected Oblivion under "Options - Game Mode - Oblivion" .. MPGUI looks like this:

Image 6

 

Now I can see, that basically none of my plugins are recognized by mpgui:

Image 7

 

.. and therefore I can't select any worldspaces in the next tab. If I rescan my plugins, and switch back to the first tab, I see that two new lines were added:

 

19 [Info] Reading esp/esm files from 'C:\Spiele\Modding\0_Programme\Mod_Organizer_Oblivion\mods\Bashed Patch'
20 [Info] Plugins.txt path is: 'C:\Users\NAME\AppData\Local\Oblivion\plugins.txt'
Line 19 - MPGUI falsely scans my "Bashed Patch" mods folder inside MO .. that's why it can't find any plugins.

Line 20 - The wrong plugins.txt is selected by MPGUI .. it should be the one in MO's folder:

C:\Spiele\Modding\0_Programme\Mod_Organizer_Oblivion\profiles\Default\plugins.txt

 

 

So here is my first conclusion .. the Bashed Patch must be deactivated within MO's mod list/left pane/installation order.

Image 8

 

Once I deactivated the Bashed Patch and run MPGUI once again, selected the "tes4ll_all.mpb" and the game mode Oblivion, I now could see this in the Plugins tab:

Image 9

 

I then selected all plugins, read the worldspace in the next tab, left everything else at it's default settings and switched over to the "Start Process" tab, where I clicked "Click me if you are ready".

Result: the tes4ll.exe crashes:

Image 10

 

 

After a bit of head-scratching I opened up the "mpgui_autoload.mpb" file with Notepad++, found in:

C:\Spiele\Modding\0_Programme\MPGUI\mpgui_autoload.mpb

 

 

Original:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[_Autoload]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

LogFile                   -value="$_workdir\mpgui.log"

## 1, 3, 4 reserved for Morrowind, Fallout 3 and FalloutNV


AddGame              -n=2 -name=Oblivion
SetGamePluginFile    -n=2 -value="$_appdata\Oblivion\plugins.txt"
SetGameSearchPattern -n=2 -value="oblivion"
SetGameStdWorldspace -n=2 -value="Tamriel"

AddGame              -n=3 -name=Fallout3
SetGamePluginFile    -n=3 -value="$_appdata\Fallout3\plugins.txt"
SetGameSearchPattern -n=3 -value="Fallout 3"
SetGameStdWorldspace -n=3 -value="Wasteland"

AddGame              -n=5 -name=Skyrim
SetGamePluginFile    -n=5 -value="$_appdata\Skyrim\plugins.txt"
SetGameSearchPattern -n=5 -value="skyrim"
SetGameStdWorldspace -n=5 -value="Tamriel"

;SetPath                  -value="$_workdir\ini\mpgui\"

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
GUIConsoleEcho -text="Autoload batch file loaded"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

.. and changed a few things and also added two new lines:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[_Autoload]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

LogFile			   -value="$_workdirmpgui.log"

## 1, 3, 4 reserved for Morrowind, Fallout 3 and FalloutNV


AddGame	              -n=2 -name=Oblivion
SetGamePluginFile     -n=2 -value="C:\Spiele\Modding\0_Programme\Mod_Organizer_Oblivion\profiles\Default\plugins.txt"
SetGameSearchPattern  -n=2 -value="oblivion"
SetGameStdWorldspace  -n=2 -value="Tamriel"
GameMode		   -name=Oblivion
SetPath			   -value=C:\Spiele\Steam\SteamApps\common\Oblivion\Data\Ini\tes4ll\tes4ll_all.mpb

;AddGame	      -n=3 -name=Fallout3
;SetGamePluginFile    -n=3 -value="$_appdata\Fallout3\plugins.txt"
;SetGameSearchPattern -n=3 -value="Fallout 3"
;SetGameStdWorldspace -n=3 -value="Wasteland"

;AddGame	      -n=5 -name=Skyrim
;SetGamePluginFile    -n=5 -value="$_appdata\Skyrim\plugins.txt"
;SetGameSearchPattern -n=5 -value="skyrim"
;SetGameStdWorldspace -n=5 -value="Tamriel"

;SetPath		   -value="$_workdir\ini\mpgui"

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
GUIConsoleEcho -text="Autoload batch file loaded"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Now, when I open MPGUI and click on "File --> Open Batch...", I can directly select the batch file "tes4ll_all.mpb", without the need to manually navigate to the correct folder. Once the file is selected, the Game Mode "Oblivion" is set automatically .. and Fallout3 and Skyrim are commented out within the code above, hence do not showup as alternatives within MPGUI.

 

 

But now comes my actual problem. If I now activate all plugins, read the worldspaces and want to "start the process" .. the "tes4ll.exe" still crashes.

 

.. hence, I currently am not able to create any meshes through neither TES4ll, nor MPGUI. And here I hope that someone could help me .. is there something I could do?

Edited by pStyl3
  • Answers 39
  • Created
  • Last Reply

Top Posters For This Question

Recommended Posts

  • 0
Posted (edited)

 

 

Now .. speaking from MO's perspective .. it would be ideal, if these sorts of manual edits wouldn't be necessary, so that TES4LL can be used though MO. I think, that a command line to specify an output folder - like TES4LODGen.exe's -O: argument - could do the job. So that the user can specify, that files should be placed in a custom folder, and not into a static location like $_gamedir\Data\.......

This is easy, each variable can be set in the command line, e.g. like tes4ll.exe _gamedir="blabla".

 

There is still the additional "Data"-directory at each place, but I think I will change that to $_data, by adding some line like

@!_data SetFlag -name="_data" -value="Data"

it is possible to add a default which is not used when defined in the command line as described above.

Edited by gruftikus
  • 0
Posted

I can't say for sure, but what I read once was to do these things in this order:

1. tes4ll_ultimate.bat

2. tes4ll_tes4qlod.bat

3. tes4ll_normalmaps.bat

 

The first one is used to generate distant meshes for terrain, the second one is used to generate textures for distant land meshes and the third one to create normal maps. Given that, it makes sense to me how that order was presented. #2 and #3 might be switchable, but I am not sure of that.

Everything is completely independent. Only the tes4qlod cache has to be generated before

  • 0
Posted (edited)

This may sound strange, since Windows is supposed to be case-insensitive but I was still getting files being placed in the overwrite folder and messages in the logs showing this location:

 

mods\TES4LL\Textures\landscapelod\generated
When I changed them in the tes4ll_all.mpb to match those set by the instructions above, ie. case-sensitive, they correctly were placed into the mod and not the overwrite.

 

Thanks for the note! Do I understand you correctly? You changed the two filepaths "TES4LL\Textures\landscapelod\generated" inside of "tes4ll_all.mpb" to "TES4LL\Textures\LandscapeLOD\Generated"? Whether or not that is correct, could you please also clarify of which files you were talking exactly (inside the overwrite), so which files were previously in the overwrite, and after the adjustment not anymore?

 

My observation is:

  • using "tes4ll_ultimate.bat" puts "tes4ll.log" into the overwrite - the actual meshes will be correctly in the defined modfolder "TES4LL"
  • using "tes4ll_tes4qlod.bat" puts "tes4qlod.log" + the three empty folders "Textures\LandscapeLOD\Generated\" into the overwrite (those empty folders can be deleted) - the actual textures will be correctly in the defined modfolder "TES4LL"
  • using "tes4ll_normalmaps.bat" puts "tes4ll_normalmaps.log" into the overwrite - the actual textures will be correctly in the defined modfolder "TES4LL".
So "tes4ll_ultimate.bat" and "tes4ll_normalmaps.bat" put their files correctly into "TES4LL", only the .log files will be in overwrite, and "tes4ll_tes4qlod.bat" is basically the same, only that using this one puts also the mentioned three empty folders into the overwrite.

 

I tried adapting the "tes4ll_all.mpb" file, but that didn't change anything for me .. the three .log files and the 3 empty folders (through tes4qlod) were still be in the overwrite mod.

 

 

@pStyl3 Hooray! It worked..

 

...

 

So thanks especially to you pStyl3, but also to everyone who keeps modding Oblivion and through this keeps it from becoming obsolete!!!

No problem and great to hear. Don't forget to thank especially gruftikus aswell! :)

 

 

This is easy, each variable can be set in the command line, e.g. like tes4ll.exe _gamedir="blabla".

 

There is still the additional "Data"-directory at each place, but I think I will change that to $_data, by adding some line like

@!_data SetFlag -name="_data" -value="Data"

it is possible to add a default which is not used when defined in the command line as described above.

Just to clarify this aswell and to be absolutely sure .. you plan to this all for the next version and this is not already possible, is that correct? In any case, that sounds great.

 

 

Everything is completely independent. Only the tes4qlod cache has to be generated before

So that means, that I have to run "tes4ll_tes4qlod_cache.bat" everytime before I want to run "tes4ll_tes4qlod.bat"?

Edited by pStyl3
  • 0
Posted (edited)

Yes, you are understanding me correctly. ALL references in the tes4ll_all.mpb that were, TES4LL\Textures\landscapelod\generated, are now, TES4LL\Textures\LandscapeLOD\Generated.

 

What that means is every file that would go into the 'overwrite' folder now is correctly pointing to the folders as outlined in the TES4LL mod.

Now ALL files are found in the TES4LL mod and nothing is in the 'overwrite' folder, including the logs.

 

If you are finding the logs in the 'overwrite' it is because they don't exist in the virtual file system when the batch file are run. ie. if you copy those logs into the TES4LL mod and then run them again, they will update the existing files because MO finds them in the VFS. For those files its simply a matter of choice. Do you want them in the 'overwrite' so you are prompted to examine them and then perhaps remove them, or do you just accept them as being correct and they can stay in the mod folder?

 

The basic thing to remember about what ends up in the 'overwrite' folder is this:

If it exists in the VFS then it SHOULD be updated and not be found there.

Files exist in the VFS ONLY if the mod is active in the left-hand pane.

 

I've added these instructions to the Oblivion specific MO page.

Do you feel they are accurate enough?

Edited by GrantSP
  • 0
Posted (edited)

It appears that I "accidently ignored" that aspect of MO (updating known files in mods, instead of placing those known files once again into the Overwrite mod) while trying to figure out, why on earth ..

 

My observation is:

  • using "tes4ll_ultimate.bat" puts "tes4ll.log" into the overwrite - the actual meshes will be correctly in the defined modfolder "TES4LL"
  • using "tes4ll_tes4qlod.bat" puts "tes4qlod.log" + the three empty folders "Textures\LandscapeLOD\Generated\" into the overwrite (those empty folders can be deleted) - the actual textures will be correctly in the defined modfolder "TES4LL"
  • using "tes4ll_normalmaps.bat" puts "tes4ll_normalmaps.log" into the overwrite - the actual textures will be correctly in the defined modfolder "TES4LL".

I actually still don't know why that happens - I mean, the folder is correctly predefined and all - but that isn't really important anyway.

 

All that said above in the quotebox is what happens if I run the batch files the first time. I then drag&drop the .log files into the TES4LL mod (and delete the mentioned empty folders in the Overwrite mod). The second time I then run the batch files, everything will be corretly updated within the TES4LL mod, just as it is supposed to be. So no problems regarding that!

 

 

Regarding your change ..

TES4LL\Textures\landscapelod\generated --> TES4LL\Textures\LandscapeLOD\Generated

 

If that happens to help on your system then I would agree that this change should be carried over to the "install instructions" we are setting up here for MO users. Note though, that I personally can't seem to replicate your issue with "TES4LL\Textures\landscapelod\generated" .. with this "original path", no files will be placed in my Overwrite mod on the batch files' second run. MO's warning triangle always stays grey here. But as said, if it helps you to adjust that (--> LandscapeLOD\Generated) aswell, I'm all on your side.

 

 

Regarding your instructions:

I find them very well written and on the point. Maybe two or three additions.

 

Set the correct data folder and let MO install the mod.

Maybe mention at this point, that MO's warning about a to-be-happen false installation can be safely ignored (in this case)? Also, maybe you could add gruftikus' note, that a particular order in which the three batch files need to be run, isn't really necessary.

 

Last but not least, a reminding note that both "Landscape LOD generator" as well as our "TES4LL" mod need to be activated in the left pane, would be good.

Edited by pStyl3
  • 0
Posted

Looks great. An up-to-date, working procedure to get TES4LL working under MO. ::): Let's see what gruftikus might come up with in the future, but for now that's the way to go.

  • 0
Posted

Landscape LOD generator tes4ll - 5.00

 

 

Content of the updated file:

 

Data\Docs\..

- README-tes4ll-Oblivion.txt

- Triangle_Copyright.txt

Data\Ini\tes4ll\..

- CityPolygons.dat

- FortEmpire_Aleswell.dat

- FortUrasekToAleswell.dat

- FortUrasekToBridge.dat

- RumareCoastLine.dat

- tes4ll_all.mpb

- tes4ll_little_tamriel.mpb

- UL_RollingHills.dat

- WayToCheydinhal.dat

- Weye_FortAsh.dat

- WeyeNorth_FortEmpire.dat

- WeyeWaynet.dat

Data\tes4qlod_tex\Oblivion\..

- too many files to list here..

Data\..

- tes4ll.exe

- tes4ll_DibellasWatch_ultimate.bat

- tes4ll_highres.bat

- tes4ll_midres.bat

- tes4ll_normalmaps.bat

- tes4ll_tes4qlod.bat

- tes4ll_tes4qlod_cache.bat

- tes4ll_ultimate.bat

- tes4qlod_Oblivion_ltex.dat

 

 

 

What I've tested in conjunction with MO:

 

tes4ll_ultimate.bat

tes4ll_tes4qlod.bat

tes4ll_normalmaps.bat

 

 

I tested these three files of TES4LL v5.00 under MO and found, that they are all working - if some additional editing is done.

 

 

 

Installation and Initialization:

 

First, TES4LL needs to be installed. The normal installation instructions are, that it needs to be installed directly into:

..\Oblivion\Data\..

 

Because we (the ones looking up this particular thread) use Mod Organizer, we can install TES4LL from within MO; MO's virtual file system will make sure, that TES4LL will see all relevant files. So I added "Landscape LOD generator" as a normal mod in MO - Screenshot - Installation.

 

Click "OK", then "Ignore". It should work nonetheless (as this is "only" a tool, and not a mod that should work ingame).

 

Once that is installed, I added the 3 files mentioned above as executables in MO, with these filespaths:

C:\Spiele\Modding\0_Programme\Mod_Organizer_Oblivion\mods\Landscape LOD generator\tes4ll_ultimate.bat

C:\Spiele\Modding\0_Programme\Mod_Organizer_Oblivion\mods\Landscape LOD generator\tes4ll_tes4qlod.bat

C:\Spiele\Modding\0_Programme\Mod_Organizer_Oblivion\mods\Landscape LOD generator\tes4ll_normalmaps.bat

 

So I used the .bat files from my just installed Landscape LOD generator-"Mod".

 

So far so good, but that isn't everything that needs to be done. If I would now run these executables from within MO, the files wouldn't appear where I want them to be. For example, if I now would run "tes4ll_ultimate.bat" from within MO, the newly created meshes would be placed - if another mod already has such meshes with the same file names - inside that mod, replacing the mod's original files. In this case, that would happen with the "Unofficial Oblivion Patch". That is basically the problem I reported here aswell.

 

That, of course, must be prevented.

 

Step 1:

- Go to your "Oblivion Mod Organizer"-folder and open the "mods" folder.

- Create a new folder named "TES4LL". Open it and create the following (empty) folders:

 

Meshes

- Landscape

-- LOD

Textures

- LandscapeLOD

-- Generated

 

So this should be the result (in MO). This first step is necessary (or better said, to me it seems to be), because if this "mod"-folder wouldn't be setup prior to running the batch files, the batch files would throw an error and thus wouldn't create the files they should. That said, if the instructions of "Step 1" are followed, everything is playing nice.

 

Step 2:

Open your "Landscape LOD generator"-mod in Windows Explorer, and goto:

..\Ini\tes4ll\..

 

Now open "tes4ll_all.mpb" with an Editor of your choice - I use Notepad++

Now change the path $_gamedir\Data\ in several places* to C:\Spiele\Modding\0_Programme\Mod_Organizer_Oblivion\mods\TES4LL\ .. well, actually do not copy that second path just like that, you must use your own correct path, that points to your "TES4LL"-mod, which you have just created in "Step 1".

 

* here is my entire modified "tes4ll_all.mpb" file, where you can see what I have changed:

 

 

 

[tes4ll]

@logfile LogFile -filename=$logfile

 

; ============================

; Optional pedestal walls

; Requires more triangles!

; Enable this only if you want to exchange or overwrite single quads

; Not required if you rerun tes4ll after landscape changes

; Read the manual for more info

; SetFlag -name="createpedestals" -value="-createpedestals"

; ============================

 

; ============================

; Optional 16 bit matrices (no 32-bit floats)

; enable this only if the tes4ll task exceeds 3GB

; and you have a crash

; SetFlag -name="use16bit" -value="-use16bit"

@use16bitopt SetFlag -name="use16bit" -value="-use16bit"

; ============================

 

ParseModList -cd    ;reads mod list from Plugins.txt (or from -l option) and set the flags

 

SetFlag -name="_quad_levels" -value=2

 

SetFlag -name="dds_format" -value="DXT1"

@c_dxt3 SetFlag -name="dds_format" -value="DXT3"

@c_dxt5 SetFlag -name="dds_format" -value="DXT5"

 

@!minheight SetFlag -name="minheight" -value="-2048"

 

; ****************************

; Make color maps

; ****************************

 

@tes4qlod_cache {

    SetFlag -name="_install_dir" -value="C:\Spiele\Modding\0_Programme\Mod_Organizer_Oblivion\mods\TES4LL\"

    FileIterator -pattern="*.bsa" {

        BsaIterator -bsafile=$_filename -regex="textures\\\\landscape\\\\.*\\.dds" {

            ImportMapFromDDS -even -name=test -replacemap

            ScaleMap -sizeX=4 -sizeY=4 -map=test

            SetFlag -name=newname -value=$_bsafilename -replace=".dds" -with=".bmp"

            SetFlag -name=newname -value=$newname -replace="textures\\landscape" -with="tes4qlod_tex\\Oblivion" -num=1

            MkDir -path=$newname -hasfilename

            ExportMap -filename=$newname -map=test

        }

    }

 

    {

        FileIterator -directory="textures\\landscape" -pattern="*.dds" -recursive {

            ImportMapFromDDS -filename=$_filename -even -name=test -replacemap

            ScaleMap -sizeX=4 -sizeY=4 -map=test

            SetFlag -name=newname -value=$_filename -replace=".dds" -with=".bmp"

            SetFlag -name=newname -value=$newname -replace="textures\\landscape" -with="tes4qlod_tex\\Oblivion" -num=1

            MkDir -path=$newname -hasfilename

            ExportMap -filename=$newname -map=test

        }

    }

}

 

@!makemeshes @!writeout @!tes4qlod @!makenormalmaps Exit

 

SetFlag -name=tes4qlod_flag_a -value=""

@option_blending SetFlag -name=tes4qlod_flag_a -value="-a"

 

SetFlag -name=tes4qlod_flag_q -value="1"

@qlod2 SetFlag -name=tes4qlod_flag_q -value="2"

@qlod4 SetFlag -name=tes4qlod_flag_q -value="4"

 

ImportMapFromModList

SetFlag -name="large_ws" -value=$($_nquads>100) -zerosuppression

@large_ws SetFlag -name="use16bit" -value="-use16bit"

 

SelectAll

 

@tes4qlod {

    SetFlag -name="option_silent_opt" -value=""

    @option_silent SetFlag -name="option_silent_opt" -value="-silent"

    SetFlag -name="width_x" -value=$(($_x2-$_x1)*$tes4qlod_flag_q/128)

    SetFlag -name="width_y" -value=$(($_y2-$_y1)*$tes4qlod_flag_q/128)

    CreateMap -name=terraincolor -widthx=$width_x -widthy=$width_y -x1=$_x1 -y1=$_y1 -x2=$_x2 -y2=$_y2 -zscale=1 -rgb -even

    Tes4qlod -colormap=terraincolor -q=$tes4qlod_flag_q $tes4qlod_flag_a $option_silent_opt

    SetFlag -name="_install_dir" -value="C:\Spiele\Modding\0_Programme\Mod_Organizer_Oblivion\mods\TES4LL\"

    @option_map ExportMap -map=terraincolor -filename="$_worldspace&Map.bmp" -FlipY

    @overwritelods  SetFlag -name="_install_dir" -value="C:\Spiele\Modding\0_Programme\Mod_Organizer_Oblivion\mods\TES4LL\Textures\landscapelod\generated"

    SetFlag -name=_flag_format -value="02.0"

    QuadIterator -level=0 {        

        @!c_none ExportMapToDDS -map=terraincolor -filename="$_worldspaceid.$($_quad_x * 32).$(32 * $_quad_y).32.dds" -format=$dds_format

        @c_none  ExportMap      -map=terraincolor -filename="$_worldspaceid.$($_quad_x * 32).$(32 * $_quad_y).32.bmp"

    }

}

 

; ****************************

; Make normal maps

; ****************************

 

@makenormalmaps {

    SelectAll

    CopyMap -name="_heightmap_tmp"

    @2048  ScaleMap -map="_heightmap_tmp" -factor=2

    @512   ScaleMap -map="_heightmap_tmp" -factor=0.5

    @!lodshadows CreateNormalMap -map="_heightmap_tmp" -name="_normalmap" -boost=$z_val

    @lodshadows  CreateNormalMap -map="_heightmap_tmp" -name="_normalmap" -shadows -northboost=$z_val

    SetFlag -name="_install_dir" -value="C:\Spiele\Modding\0_Programme\Mod_Organizer_Oblivion\mods\TES4LL\"

    @option_map ExportMap -map=_normalmap -filename="$_worldspace&Normalmap.bmp" -FlipY

    @overwritelods  SetFlag -name="_install_dir" -value="C:\Spiele\Modding\0_Programme\Mod_Organizer_Oblivion\mods\TES4LL\Textures\landscapelod\generated"

    SetFlag -name=_flag_format -value="02.0"

    QuadIterator -level=0 {

        @!c_none ExportMapToDDS -map=_normalmap -filename="$_worldspaceid.$($_quad_x * 32).$(32 * $_quad_y).32_fn.dds" -format=$dds_format

        @c_none  ExportMap      -map=_normalmap -filename="$_worldspaceid.$($_quad_x * 32).$(32 * $_quad_y).32_fn.bmp"

    }

}

 

; ****************************

; Generate optional heightmap

; ****************************

 

@writeout {

    SetFlag -name="_install_dir" -value="C:\Spiele\Modding\0_Programme\Mod_Organizer_Oblivion\mods\TES4LL"

    SelectAll

    ExportMap -depth=32 -filename="$_worldspace.bmp"

}

 

; ****************************

; Make meshes

; ****************************

 

@!makemeshes Exit

 

SetHeight -min -z=$minheight -usegameunits

 

@!overwritelods SetFlag -name="_install_dir" -value="C:\Spiele\Modding\0_Programme\Mod_Organizer_Oblivion\mods\TES4LL\"

@overwritelods  SetFlag -name="_install_dir" -value="C:\Spiele\Modding\0_Programme\Mod_Organizer_Oblivion\mods\TES4LL\Meshes\Landscape\LOD"

MkDir -path=$_install_dir

 

SetFlag -name="opt_useshapes" -value=""

@ultimate      SetFlag -name="opt_useshapes" -value="-useshapes"

@useshapes     SetFlag -name="opt_useshapes" -value="-useshapes"

 

; ============================

; Step 1:

; Set single custom points

; With the console command "tdt" coordinates of critical points

; can be obtained and added in this section:

; ============================

@usedatafiles ReadDataFile -filename=ini\tes4ll\RumareCoastLine.dat

@usedatafiles ReadDataFile -filename=ini\tes4ll\WeyeNorth_FortEmpire.dat

@usedatafiles ReadDataFile -filename=ini\tes4ll\WeyeWaynet.dat

@usedatafiles ReadDataFile -filename=ini\tes4ll\Weye_FortAsh.dat

@usedatafiles ReadDataFile -filename=ini\tes4ll\FortEmpire_Aleswell.dat

@usedatafiles ReadDataFile -filename=ini\tes4ll\WayToCheydinhal.dat

@usedatafiles ReadDataFile -filename=ini\tes4ll\FortUrasekToBridge.dat

@usedatafiles ReadDataFile -filename=ini\tes4ll\FortUrasekToAleswell.dat

 

@xulRollingHills_EV.esp @usedatafiles ReadDataFile -filename=ini\tes4ll\UL_RollingHills.dat

; ============================

 

 

; ============================

; Step 2:

; Set cell grid nodes (optional)

; NB: the DivideGrid commands sets vertices at the grid points anyhow.

; So it does not hurt to have the points in advance

; ============================

SelectAll                       ; use the entire worldspace

SetGrid -x=4096 -y=4096

@wallremover @ultimate SetFlag -name="_mindistance" -value=100  

@wallremover @ultimate @!small_world SetAtGridLine -x=4096 -y=4096 -max=80  -zmin=-200

@wallremover @ultimate @small_world  SetAtGridLine -x=4096 -y=4096 -max=50  -zmin=0

@wallremover @high_res SetFlag -name="_mindistance" -value=128

@wallremover @high_res @!small_world SetAtGridLine -x=4096 -y=4096 -max=150 -zmin=-200

@wallremover @high_res @small_world  SetAtGridLine -x=4096 -y=4096 -max=130 -zmin=0

; ============================

 

 

; ============================

; Step 3:

; Set custom panorama view for better horizon

SelectAll

SetFlag -name="_mindistance" -value=256  

@usepanorama Panorama -x=0 -y=0            ;imperial city  

@usepanorama Panorama -x=38520 -y=46880    ;university

@ElsweyrAnequina.esp @usepanorama Panorama -x=7410  -y=-157980    ;corinthe

; ============================

 

 

; ============================

; Step 4:

; Improve the coast line (optional)

; Comment the following lines, if the contour is not

; wanted.

; ============================

SelectAll

SetFlag -name="_mindistance" -value=128

 

@contour {

    @!contour_grid SetFlag -name="contour_grid" -value=4

    ContourLine -x=4096 -y=4096 -z=0 -offsetx=0 -offsety=0             

    ContourLine -x=512 -y=512 -z=100 -offsetx=0 -offsety=0 -findmax -minmaxgrid=$contour_grid          

    ContourLine -x=512 -y=512 -z=-100 -offsetx=256 -offsety=256 -findmin -minmaxgrid=$contour_grid  

}

         

SetFlag -name="_mindistance" -value=256 ;;; CS uses 1/16th of a cell = 256

; ============================

 

 

 

; ============================

; Step 5:

; Smooth the heighmap

; Avoids that the random points are triggered by local fluctuations

; ============================

@!small_world Filter -n=4    

@small_world Filter -n=3

 

MakeDerivatives -map="_heightmap_filtered" $use16bit

; ============================

 

 

; ============================

; Step 6:

; Define the density algorithms for the

; random vertex points in Step 6

; ============================

SelectAll

 

;AlgConst

AlgFirstOrder -add=0.2

@!small_world AlgSecondOrder -add=0.5

@small_world AlgSecondOrder -add=1

 

;improve mountain peaks

;;;@nicer_mountains @!small_world AlgPeakFinder -multiply=1 -radius=4096 -scanradius=8192 -lowest=4000 -insideval=1 -outsideval=0.2

@nicer_mountains AlgPeakFinder -multiply=1 -radius=4096 -scanradius=4096 -lowest=1000 -insideval=1 -outsideval=0.5 -linear

 

;AlgSecondOrder -multiply=1

 

; Switch off sampling below the shore line:

AlgLayer -multiply=1 -zmin=-999999 -zmax=-300 -outsideval=1 -insideval=0

; ============================

 

 

; ============================

; Step 7:

; Set the random points

;

; Very important: the Oblivion game engine has large

; limitations. At the end, the mesh of each quad must

; not have a number of vertices, triangles and points larger then 65535

;

; The focus command can be used, as described in Step 6,

; ============================

SelectAll

 

;;mid-res:

SetFlag -name="_mindistance" -value=256  

SetFlag -name="n" -value=10000   

 

@high_res {

    SetFlag -name="_mindistance" -value=200  

    @!small_world SetFlag -name="n" -value=13000  

    @small_world  SetFlag -name="n" -value=20000  

}

@ultimate {

    SetFlag -name="_mindistance" -value=200

    @small_world  SetFlag -name="_mindistance" -value=128  

    @!small_world SetFlag -name="n" -value=18000  

    @small_world @_worldspace=DibellasWatch  SetFlag -name="n" -value=30000   

    @small_world @!_worldspace=DibellasWatch SetFlag -name="n" -value=25000

}

 

QuadIterator -level=0 {

    Echo -text="Filling quad $_quad_x&,$_quad_y with vertices"

    SetAlgVertices -n=$n -max

}

; ============================

 

 

 

; ============================

SelectAll

MakeTriangulation

 

SelectAll

SplitAtGrid -x=4096 -y=4096

; ============================

 

 

; ============================

 

SetFlag -name=_flag_format -value="02.0"

 

QuadIterator -level=0 {

    ExportMeshToNif -filename="$_worldspaceid.$($_quad_x * 32).$(32 * $_quad_y).32.nif" $opt_useshapes $createpedestals

}

 

; ============================

 

@end

 

; ****************************

[mpgui]

; ****************************

 

GUIRequestVersion -value="1.22"

 

@!tes4ll_doonce GUITab -help="Options for mesh generation" -text="LOD Meshes" -name=tes4ll_gui

@!tes4ll_doonce GUITab -help="Normalmaps" -text="Normal Maps" -name=tes4llnm_gui

@!tes4ll_doonce GUITab -help="Options for Lightwave's TES4qLOD" -name="tes4qlod_gui" -text="Color Maps"

@!tes4ll_doonce GUITab -help="Start process here" -name="final_gui" -text="Start Process"

 

@!tes4ll_doonce GUIConsoleEcho -text="Tes4ll batch file for Tamriel loaded"

SetFlag -name=tes4ll_doonce -hidden

 

SetOption -noskipinfo ;avoid nasty skip messenges in loop mode

 

; ****************************

[final_gui]

; ****************************

 

## makes sure that tab is disabled if no worldspace is selected:

GUIEnable -name=final_gui

@!_worldspace GUIDisable -name=final_gui

 

GUITextBox -text="If you have selected all previous options, you can continue here..." -name=final_gui_intro -vdist=10

 

 

GUITextBox -text="General options" -name=tes4ll_text2 -vdist=10

 

## A checkbox for a basic question:

GUICheckBox -name=overwritelods -text="Overwrite the original files (please make a backup before checking this option)" -help="You have to check this option if tes4ll should place the new files in the LOD directories."

GUIEnable -name=overwritelods

@!makemeshes @!makenormalmaps @!tes4qlod GUIDisable -name=overwritelods

 

GUICheckBox -name=use16bitopt -text="Use 16 bit derivative matrices" -help="Only slightly more unprecise, but saves 2x memory. Use this for large worlds like Onras heightmaps of Tamriel"

GUIEnable -name=use16bitopt

@!makemeshes GUIDisable -name=use16bitopt

 

GUITextBox -text="Minimum height" -name=min_height_intro -width=0.30 -vdist=10

GUITextBox -text="-2048" -name=minheight -input -sameline -width=0.70 -help="Set a mimimum value for the heightmap, in particular for empty cells. Change this only if you know what you are doing."

 

GUICheckBox -name=writeout -text="Write heightmap as a 32-bit bmp file" -vdist=5

 

GUITextBox -text="Tool options" -name=tes4ll_text4 -vdist=10

 

GUIDropDown -name=flagnm_compression -vdist=5 -help="dds compression format."

GUIDropDownItem -parent=flagnm_compression -name=c_dxt1 -text="Use DDS DXT1 compression"

GUIDropDownItem -parent=flagnm_compression -name=c_dxt3 -text="Use DDS DXT3 compression"

GUIDropDownItem -parent=flagnm_compression -name=c_dxt5 -text="Use DDS DXT5 compression" -select

GUIDropDownItem -parent=flagnm_compression -name=c_none -text="<None> (needs other tool to convert bmp to dds)"

GUIEnable -name=flagnm_compression

@!makenormalmaps @!tes4qlod GUIDisable -name=flagnm_compression

 

 

 

## The final button. Once the button is clicked, the flag "exec_tes4ll" is set for one single run of this section

GUIButton -name=exec_tes4ll -text="Click me if you are ready" -vdist=30

GUIEnable -name=exec_tes4ll

@!makenormalmaps @!tes4qlod @!tes4qlod_cache @!makemeshes @!writeout GUIDisable -name=exec_tes4ll

 

 

@exec_tes4ll @!overwritelods GUIMessageBox -title="Hint" -text="You have not selected the option to overwrite the original files. Do not forget to copy your files by hand to the appropriate place (or stop the process, and check the \"overwrite\" option)"

@exec_tes4ll @_worldspace GUIExec -exe="tes4ll.exe -f \"$_flaglist\" -w $_worldspace -l \"$_modlist\" stdin" -dumpbatch

 

 

; ****************************

[tes4ll_gui]

; ****************************

 

## makes sure that tab is disabled if no worldspace is selected:

GUIEnable -name=tes4ll_gui

@!_worldspace GUIDisable -name=tes4ll_gui

 

GUITextBox -text="Select options for LOD mesh generation..." -name=tes4ll_gui_intro -vdist=10

 

## A checkbox for a basic question:

GUICheckBox -name=makemeshes -text="Make LOD meshes" -help="Check this if you want to create the LOD meshes" -select

 

GUITextBox -text="Options for vertices placement" -name=tes4ll_text1 -vdist=10

 

## A checkbox for a basic question:

GUICheckBox -name=nicer_mountains -text="Enable peak finder algorithm" -help="Enhances the quality of the mountains" -select

GUIEnable -name=nicer_mountains

@!makemeshes GUIDisable -name=nicer_mountains

 

## A checkbox for a basic question:

GUICheckBox -name=wallremover -text="Enable the cell grid boundary wall remover" -help="Enhances the near to far grid transition. Highly recommended" -select

GUIEnable -name=wallremover

@!makemeshes GUIDisable -name=wallremover

 

## A checkbox for a basic question:

GUICheckBox -name=contour -text="Enable the contour algorithm for coasts" -help="Enhances the coast line. Highly recommended" -select -width=0.30

GUIEnable -name=contour

@!makemeshes GUIDisable -name=contour

## Add a drop down menu, first the parent:

GUIDropDown -name=contour_grid_s -help="Select your resolution"  -width=0.70 -sameline

## and now the items:

GUIDropDownItem -parent=contour_grid_s -name=c3 -text="Coarse grid"

GUIDropDownItem -parent=contour_grid_s -name=c2 -text="Normal grid" -select

GUIDropDownItem -parent=contour_grid_s -name=c1 -text="Fine grid"

GUIEnable -name=contour_grid_s

@!makemeshes GUIDisable -name=contour_grid_s

@c1 SetFlag -name=contour_grid -value="1"

@c2 SetFlag -name=contour_grid -value="4"

@c3 SetFlag -name=contour_grid -value="16"

 

##

GUICheckBox -name=usedatafiles -text="Use Tamriel data files" -help="Use some hand-placed vertex points" -select

GUIEnable -name=usedatafiles

@!_worldspace=Tamriel GUIDisable -name=usedatafiles -unselect

@!_worldspace GUIEnable -name=usedatafiles -select

@!makemeshes GUIDisable -name=usedatafiles

 

##

GUICheckBox -name=usepanorama -text="Use Tamriel panorama points" -select

GUIEnable -name=usepanorama

@!_worldspace=Tamriel GUIDisable -name=usepanorama -unselect

@!_worldspace GUIEnable -name=usepanorama -select

@!makemeshes GUIDisable -name=usepanorama

 

GUITextBox -text="Total resolution (number of vertex points per quad)" -name=tes4ll_text1 -vdist=10

 

## Add a drop down menu, first the parent:

GUIDropDown -name=flag_res -vdist=5 -help="Select your resolution"

## and now the items:

GUIDropDownItem -parent=flag_res -name=mid_res -text="Mid Resolution " -select

GUIDropDownItem -parent=flag_res -name=high_res -text="High Resolution"

GUIDropDownItem -parent=flag_res -name=ultimate -text="Ultimate Resolution"

GUIEnable -name=flag_res

@!makemeshes GUIDisable -name=flag_res

 

 

GUITextBox -text="Mesh options" -name=tes4ll_text3 -vdist=20

 

## A checkbox for a basic question:

GUICheckBox -name=useshapes -text="Use shapes instead of strips" -help="Faster generation, but needs more graphics card performance"

GUIEnable -name=useshapes

@ultimate GUIDisable -name=useshapes -select

@!makemeshes GUIDisable -name=useshapes

 

GUICheckBox -name=small_world -text="Use small world setup" -help="Try to further enhance the settings. Use this option only for small worldspaces which have about 2-4 quads"

GUIEnable -name=small_world

@!makemeshes GUIDisable -name=small_world

@_worldspace=Tamriel GUIDisable -name=small_world -unselect

 

 

; ****************************

[tes4llnm_gui]

; ****************************

 

## makes sure that tab is disabled if no worldspace is selected:

GUIEnable -name=tes4llnm_gui

@!_worldspace GUIDisable -name=tes4llnm_gui

 

GUITextBox -text="Select options for normal maps generation..." -name=tes4llnm_gui_intro -vdist=10

 

 

## A checkbox for a basic question:

GUICheckBox -name=makenormalmaps -text="Make normal maps" -help="Select this if you want to generate the normal maps"

 

###--------------------------------------------------------------

GUITextBox -text="Graphics options" -name=tes4llnm_text3 -vdist=10

 

GUIDropDown -name=flagnm_resnormal -vdist=5 -help="Select your texture resolution"

GUIDropDownItem -parent=flagnm_resnormal -name=512 -text="512x512"

GUIDropDownItem -parent=flagnm_resnormal -name=1024 -text="1024x1024" -select

GUIDropDownItem -parent=flagnm_resnormal -name=2048 -text="2048x2048"

GUIEnable -name=flagnm_resnormal

@!makenormalmaps GUIDisable -name=flagnm_resnormal

 

GUICheckBox -name=lodshadows -text="Fake shadows (can take a while)" -help="Tweaks the normap maps such to obtain the impression of landscape shadows" -vdist=5

GUIEnable -name=lodshadows

@!makenormalmaps GUIDisable -name=lodshadows

 

GUITextBox -text="z-Boost for non-faked normals" -name=tes4llnm_text3a -vdist=10

 

GUIDropDown -name=flagnm_zboost -vdist=5 -help="Boost factor for z"

GUIDropDownItem -parent=flagnm_zboost -name=z1 -text="Factor 1 (undistorted)"

GUIDropDownItem -parent=flagnm_zboost -name=z2 -text="Factor 2 (more contrast)" -select

GUIDropDownItem -parent=flagnm_zboost -name=z4 -text="Factor 4 (even more contrast)"

GUIEnable -name=flagnm_zboost

@lodshadows GUIDisable -name=flagnm_zboost

@!makenormalmaps GUIDisable -name=flagnm_zboost

 

@z1 SetFlag -name=z_val -value="1"

@z2 SetFlag -name=z_val -value="2"

@z4 SetFlag -name=z_val -value="4"

 

 

; ****************************

[tes4qlod_gui]

; ****************************

 

## makes sure that tab is disabled if no worldspace is selected:

GUIEnable -name=tes4qlod_gui

@!_worldspace GUIDisable -name=tes4qlod_gui

 

GUITextBox -text="Select options for color maps generation..." -name=tes4qlod_gui_intro -vdist=10

 

GUICheckBox -name=tes4qlod_cache -text="Regenerate texture cache" -help="Always required if started first time"

 

## A checkbox for a basic question:

GUICheckBox -name=tes4qlod -text="Make color maps (calls build-in TES4qLOD)" -help="Select this if you want to generate the color maps with TES4qLOD"

 

## Just some info:

GUITextBox -text="Please select what TES4qLOD should do" -name=tes4qlod_into -vdist=10

 

GUITextBox -text="Select resolution per quad:" -name=tes4qlod_into2 -vdist=10

 

## Add a drop down menu, first the parent:

GUIDropDown -name=tes4qlod_resolution -help="Select the resolution for a single quad (N.B. Vanilla has 512x512)" -vdist=3

## and now the items:

GUIDropDownItem -parent=tes4qlod_resolution -name=qlod1 -text="1024x1024 pixel [recommended]" -select

GUIDropDownItem -parent=tes4qlod_resolution -name=qlod2 -text="2048x2048 pixel"

GUIDropDownItem -parent=tes4qlod_resolution -name=qlod4 -text="4096x4096 pixel"

GUIEnable -name=tes4qlod_resolution

@!tes4qlod GUIDisable -name=tes4qlod_resolution

 

 

 

GUITextBox -text="Options:" -name=tes4qlod_into3 -vdist=10

 

## New blending flag

GUICheckBox -name=option_blending -text="Use layer blending" -help="Uses the opacity of the different layers for alpha blending" -select

GUIEnable -name=option_blending

@!tes4qlod GUIDisable -name=option_blending

 

 

## A flag about the total map:

GUICheckBox -name=option_map -text="Create full map of wordspace" -help="Creates a full map of your worldspace"

GUIEnable -name=option_map

@!tes4qlod GUIDisable -name=option_map

 

 

## Verbosity option of tes4qlod:

GUICheckBox -name=option_silent -text="Silent TES4qLOD" -help="Disables all the text output of tes4qlod"

GUIEnable -name=option_silent

@!tes4qlod GUIDisable -name=option_silent

 

 

 

 

 

Results and thoughts:

 

If those two things from above are made, all three .bat files can be successfully run through MO and the files will be placed into the "TES4LL"-mod in MO. The three .log files..

 

tes4ll.log

tes4ll_normalmaps.log

tes4qlod.log

 

 

.. that will be created during this process will showup in MO's "Overwrite" mod .. nothing to complain here, they easily can either be deleted or manually moved to the TES4LL-mod by drag&drop.

 

 

 

Now .. speaking from MO's perspective .. it would be ideal, if these sorts of manual edits wouldn't be necessary, so that TES4LL can be used though MO. I think, that a command line to specify an output folder - like TES4LODGen.exe's -O: argument - could do the job. So that the user can specify, that files should be placed in a custom folder, and not into a static location like $_gamedir\Data\.......

 

I can't really say if that is feasible - and if my conclusion is correct in the first place - and if yes, how much work that would require .. but that's how I currently see it.

 

 

So, I would say .. TES4LL can be workarounded under MO now! ::):

 

Thanks a lot gruftikus.

Thanks for this, pStyl3. Worked like a charm with no problems in MO 1.3.5 <3 *muah*

  • 0
Posted

There is a little bit cry for help here: https://forum.step-project.com/topic/9452-landscape-lod-generator-tess4ll-and-mo/

 

as it was suggested above I added two more variables to the mpb file (for the Fallout version!), namely $_tmpdir, an installation directory, and $_datadir, just in case the Data directory should be combined with $_gamedir. Both can be defined in the bat-file which starts the process.

 

It would be nice if someone could test this, so I can add this also in the next Oblivion version

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Guidelines, Privacy Policy, and Terms of Use.