SC4 Devotion Forum Archives

SimCity 4 General Discussion and Tutorials => SimCity 4 General Discussion => General Custom Content Discussion => Topic started by: ultrasu on October 23, 2013, 01:40:49 PM

Title: Chinese fix for floating seawall glitch: How does it work?
Post by: ultrasu on October 23, 2013, 01:40:49 PM
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 (http://www.simcity.cn/forum.php?mod=redirect&goto=findpost&pid=970349) / google translate, might not load the images (http://translate.google.com/translate?hl=en&ie=UTF8&prev=_t&sl=zh-CN&tl=en&u=http://www.simcity.cn/forum.php%3Fmod%3Dviewthread%26tid%3D60979%26page%3D8%23pid970349&sandbox=0&usg=ALkJrhg7QjdTmpj6b8VLDHWPbXRscUbFNQ))

And it works!
Before:
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FBXk1oGt.jpg&hash=a824d13ce6eacc55822dee074e05a39ce70cefa3)

After:
(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FtC6bovT.jpg&hash=bd8aabb3e7738de9f3b7966e793fa96935c2e213)

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 (http://sc4devotion.com/forums/index.php?topic=14964.0))
Title: Re: Chinese fix for floating seawall glitch: How does it work?
Post by: nbvc on November 02, 2013, 09:55:04 AM
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.