• Welcome to SC4 Devotion Forum Archives.
 

News:

The SC4 Devotion Forums are no longer active, but remain online in an archived, read-only "museum" state.  It is not possible for regular members to post or use the private messaging system, and no technical support will be provided for any issues pertaining to the forums in their current state.  Attachments (those that still work) are accessible without login.

The LEX has been replaced with SC4Evermore (SC4E), and SC4E maintains an active Discord server.  For traditional forums, we recommend Simtropolis.

Main Menu

Chinese fix for floating seawall glitch: How does it work?

Started by ultrasu, October 23, 2013, 01:40:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ultrasu

I'm sure most of you have checked out Marrast's Embankment Set, and read his disclaimer about visual glitches occuring at certain zoom levels, something that happens with most diagonal seawalls models.

Today I stumbled upon a fix for a couple of popular sets at simcity.cn, by user SMTfrank (original / google translate, might not load the images)

And it works!
Before:


After:


Now, the only problem is that I don't know how it works, I'd like to use this trick for my own walls (yes, the obnoxiously colored things on the left, they're still in early draft stage). SMTfrank's fixes are basically two .dats filled with white S3D models and a DIR file, so I'd be very thankful if someone with more experience could tell me what they do.

(note: just like the LEX, you have to register at simcity.cn to download the files, here's kind of a how-to if you're having problems)

nbvc

I found a way to change the gmax script to create LODs for all zoom levels.

You have to edit gmax\gamepacks\BAT\scripts\BuildingMill.ms with a text editor.
In the file is this function:

----------------------------------------------------------------------------------------------------
-- Function: FnGetLODNodes
----------------------------------------------------------------------------------------------------
fn FnGetLODNodes &lods =
(
FnCreateLOD_3_4_5()

local tempLOD1
local tempLOD2

-- creat a box that is the bounds of the LOD3 shell to use as the shell for lod 1 & 2

tempLOD1 = box width:($LOD3.max.x - $LOD3.min.x) length:($LOD3.max.y - $LOD3.min.y) height:($LOD3.max.z - $LOD3.min.z)
tempLOD1.position.x += $LOD3.min.x - tempLOD1.min.x
tempLOD1.position.y += $LOD3.min.y - tempLOD1.min.y
tempLOD1.position.z += $LOD3.min.z - tempLOD1.min.z
tempLOD1.name = "TB2_TempLOD1_Box"

tempLOD2 = box width:($LOD3.max.x - $LOD3.min.x) length:($LOD3.max.y - $LOD3.min.y) height:($LOD3.max.z - $LOD3.min.z)
tempLOD2.position.x += $LOD3.min.x - tempLOD2.min.x
tempLOD2.position.y += $LOD3.min.y - tempLOD2.min.y
tempLOD2.position.z += $LOD3.min.z - tempLOD2.min.z
tempLOD2.name = "TB2_TempLOD2_Box"

lods = #($TB2_TempLOD1_Box, $TB2_TempLOD2_Box, $LOD3, $LOD4, $LOD5)

-- need to make sure that all the shells are there

return true
)


Change it to look like this:

----------------------------------------------------------------------------------------------------
-- Function: FnGetLODNodes
----------------------------------------------------------------------------------------------------
fn FnGetLODNodes &lods =
(
FnCreateLOD_3_4_5()

lods = #($LOD3, $LOD3, $LOD3, $LOD4, $LOD5)

-- need to make sure that all the shells are there

return true
)


Now the LOD3 will be used for zoom 1 and 2 too.