mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
commit
a177bbffca
@ -23,7 +23,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
|
|
||||||
public static class BrambleDimensionBuilder
|
public static class BrambleDimensionBuilder
|
||||||
{
|
{
|
||||||
public static readonly float BASE_DIMENSION_RADIUS = 1705f;
|
public static readonly float BASE_DIMENSION_RADIUS = 750f;
|
||||||
|
|
||||||
// location of all vanilla bramble dimensions
|
// location of all vanilla bramble dimensions
|
||||||
//-9116.795 -19873.44 2480.327
|
//-9116.795 -19873.44 2480.327
|
||||||
@ -62,7 +62,7 @@ namespace NewHorizons.Builder.Body
|
|||||||
var detailInfo = new PropModule.DetailInfo();
|
var detailInfo = new PropModule.DetailInfo();
|
||||||
var geometry = DetailBuilder.MakeDetail(go, sector, prefab, detailInfo);
|
var geometry = DetailBuilder.MakeDetail(go, sector, prefab, detailInfo);
|
||||||
|
|
||||||
var exitWarps = SearchUtilities.Find("DB_HubDimension_Body/Sector_HubDimension/OuterWarp_Hub").InstantiateInactive();
|
var exitWarps = SearchUtilities.Find("DB_HubDimension_Body/Sector_HubDimension/Interactables_HubDimension/OuterWarp_Hub").InstantiateInactive();
|
||||||
var repelVolume = SearchUtilities.Find("DB_HubDimension_Body/BrambleRepelVolume").InstantiateInactive();
|
var repelVolume = SearchUtilities.Find("DB_HubDimension_Body/BrambleRepelVolume").InstantiateInactive();
|
||||||
|
|
||||||
atmo.name = "Atmosphere";
|
atmo.name = "Atmosphere";
|
||||||
@ -155,13 +155,15 @@ namespace NewHorizons.Builder.Body
|
|||||||
// Set the scale
|
// Set the scale
|
||||||
var scale = config.radius / BASE_DIMENSION_RADIUS;
|
var scale = config.radius / BASE_DIMENSION_RADIUS;
|
||||||
geometry.transform.localScale = Vector3.one * scale;
|
geometry.transform.localScale = Vector3.one * scale;
|
||||||
|
sector.gameObject.GetComponent<SphereShape>().radius *= scale;
|
||||||
outerFogWarpVolume._warpRadius *= scale;
|
outerFogWarpVolume._warpRadius *= scale;
|
||||||
outerFogWarpVolume._exitRadius *= scale;
|
outerFogWarpVolume._exitRadius *= scale;
|
||||||
|
|
||||||
var fogGO = atmo.FindChild("FogSphere_Hub");
|
var fogGO = atmo.FindChild("FogSphere_Hub");
|
||||||
var fog = fogGO.GetComponent<PlanetaryFogController>();
|
var fog = fogGO.GetComponent<PlanetaryFogController>();
|
||||||
fog._fogRadius *= scale;
|
fog._fogRadius *= scale;
|
||||||
fog._fogDensity *= scale;
|
fog._fogDensity = config.fogDensity * scale;
|
||||||
|
atmo.FindChild("FogBackdrop_Hub").transform.localScale *= scale;
|
||||||
|
|
||||||
var volumesShape = volumes.FindChild("ZeroG_Fluid_Audio_Volume");
|
var volumesShape = volumes.FindChild("ZeroG_Fluid_Audio_Volume");
|
||||||
var sphereShape = volumesShape.GetComponent<SphereShape>();
|
var sphereShape = volumesShape.GetComponent<SphereShape>();
|
||||||
@ -169,17 +171,19 @@ namespace NewHorizons.Builder.Body
|
|||||||
sphereShape.radius *= scale;
|
sphereShape.radius *= scale;
|
||||||
|
|
||||||
// Change fog color
|
// Change fog color
|
||||||
if (body.Config.Bramble.dimension.fogTint != null)
|
if (config.fogTint != null)
|
||||||
{
|
{
|
||||||
var color = body.Config.Bramble.dimension.fogTint.ToColor();
|
var color = config.fogTint.ToColor();
|
||||||
fog.fogTint = color;
|
fog.fogTint = color;
|
||||||
outerFogWarpVolume._fogColor = color;
|
outerFogWarpVolume._fogColor = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up repel volume to only contain this dimension
|
// Set up repel volume and cloak to scale and only contain this dimension
|
||||||
// The base game one is on the HUB dimension and encompasses all bramble dimensions and their sectors
|
// The base game one is on the HUB dimension and encompasses all bramble dimensions and their sectors
|
||||||
var cloak = repelVolume.gameObject.GetComponentInChildren<DarkBrambleCloakSphere>();
|
repelVolume.GetComponent<SphereShape>().radius = 2400f * scale;
|
||||||
cloak.transform.localScale = Vector3.one * 4000f;
|
repelVolume.GetComponent<DarkBrambleRepelVolume>()._innerRadius = 2010f * scale;
|
||||||
|
var cloak = repelVolume.GetComponentInChildren<DarkBrambleCloakSphere>();
|
||||||
|
cloak.transform.localScale = Vector3.one * 4020f * scale;
|
||||||
cloak._sectors = new Sector[] { sector };
|
cloak._sectors = new Sector[] { sector };
|
||||||
cloak.GetComponent<Renderer>().enabled = true;
|
cloak.GetComponent<Renderer>().enabled = true;
|
||||||
|
|
||||||
|
|||||||
@ -175,6 +175,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
|
|
||||||
var innerFogWarpVolume = brambleNode.GetComponent<InnerFogWarpVolume>();
|
var innerFogWarpVolume = brambleNode.GetComponent<InnerFogWarpVolume>();
|
||||||
|
var outerFogWarpVolume = GetOuterFogWarpVolumeFromAstroObject(go);
|
||||||
var fogLight = brambleNode.GetComponent<FogLight>();
|
var fogLight = brambleNode.GetComponent<FogLight>();
|
||||||
|
|
||||||
brambleNode.transform.parent = sector.transform;
|
brambleNode.transform.parent = sector.transform;
|
||||||
@ -193,8 +194,6 @@ namespace NewHorizons.Builder.Props
|
|||||||
fogLight._linkedFogLights = new List<FogLight>();
|
fogLight._linkedFogLights = new List<FogLight>();
|
||||||
fogLight._linkedLightData = new List<FogLight.LightData>();
|
fogLight._linkedLightData = new List<FogLight.LightData>();
|
||||||
|
|
||||||
sector.RegisterFogLight(fogLight);
|
|
||||||
|
|
||||||
// If the config says only certain exits are allowed, enforce that
|
// If the config says only certain exits are allowed, enforce that
|
||||||
if (config.possibleExits != null)
|
if (config.possibleExits != null)
|
||||||
{
|
{
|
||||||
@ -221,32 +220,92 @@ namespace NewHorizons.Builder.Props
|
|||||||
// TODO: replace InnerFogWarpVolume with NHInnerFogWarpVolume, which overrides GetFogDensity to
|
// TODO: replace InnerFogWarpVolume with NHInnerFogWarpVolume, which overrides GetFogDensity to
|
||||||
// account for scale (this will fix the issue with screen fog caused by scaled down nodes)
|
// account for scale (this will fix the issue with screen fog caused by scaled down nodes)
|
||||||
|
|
||||||
// Set the scale
|
// Set the main scale
|
||||||
brambleNode.transform.localScale = Vector3.one * config.scale;
|
brambleNode.transform.localScale = Vector3.one * config.scale;
|
||||||
innerFogWarpVolume._warpRadius *= config.scale;
|
innerFogWarpVolume._warpRadius *= config.scale;
|
||||||
innerFogWarpVolume._exitRadius *= config.scale;
|
innerFogWarpVolume._exitRadius *= config.scale;
|
||||||
|
|
||||||
|
// Set the seed/node specific scales and other stuff
|
||||||
|
if (config.isSeed)
|
||||||
|
{
|
||||||
|
innerFogWarpVolume._exitRadius /= 1.8f;
|
||||||
|
brambleNode.FindChild("PointLight_DB_FogLight").GetComponent<Light>().range *= config.scale;
|
||||||
|
brambleNode.FindChild("Prefab_SeedPunctureVolume (2)").GetComponent<CompoundShape>().enabled = true;
|
||||||
|
fogLight._maxVisibleDistance = float.PositiveInfinity; // Prefab does have working foglight aside from this
|
||||||
|
fogLight._minVisibleDistance *= config.scale / 15f;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
brambleNode.FindChild("Effects/PointLight_DB_FogLight").GetComponent<Light>().range *= config.scale;
|
||||||
|
brambleNode.FindChild("Effects/FogOverrideVolume").GetComponent<FogOverrideVolume>().blendDistance *= config.scale;
|
||||||
|
fogLight._minVisibleDistance *= config.scale;
|
||||||
|
|
||||||
// Seed fog works differently, so it doesn't need to be fixed
|
// Seed fog works differently, so it doesn't need to be fixed
|
||||||
// (it's also located on a different child path, so the below FindChild calls wouldn't work)
|
// (it's also located on a different child path, so the below FindChild calls wouldn't work)
|
||||||
if (!config.isSeed)
|
|
||||||
{
|
|
||||||
var fog = brambleNode.FindChild("Effects/InnerWarpFogSphere");
|
var fog = brambleNode.FindChild("Effects/InnerWarpFogSphere");
|
||||||
var fogMaterial = fog.GetComponent<MeshRenderer>().material;
|
var fogMaterial = fog.GetComponent<MeshRenderer>().material;
|
||||||
fog.transform.localScale /= config.scale;
|
|
||||||
fogMaterial.SetFloat("_Radius", fogMaterial.GetFloat("_Radius") * config.scale);
|
fogMaterial.SetFloat("_Radius", fogMaterial.GetFloat("_Radius") * config.scale);
|
||||||
fogMaterial.SetFloat("_Density", fogMaterial.GetFloat("_Density") / config.scale);
|
fogMaterial.SetFloat("_Density", fogMaterial.GetFloat("_Density") / config.scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Change the colors
|
// Set colors
|
||||||
if (config.isSeed) SetSeedColors(brambleNode, config.fogTint?.ToColor(), config.lightTint?.ToColor());
|
Color fogTint, farFogTint, fogLightTint, lightTint, lightShaftTint, glowTint, fogOverrideTint;
|
||||||
else SetNodeColors(brambleNode, config.fogTint?.ToColor(), config.lightTint?.ToColor());
|
|
||||||
|
|
||||||
innerFogWarpVolume._useFarFogColor = false;
|
farFogTint = config.fogTint != null ? config.fogTint.ToColor() : new Color(1f, 0.9608f, 0.851f, 1f);
|
||||||
if (config.farFogTint != null)
|
lightTint = config.lightTint != null ? config.lightTint.ToColor() : Color.white;
|
||||||
|
|
||||||
|
Color.RGBToHSV(farFogTint, out var fogH, out var fogS, out var fogV);
|
||||||
|
Color.RGBToHSV(lightTint, out var lightH, out var lightS, out var lightV);
|
||||||
|
|
||||||
|
if (config.isSeed)
|
||||||
{
|
{
|
||||||
innerFogWarpVolume._useFarFogColor = true;
|
fogLightTint = lightTint;
|
||||||
innerFogWarpVolume._farFogColor = config.farFogTint.ToColor();
|
fogLightTint.a = config.hasFogLight != true ? 0f : lightTint.a * 0.5f;
|
||||||
|
|
||||||
|
lightShaftTint = CalculateLightShaftTint(lightH, lightS, lightV);
|
||||||
|
lightShaftTint.a = lightTint.a;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fogLightTint = lightTint;
|
||||||
|
fogLightTint.a = config.hasFogLight == false || (outerFogWarpVolume == null && config.hasFogLight != true) ? 0f : lightTint.a * 0.5f;
|
||||||
|
|
||||||
|
lightShaftTint = CalculateLightShaftTint(fogH, fogS, fogV);
|
||||||
|
lightShaftTint.a = lightTint.a;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Apply colors
|
||||||
|
Delay.FireOnNextUpdate(() => {
|
||||||
|
if (config.isSeed)
|
||||||
|
{
|
||||||
|
SetSeedColors(brambleNode, farFogTint, fogLightTint, lightTint, lightShaftTint);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Set inner fog to destination fog tint
|
||||||
|
fogTint = AstroObjectLocator.GetAstroObject(config.linksTo).gameObject.FindChild("Sector/Atmosphere/FogSphere_Hub").GetComponent<PlanetaryFogController>().fogTint;
|
||||||
|
|
||||||
|
// Calculate glow and fog override
|
||||||
|
// Will work with any fog
|
||||||
|
Color dimFogTint;
|
||||||
|
if (go.GetComponentInChildren<PlanetaryFogController>())
|
||||||
|
{
|
||||||
|
dimFogTint = go.GetComponentInChildren<PlanetaryFogController>().fogTint;
|
||||||
|
Color.RGBToHSV(dimFogTint, out var dimH, out var dimS, out var dimV);
|
||||||
|
Color.RGBToHSV(lightShaftTint, out var shaftH, out var shaftS, out var shaftV);
|
||||||
|
glowTint = Color.HSVToRGB(shaftH, shaftS, dimV * 1.25f);
|
||||||
|
glowTint.a = lightTint.a;
|
||||||
|
fogOverrideTint = Color.HSVToRGB(fogH, Mathf.Lerp(fogS, dimS, 0.5f), Mathf.Lerp(fogV, dimV, 0.5f));
|
||||||
|
fogOverrideTint.a = 1f;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
glowTint = fogOverrideTint = Color.clear;
|
||||||
|
}
|
||||||
|
|
||||||
|
SetNodeColors(brambleNode, fogTint, farFogTint, fogLightTint, lightTint, lightShaftTint, glowTint, fogOverrideTint);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Set up warps
|
// Set up warps
|
||||||
innerFogWarpVolume._sector = sector;
|
innerFogWarpVolume._sector = sector;
|
||||||
@ -254,7 +313,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
|
|
||||||
// the OuterFogWarpVolume of the dimension this node is inside of
|
// the OuterFogWarpVolume of the dimension this node is inside of
|
||||||
// (null if this node is not inside of a bramble dimension, eg it's sitting on a planet or something)
|
// (null if this node is not inside of a bramble dimension, eg it's sitting on a planet or something)
|
||||||
innerFogWarpVolume._containerWarpVolume = GetOuterFogWarpVolumeFromAstroObject(go);
|
innerFogWarpVolume._containerWarpVolume = outerFogWarpVolume;
|
||||||
|
|
||||||
var success = PairEntrance(innerFogWarpVolume, config.linksTo);
|
var success = PairEntrance(innerFogWarpVolume, config.linksTo);
|
||||||
if (!success) RecordUnpairedNode(innerFogWarpVolume, config.linksTo);
|
if (!success) RecordUnpairedNode(innerFogWarpVolume, config.linksTo);
|
||||||
@ -282,55 +341,80 @@ namespace NewHorizons.Builder.Props
|
|||||||
// Done!
|
// Done!
|
||||||
brambleNode.SetActive(true);
|
brambleNode.SetActive(true);
|
||||||
return brambleNode;
|
return brambleNode;
|
||||||
|
|
||||||
|
static Color CalculateLightShaftTint(float H, float S, float V)
|
||||||
|
{
|
||||||
|
// Sine curve approximation shifts hue to compensate for shader shenanigans
|
||||||
|
H += -1f / 24f * Mathf.Sin(6f * Mathf.PI * H);
|
||||||
|
|
||||||
|
// Inverted parabola is best fit for limited base game examples
|
||||||
|
S = -Mathf.Pow(S - 1f, 2f) + 1f;
|
||||||
|
|
||||||
|
return Color.HSVToRGB(H, S, V);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetNodeColors(GameObject brambleNode, Color? fogTint, Color? lightTint)
|
public static void SetNodeColors(GameObject brambleNode, Color fogTint, Color farFogTint, Color fogLightTint, Color lightTint, Color lightShaftTint, Color glowTint, Color fogOverrideTint)
|
||||||
{
|
{
|
||||||
if (fogTint != null)
|
var innerFogWarpVolume = brambleNode.GetComponent<InnerFogWarpVolume>();
|
||||||
{
|
innerFogWarpVolume._fogColor = fogTint;
|
||||||
var fogRenderer = brambleNode.GetComponent<InnerFogWarpVolume>();
|
innerFogWarpVolume._farFogColor = farFogTint;
|
||||||
|
|
||||||
fogRenderer._fogColor = fogTint.Value;
|
var fogLight = brambleNode.GetComponent<FogLight>();
|
||||||
|
fogLight._maxAlpha = fogLightTint.a;
|
||||||
|
fogLight._primaryLightData.maxAlpha = fogLightTint.a;
|
||||||
|
fogLight._tint = fogLightTint;
|
||||||
|
fogLight._primaryLightData.color = fogLightTint;
|
||||||
|
|
||||||
var fogBackdrop = brambleNode.FindChild("Terrain_DB_BrambleSphere_Inner_v2/fogbackdrop_v2");
|
var light = brambleNode.FindChild("Effects/PointLight_DB_FogLight").GetComponent<Light>();
|
||||||
if (fogBackdrop != null)
|
light.intensity = lightTint.a * 0.7f;
|
||||||
fogBackdrop.GetComponent<MeshRenderer>().material.color = fogTint.Value;
|
light.color = lightTint;
|
||||||
}
|
|
||||||
|
|
||||||
if (lightTint != null)
|
|
||||||
{
|
|
||||||
var lightShafts = brambleNode.FindChild("Effects/DB_BrambleLightShafts");
|
var lightShafts = brambleNode.FindChild("Effects/DB_BrambleLightShafts");
|
||||||
|
|
||||||
var lightShaft1 = lightShafts.FindChild("BrambleLightShaft1");
|
var lightShaft1 = lightShafts.FindChild("BrambleLightShaft1");
|
||||||
var mat = lightShaft1.GetComponent<MeshRenderer>().material;
|
var mat = lightShaft1.GetComponent<MeshRenderer>().material;
|
||||||
mat.color = lightTint.Value;
|
mat.color = lightShaftTint;
|
||||||
|
|
||||||
for (int i = 1; i <= 6; i++)
|
for (int i = 1; i <= 6; i++)
|
||||||
{
|
{
|
||||||
var lightShaft = lightShafts.FindChild($"BrambleLightShaft{i}");
|
var lightShaft = lightShafts.FindChild($"BrambleLightShaft{i}");
|
||||||
lightShaft.GetComponent<MeshRenderer>().sharedMaterial = mat;
|
lightShaft.GetComponent<MeshRenderer>().sharedMaterial = mat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var glow = brambleNode.FindChild("Effects/InnerWarpFogGlow");
|
||||||
|
glow.GetComponent<MeshRenderer>().material.color = glowTint;
|
||||||
|
glow.transform.localScale *= glowTint.a;
|
||||||
|
if (glowTint.a == 0f) glow.SetActive(false);
|
||||||
|
|
||||||
|
var fogOverride = brambleNode.FindChild("Effects/FogOverrideVolume");
|
||||||
|
if (fogOverrideTint.a == 1f) // Override turns goofy if alpha isn't 1
|
||||||
|
{
|
||||||
|
var volume = fogOverride.GetComponent<FogOverrideVolume>();
|
||||||
|
volume.tint = fogOverrideTint;
|
||||||
|
volume.blendDistance *= lightTint.a;
|
||||||
|
volume.radius *= lightTint.a;
|
||||||
}
|
}
|
||||||
|
else fogOverride.SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetSeedColors(GameObject brambleSeed, Color? fogTint, Color? lightTint)
|
public static void SetSeedColors(GameObject brambleSeed, Color farFogTint, Color fogLightTint, Color lightTint, Color lightShaftTint)
|
||||||
{
|
{
|
||||||
if (fogTint != null)
|
brambleSeed.GetComponent<InnerFogWarpVolume>()._fogColor = farFogTint;
|
||||||
{
|
brambleSeed.FindChild("VolumetricFogSphere (2)").GetComponent<MeshRenderer>().material.color = new Color(farFogTint.r * 10, farFogTint.g * 10, farFogTint.b * 10, farFogTint.a);
|
||||||
var fogRenderer = brambleSeed.FindChild("VolumetricFogSphere (2)");
|
|
||||||
|
|
||||||
var fogMeshRenderer = fogRenderer.GetComponent<MeshRenderer>();
|
var fogLight = brambleSeed.GetComponent<FogLight>();
|
||||||
fogMeshRenderer.material.color = fogTint.Value;
|
fogLight._maxAlpha = fogLightTint.a;
|
||||||
}
|
fogLight._primaryLightData.maxAlpha = fogLightTint.a;
|
||||||
|
fogLight._tint = fogLightTint;
|
||||||
|
fogLight._primaryLightData.color = fogLightTint;
|
||||||
|
|
||||||
|
var light = brambleSeed.FindChild("PointLight_DB_FogLight").GetComponent<Light>();
|
||||||
|
light.intensity = lightTint.a;
|
||||||
|
light.color = lightTint;
|
||||||
|
|
||||||
if (lightTint != null)
|
|
||||||
{
|
|
||||||
var lightShafts = brambleSeed.FindChild("Terrain_DB_BrambleSphere_Seed_V2 (2)/DB_SeedLightShafts");
|
var lightShafts = brambleSeed.FindChild("Terrain_DB_BrambleSphere_Seed_V2 (2)/DB_SeedLightShafts");
|
||||||
|
|
||||||
var lightShaft1 = lightShafts.FindChild("DB_SeedLightShafts1");
|
var lightShaft1 = lightShafts.FindChild("DB_SeedLightShafts1");
|
||||||
var mat = lightShaft1.GetComponent<MeshRenderer>().material;
|
var mat = lightShaft1.GetComponent<MeshRenderer>().material;
|
||||||
mat.color = lightTint.Value;
|
mat.color = lightShaftTint;
|
||||||
|
|
||||||
for (int i = 1; i <= 6; i++)
|
for (int i = 1; i <= 6; i++)
|
||||||
{
|
{
|
||||||
var lightShaft = lightShafts.FindChild($"DB_SeedLightShafts{i}");
|
var lightShaft = lightShafts.FindChild($"DB_SeedLightShafts{i}");
|
||||||
@ -339,4 +423,3 @@ namespace NewHorizons.Builder.Props
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@ -24,9 +24,25 @@ namespace NewHorizons.Builder.Props
|
|||||||
var up = planetGO.transform.TransformPoint(pos) - planetGO.transform.position;
|
var up = planetGO.transform.TransformPoint(pos) - planetGO.transform.position;
|
||||||
geyserGO.transform.rotation = Quaternion.FromToRotation(geyserGO.transform.up, up) * geyserGO.transform.rotation;
|
geyserGO.transform.rotation = Quaternion.FromToRotation(geyserGO.transform.up, up) * geyserGO.transform.rotation;
|
||||||
|
|
||||||
if (info.disableBubbles) geyserGO.FindChild("GeyserParticles/GeyserBubbles").SetActive(false);
|
var bubbles = geyserGO.FindChild("GeyserParticles/GeyserBubbles");
|
||||||
if (info.disableShaft) geyserGO.FindChild("GeyserParticles/GeyserShaft").SetActive(false);
|
var shaft = geyserGO.FindChild("GeyserParticles/GeyserShaft");
|
||||||
if (info.disableSpout) geyserGO.FindChild("GeyserParticles/GeyserSpout").SetActive(false);
|
var spout = geyserGO.FindChild("GeyserParticles/GeyserSpout");
|
||||||
|
|
||||||
|
if (info.tint != null)
|
||||||
|
{
|
||||||
|
var tint = info.tint.ToColor();
|
||||||
|
bubbles.GetComponent<ParticleSystemRenderer>().material.color = new Color(tint.r, tint.g, tint.b, Mathf.LerpUnclamped(0.5f, 1f, tint.a)); //bubbles disappear at 0.5 alpha
|
||||||
|
shaft.GetComponent<ParticleSystemRenderer>().material.color = tint;
|
||||||
|
spout.GetComponent<ParticleSystemRenderer>().material.color = tint;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (info.disableBubbles) bubbles.SetActive(false);
|
||||||
|
if (info.disableShaft) shaft.SetActive(false);
|
||||||
|
if (info.disableSpout) spout.SetActive(false);
|
||||||
|
|
||||||
|
var geyserController = geyserGO.GetComponent<GeyserController>();
|
||||||
|
geyserController._activeDuration = info.activeDuration;
|
||||||
|
geyserController._inactiveDuration = info.inactiveDuration;
|
||||||
|
|
||||||
geyserGO.SetActive(true);
|
geyserGO.SetActive(true);
|
||||||
|
|
||||||
@ -35,8 +51,40 @@ namespace NewHorizons.Builder.Props
|
|||||||
// Do this after awake
|
// Do this after awake
|
||||||
Delay.FireOnNextUpdate(() => geyserFluidVolume._maxHeight = 1);
|
Delay.FireOnNextUpdate(() => geyserFluidVolume._maxHeight = 1);
|
||||||
|
|
||||||
|
if (info.force == 0f) geyserFluidVolume.enabled = false;
|
||||||
|
else
|
||||||
|
{
|
||||||
geyserFluidVolume.enabled = true; // why do we enable this? idk
|
geyserFluidVolume.enabled = true; // why do we enable this? idk
|
||||||
geyserFluidVolume.GetComponent<CapsuleShape>().enabled = true; // i think this is already enabled but wtv
|
geyserFluidVolume.GetComponent<CapsuleShape>().enabled = true; // i think this is already enabled but wtv
|
||||||
|
|
||||||
|
geyserFluidVolume._attractionalFlowSpeed *= info.force / 55f;
|
||||||
|
geyserFluidVolume._directionalFlowSpeed = info.force;
|
||||||
|
}
|
||||||
|
|
||||||
|
geyserGO.GetComponent<GeyserAudioController>().SetSector(sector);
|
||||||
|
var oneShotAudio = geyserGO.FindChild("Geyser_OneShotAudioSrc");
|
||||||
|
var loopAudio = geyserGO.FindChild("Geyser_LoopAudioSrc");
|
||||||
|
oneShotAudio.GetComponent<AudioSpreadController>().SetSector(sector);
|
||||||
|
loopAudio.GetComponent<AudioSpreadController>().SetSector(sector);
|
||||||
|
|
||||||
|
Delay.FireOnNextUpdate(() => {
|
||||||
|
if (info.volume == 0)
|
||||||
|
{
|
||||||
|
oneShotAudio.SetActive(false);
|
||||||
|
loopAudio.SetActive(false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
oneShotAudio.GetComponent<OWAudioSource>().SetMaxVolume(info.volume);
|
||||||
|
loopAudio.GetComponent<OWAudioSource>().SetMaxVolume(info.volume);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// If it starts at the shaft, move the start/end sounds to it
|
||||||
|
if ((info.disableSpout && !info.disableShaft) || info.offset == -67f)
|
||||||
|
{
|
||||||
|
oneShotAudio.transform.SetLocalPositionY(67f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -82,7 +82,7 @@ namespace NewHorizons.Builder.Props
|
|||||||
_computerPrefab.name = "Prefab_NOM_Computer";
|
_computerPrefab.name = "Prefab_NOM_Computer";
|
||||||
_computerPrefab.transform.rotation = Quaternion.identity;
|
_computerPrefab.transform.rotation = Quaternion.identity;
|
||||||
|
|
||||||
_preCrashComputerPrefab = SearchUtilities.Find("DB_EscapePodDimension_Body/Sector_EscapePodDimension/Sector_EscapePodBody/Interactables_EscapePodBody/Prefab_NOM_Vessel_Computer").InstantiateInactive();
|
_preCrashComputerPrefab = SearchUtilities.Find("BrittleHollow_Body/Sector_BH/Sector_EscapePodCrashSite/Sector_CrashFragment/EscapePod_Socket/Interactibles_EscapePod/Prefab_NOM_Vessel_Computer").InstantiateInactive();
|
||||||
_preCrashComputerPrefab.name = "Prefab_NOM_Vessel_Computer";
|
_preCrashComputerPrefab.name = "Prefab_NOM_Vessel_Computer";
|
||||||
_preCrashComputerPrefab.transform.rotation = Quaternion.identity;
|
_preCrashComputerPrefab.transform.rotation = Quaternion.identity;
|
||||||
|
|
||||||
@ -305,9 +305,6 @@ namespace NewHorizons.Builder.Props
|
|||||||
if (info.normal != null) up = planetGO.transform.TransformDirection(info.normal);
|
if (info.normal != null) up = planetGO.transform.TransformDirection(info.normal);
|
||||||
computerObject.transform.rotation = Quaternion.FromToRotation(Vector3.up, up) * computerObject.transform.rotation;
|
computerObject.transform.rotation = Quaternion.FromToRotation(Vector3.up, up) * computerObject.transform.rotation;
|
||||||
|
|
||||||
// Move it slightly up more
|
|
||||||
computerObject.transform.position += up.normalized * 0.1f;
|
|
||||||
|
|
||||||
var computer = computerObject.GetComponent<NomaiVesselComputer>();
|
var computer = computerObject.GetComponent<NomaiVesselComputer>();
|
||||||
computer.SetSector(sector);
|
computer.SetSector(sector);
|
||||||
|
|
||||||
@ -317,6 +314,15 @@ namespace NewHorizons.Builder.Props
|
|||||||
computer._nomaiTextAsset.name = Path.GetFileNameWithoutExtension(info.xmlFile);
|
computer._nomaiTextAsset.name = Path.GetFileNameWithoutExtension(info.xmlFile);
|
||||||
AddTranslation(xmlPath);
|
AddTranslation(xmlPath);
|
||||||
|
|
||||||
|
// Make fifth ring work
|
||||||
|
var fifthRingObject = computerObject.FindChild("Props_NOM_Vessel_Computer 1/Props_NOM_Vessel_Computer_Effects (4)");
|
||||||
|
fifthRingObject.SetActive(true);
|
||||||
|
var fifthRing = fifthRingObject.GetComponent<NomaiVesselComputerRing>();
|
||||||
|
//fifthRing._baseProjectorColor = new Color(1.4118, 1.5367, 4, 1);
|
||||||
|
//fifthRing._baseTextColor = new Color(0.8824, 0.9604, 2.5, 1);
|
||||||
|
//fifthRing._baseTextShadowColor = new Color(0.3529, 0.3843, 1, 0.25);
|
||||||
|
fifthRing._computer = computer;
|
||||||
|
|
||||||
computerObject.SetActive(true);
|
computerObject.SetActive(true);
|
||||||
|
|
||||||
// All rings are rendered by detail builder so dont do that (have to wait for entries to be set)
|
// All rings are rendered by detail builder so dont do that (have to wait for entries to be set)
|
||||||
|
|||||||
30
NewHorizons/External/Modules/BrambleModule.cs
vendored
30
NewHorizons/External/Modules/BrambleModule.cs
vendored
@ -32,15 +32,20 @@ namespace NewHorizons.External.Modules
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public MColor fogTint;
|
public MColor fogTint;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The density of the fog inside this dimension. The default is 6.
|
||||||
|
/// </summary>
|
||||||
|
[DefaultValue(6f)] public float fogDensity = 6f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The name of the *node* that the player is taken to when exiting this dimension.
|
/// The name of the *node* that the player is taken to when exiting this dimension.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string linksTo;
|
public string linksTo;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The internal radius (in meters) of the dimension. The default is 1705.
|
/// The internal radius (in meters) of the dimension. The default is 750 for the Hub, Escape Pod, and Angler Nest dimensions, and 500 for the others.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DefaultValue(1705f)] public float radius = 1705f;
|
[DefaultValue(750f)] public float radius = 750f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An array of integers from 0-5. By default, all entrances are allowed. To force this dimension to warp players in from only one point (like the anglerfish nest dimension in the base game) set this value to [3], [5], or similar. Values of 0-5 only.
|
/// An array of integers from 0-5. By default, all entrances are allowed. To force this dimension to warp players in from only one point (like the anglerfish nest dimension in the base game) set this value to [3], [5], or similar. Values of 0-5 only.
|
||||||
@ -63,7 +68,8 @@ namespace NewHorizons.External.Modules
|
|||||||
public MVector3 rotation;
|
public MVector3 rotation;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The physical scale of the node, as a multiplier of the original size
|
/// The physical scale of the node, as a multiplier of the original size.
|
||||||
|
/// Nodes are 150m across, seeds are 10m across.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DefaultValue(1f)] public float scale = 1f;
|
[DefaultValue(1f)] public float scale = 1f;
|
||||||
|
|
||||||
@ -83,24 +89,34 @@ namespace NewHorizons.External.Modules
|
|||||||
[DefaultValue(false)] public bool isSeed = false;
|
[DefaultValue(false)] public bool isSeed = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The color of the fog inside the node. Leave blank for the default yellowish color: (131, 124, 105, 255)
|
/// The color of the fog inside the node.
|
||||||
|
/// Leave blank for the default yellowish white color: (255, 245, 217, 255)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public MColor fogTint;
|
public MColor fogTint;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The color of the shafts of light coming from the entrances to the node. Leave blank for the default yellowish color: (131, 124, 105, 255)
|
/// The color of the light from the node. Alpha controls brightness.
|
||||||
|
/// Leave blank for the default white color.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public MColor lightTint;
|
public MColor lightTint;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The color a dimension's background fog turns when you approach this node (if it's in a dimension). If this node is not in a dimension, this does nothing. Leave blank for the default yellowish white color: (255, 245, 217, 255)
|
/// Should this node have a point of light from afar?
|
||||||
|
/// By default, nodes will have a foglight, while seeds won't, and neither will if not in a dimension.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public MColor farFogTint;
|
public bool? hasFogLight;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An array of integers from 0-5. By default, all exits are allowed. To force this node to warp players out from only one hole set this value to [3], [5], or similar. Values of 0-5 only.
|
/// An array of integers from 0-5. By default, all exits are allowed. To force this node to warp players out from only one hole set this value to [3], [5], or similar. Values of 0-5 only.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int[] possibleExits;
|
public int[] possibleExits;
|
||||||
|
|
||||||
|
#region Obsolete
|
||||||
|
|
||||||
|
[Obsolete("farFogTint is deprecated, please use fogTint instead")]
|
||||||
|
public MColor farFogTint;
|
||||||
|
|
||||||
|
#endregion Obsolete
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
25
NewHorizons/External/Modules/PropModule.cs
vendored
25
NewHorizons/External/Modules/PropModule.cs
vendored
@ -234,10 +234,35 @@ namespace NewHorizons.External.Modules
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[DefaultValue(-97.5f)] public float offset = -97.5f;
|
[DefaultValue(-97.5f)] public float offset = -97.5f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Force of the geyser on objects
|
||||||
|
/// </summary>
|
||||||
|
[DefaultValue(55f)] public float force = 55f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Time in seconds eruptions last for
|
||||||
|
/// </summary>
|
||||||
|
[DefaultValue(10f)] public float activeDuration = 10f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Time in seconds between eruptions
|
||||||
|
/// </summary>
|
||||||
|
[DefaultValue(19f)] public float inactiveDuration = 19f;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Color of the geyser. Alpha sets the particle density.
|
||||||
|
/// </summary>
|
||||||
|
public MColor tint;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Disable the individual particle systems of the geyser
|
/// Disable the individual particle systems of the geyser
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool disableBubbles, disableShaft, disableSpout;
|
public bool disableBubbles, disableShaft, disableSpout;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Loudness of the geyser
|
||||||
|
/// </summary>
|
||||||
|
[DefaultValue(0.7f)] public float volume = 0.7f;
|
||||||
}
|
}
|
||||||
|
|
||||||
[JsonObject]
|
[JsonObject]
|
||||||
|
|||||||
@ -67,8 +67,9 @@ namespace NewHorizons.Handlers
|
|||||||
lightGO.transform.parent = SearchUtilities.Find("Scene/Background").transform;
|
lightGO.transform.parent = SearchUtilities.Find("Scene/Background").transform;
|
||||||
lightGO.transform.localPosition = new Vector3(-47.9203f, 145.7596f, 43.1802f);
|
lightGO.transform.localPosition = new Vector3(-47.9203f, 145.7596f, 43.1802f);
|
||||||
var light = lightGO.AddComponent<Light>();
|
var light = lightGO.AddComponent<Light>();
|
||||||
light.color = new Color(1f, 1f, 1f, 1f);
|
light.type = LightType.Directional;
|
||||||
light.range = 100;
|
light.color = Color.white;
|
||||||
|
light.range = float.PositiveInfinity;
|
||||||
light.intensity = 0.8f;
|
light.intensity = 0.8f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -536,15 +536,21 @@
|
|||||||
"description": "The color of the fog inside this dimension. Leave blank for the default yellowish color: (113, 107, 81)",
|
"description": "The color of the fog inside this dimension. Leave blank for the default yellowish color: (113, 107, 81)",
|
||||||
"$ref": "#/definitions/MColor"
|
"$ref": "#/definitions/MColor"
|
||||||
},
|
},
|
||||||
|
"fogDensity": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "The density of the fog inside this dimension. The default is 6.",
|
||||||
|
"format": "float",
|
||||||
|
"default": 6.0
|
||||||
|
},
|
||||||
"linksTo": {
|
"linksTo": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The name of the *node* that the player is taken to when exiting this dimension."
|
"description": "The name of the *node* that the player is taken to when exiting this dimension."
|
||||||
},
|
},
|
||||||
"radius": {
|
"radius": {
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"description": "The internal radius (in meters) of the dimension. The default is 1705.",
|
"description": "The internal radius (in meters) of the dimension. The default is 750 for the Hub, Escape Pod, and Angler Nest dimensions, and 500 for the others.",
|
||||||
"format": "float",
|
"format": "float",
|
||||||
"default": 1705.0
|
"default": 750.0
|
||||||
},
|
},
|
||||||
"allowedEntrances": {
|
"allowedEntrances": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
@ -570,7 +576,7 @@
|
|||||||
},
|
},
|
||||||
"scale": {
|
"scale": {
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"description": "The physical scale of the node, as a multiplier of the original size",
|
"description": "The physical scale of the node, as a multiplier of the original size. \nNodes are 150m across, seeds are 10m across.",
|
||||||
"format": "float",
|
"format": "float",
|
||||||
"default": 1.0
|
"default": 1.0
|
||||||
},
|
},
|
||||||
@ -588,16 +594,19 @@
|
|||||||
"default": false
|
"default": false
|
||||||
},
|
},
|
||||||
"fogTint": {
|
"fogTint": {
|
||||||
"description": "The color of the fog inside the node. Leave blank for the default yellowish color: (131, 124, 105, 255)",
|
"description": "The color of the fog inside the node. \nLeave blank for the default yellowish white color: (255, 245, 217, 255)",
|
||||||
"$ref": "#/definitions/MColor"
|
"$ref": "#/definitions/MColor"
|
||||||
},
|
},
|
||||||
"lightTint": {
|
"lightTint": {
|
||||||
"description": "The color of the shafts of light coming from the entrances to the node. Leave blank for the default yellowish color: (131, 124, 105, 255)",
|
"description": "The color of the light from the node. Alpha controls brightness.\nLeave blank for the default white color.",
|
||||||
"$ref": "#/definitions/MColor"
|
"$ref": "#/definitions/MColor"
|
||||||
},
|
},
|
||||||
"farFogTint": {
|
"hasFogLight": {
|
||||||
"description": "The color a dimension's background fog turns when you approach this node (if it's in a dimension). If this node is not in a dimension, this does nothing. Leave blank for the default yellowish white color: (255, 245, 217, 255)",
|
"type": [
|
||||||
"$ref": "#/definitions/MColor"
|
"boolean",
|
||||||
|
"null"
|
||||||
|
],
|
||||||
|
"description": "Should this node have a point of light from afar? \nBy default, nodes will have a foglight, while seeds won't, and neither will if not in a dimension."
|
||||||
},
|
},
|
||||||
"possibleExits": {
|
"possibleExits": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
@ -1110,6 +1119,28 @@
|
|||||||
"format": "float",
|
"format": "float",
|
||||||
"default": -97.5
|
"default": -97.5
|
||||||
},
|
},
|
||||||
|
"force": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Force of the geyser on objects",
|
||||||
|
"format": "float",
|
||||||
|
"default": 55.0
|
||||||
|
},
|
||||||
|
"activeDuration": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Time in seconds eruptions last for",
|
||||||
|
"format": "float",
|
||||||
|
"default": 10.0
|
||||||
|
},
|
||||||
|
"inactiveDuration": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Time in seconds between eruptions",
|
||||||
|
"format": "float",
|
||||||
|
"default": 19.0
|
||||||
|
},
|
||||||
|
"tint": {
|
||||||
|
"description": "Color of the geyser. Alpha sets the particle density.",
|
||||||
|
"$ref": "#/definitions/MColor"
|
||||||
|
},
|
||||||
"disableBubbles": {
|
"disableBubbles": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Disable the individual particle systems of the geyser"
|
"description": "Disable the individual particle systems of the geyser"
|
||||||
@ -1121,6 +1152,12 @@
|
|||||||
"disableSpout": {
|
"disableSpout": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Disable the individual particle systems of the geyser"
|
"description": "Disable the individual particle systems of the geyser"
|
||||||
|
},
|
||||||
|
"volume": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Loudness of the geyser",
|
||||||
|
"format": "float",
|
||||||
|
"default": 0.7
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
15
docs/content/pages/reference/bramble_colors.md
Normal file
15
docs/content/pages/reference/bramble_colors.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
Title: Bramble Colors
|
||||||
|
Render_TOC: False
|
||||||
|
---
|
||||||
|
|
||||||
|
| Dimension | Fog color | Node fog color |
|
||||||
|
|-------------|------------------------------------------|------------------------------------------|
|
||||||
|
| Cluster | {"r": 126, "g": 119, "b": 101, "a": 255} | {"r": 255, "g": 245, "b": 217, "a": 255} |
|
||||||
|
| Vessel | {"r": 206, "g": 187, "b": 137, "a": 255} | {"r": 191, "g": 171, "b": 133, "a": 255} |
|
||||||
|
| Small Nest | {"r": 131, "g": 128, "b": 121, "a": 255} | {"r": 255, "g": 245, "b": 217, "a": 255} |
|
||||||
|
| Pioneer | {"r": 106, "g": 116, "b": 99, "a": 255} | {"r": 255, "g": 245, "b": 217, "a": 255} |
|
||||||
|
| Hub | {"r": 84, "g": 83, "b": 73, "a": 255} | {"r": 84, "g": 83, "b": 73, "a": 255} |
|
||||||
|
| Exit Only | {"r": 113, "g": 107, "b": 81, "a": 255} | {"r": 255, "g": 245, "b": 217, "a": 255} |
|
||||||
|
| Escape Pod | {"r": 83, "g": 99, "b": 87, "a": 255} | {"r": 255, "g": 245, "b": 217, "a": 255} |
|
||||||
|
| Angler Nest | {"r": 113, "g": 107, "b": 81, "a": 255} | {"r": 255, "g": 129, "b": 83, "a": 255} |
|
||||||
Loading…
x
Reference in New Issue
Block a user