From b51b7023137e9319d5790f548c7d23b7533b325d Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Wed, 12 Jul 2023 02:44:49 -0400 Subject: [PATCH 1/3] Rename onlyAffectsPlayerAndShip to onlyAffectsPlayerRelatedBodies because this is what it actually does --- NewHorizons/Builder/Volumes/VanishVolumeBuilder.cs | 2 +- NewHorizons/External/Configs/PlanetConfig.cs | 12 ++++++++++-- .../Modules/Volumes/VolumeInfos/VanishVolumeInfo.cs | 7 +++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/NewHorizons/Builder/Volumes/VanishVolumeBuilder.cs b/NewHorizons/Builder/Volumes/VanishVolumeBuilder.cs index 48be7181..9bc2a514 100644 --- a/NewHorizons/Builder/Volumes/VanishVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/VanishVolumeBuilder.cs @@ -26,7 +26,7 @@ namespace NewHorizons.Builder.Volumes volume._collider = collider; volume._shrinkBodies = info.shrinkBodies; - volume._onlyAffectsPlayerAndShip = info.onlyAffectsPlayerAndShip; + volume._onlyAffectsPlayerAndShip = info.onlyAffectsPlayerRelatedBodies; go.SetActive(true); diff --git a/NewHorizons/External/Configs/PlanetConfig.cs b/NewHorizons/External/Configs/PlanetConfig.cs index 260896b3..e76225c4 100644 --- a/NewHorizons/External/Configs/PlanetConfig.cs +++ b/NewHorizons/External/Configs/PlanetConfig.cs @@ -217,7 +217,7 @@ namespace NewHorizons.External.Configs if (Base.centerOfSolarSystem) Orbit.isStatic = true; if (Atmosphere?.clouds?.lightningGradient != null) Atmosphere.clouds.hasLightning = true; if (Bramble?.dimension != null && Orbit?.staticPosition == null) throw new Exception($"Dimension {name} must have Orbit.staticPosition defined."); - if (Bramble?.dimension != null) canShowOnTitle = false; + if (Bramble?.dimension != null) canShowOnTitle = false; if (Orbit?.staticPosition != null) Orbit.isStatic = true; // For each quantum group, verify the following: @@ -463,7 +463,7 @@ namespace NewHorizons.External.Configs if (ring.curve != null) ring.scaleCurve = ring.curve; } } - + if (Base.zeroGravityRadius != 0f) { Volumes ??= new VolumesModule(); @@ -616,6 +616,14 @@ namespace NewHorizons.External.Configs CometTail.rotationOverride = Base.cometTailRotation; } } + + if (Volumes?.destructionVolumes != null) + { + foreach (var destructionVolume in Volumes.destructionVolumes) + { + if (destructionVolume.onlyAffectsPlayerAndShip) destructionVolume.onlyAffectsPlayerRelatedBodies = true; + } + } } #endregion } diff --git a/NewHorizons/External/Modules/Volumes/VolumeInfos/VanishVolumeInfo.cs b/NewHorizons/External/Modules/Volumes/VolumeInfos/VanishVolumeInfo.cs index 0cab17e6..bb66b0a8 100644 --- a/NewHorizons/External/Modules/Volumes/VolumeInfos/VanishVolumeInfo.cs +++ b/NewHorizons/External/Modules/Volumes/VolumeInfos/VanishVolumeInfo.cs @@ -1,4 +1,5 @@ using Newtonsoft.Json; +using System; using System.ComponentModel; namespace NewHorizons.External.Modules.Volumes.VolumeInfos @@ -12,9 +13,11 @@ namespace NewHorizons.External.Modules.Volumes.VolumeInfos [DefaultValue(true)] public bool shrinkBodies = true; /// - /// Whether this volume only affects the player and ship. + /// Whether this volume only affects the player, ship, probe/scout, model rocket ship, and nomai shuttle. /// - public bool onlyAffectsPlayerAndShip; + public bool onlyAffectsPlayerRelatedBodies; + + [Obsolete] public bool onlyAffectsPlayerAndShip; } } From 76c0cf895bcc7f48110f81f80f9120831cd938db Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Wed, 12 Jul 2023 02:45:30 -0400 Subject: [PATCH 2/3] Add more to the descriptions of volumes --- .../External/Modules/Volumes/ProbeModule.cs | 6 ++++-- .../External/Modules/Volumes/RulesetModule.cs | 4 +++- .../External/Modules/Volumes/VolumesModule.cs | 18 ++++++++++++++---- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/NewHorizons/External/Modules/Volumes/ProbeModule.cs b/NewHorizons/External/Modules/Volumes/ProbeModule.cs index 27568ae9..67348abc 100644 --- a/NewHorizons/External/Modules/Volumes/ProbeModule.cs +++ b/NewHorizons/External/Modules/Volumes/ProbeModule.cs @@ -7,12 +7,14 @@ namespace NewHorizons.External.Modules.Volumes public class ProbeModule { /// - /// Add probe destruction volumes to this planet. These will delete your probe. + /// Add probe destruction volumes to this planet. + /// These will delete your probe just like the eye of the universe does. /// public VolumeInfo[] destructionVolumes; /// - /// Add probe safety volumes to this planet. These will stop the probe destruction volumes from working. + /// Add probe safety volumes to this planet. + /// These will stop the probe destruction volumes from working. /// public VolumeInfo[] safetyVolumes; } diff --git a/NewHorizons/External/Modules/Volumes/RulesetModule.cs b/NewHorizons/External/Modules/Volumes/RulesetModule.cs index 3604ba2e..e5e74d0c 100644 --- a/NewHorizons/External/Modules/Volumes/RulesetModule.cs +++ b/NewHorizons/External/Modules/Volumes/RulesetModule.cs @@ -9,10 +9,12 @@ namespace NewHorizons.External.Modules.Volumes { /// /// Add anti travel music rulesets to this planet. + /// This means no space/traveling music while inside the ruleset/volume. + /// Usually used on planets. /// public VolumeInfo[] antiTravelMusicRulesets; /// - /// Add player impact rulesets to this planet. + /// Add player impact rulesets to this planet. /// public PlayerImpactRulesetInfo[] playerImpactRulesets; /// diff --git a/NewHorizons/External/Modules/Volumes/VolumesModule.cs b/NewHorizons/External/Modules/Volumes/VolumesModule.cs index 9d5a9163..f11189d9 100644 --- a/NewHorizons/External/Modules/Volumes/VolumesModule.cs +++ b/NewHorizons/External/Modules/Volumes/VolumesModule.cs @@ -13,6 +13,7 @@ namespace NewHorizons.External.Modules.Volumes /// /// Add destruction volumes to this planet. + /// Destroys bodies if they enter this volume. Can kill the player and recall the scout probe. /// public DestructionVolumeInfo[] destructionVolumes; @@ -23,31 +24,38 @@ namespace NewHorizons.External.Modules.Volumes /// /// Add hazard volumes to this planet. + /// Causes damage to player when inside this volume. /// public HazardVolumeInfo[] hazardVolumes; /// /// Add interference volumes to this planet. + /// Hides HUD markers of ship scout/probe and prevents scout photos if you are not inside the volume together with ship or scout probe. /// public VolumeInfo[] interferenceVolumes; /// - /// Add insulating volumes to this planet. These will stop electricty hazard volumes from affecting you (just like the jellyfish). + /// Add insulating volumes to this planet. + /// These will stop electricty hazard volumes from affecting you (just like the jellyfish). /// public VolumeInfo[] insulatingVolumes; /// - /// Add light source volumes to this planet. These will activate rafts and other light detectors. + /// Add light source volumes to this planet. + /// These will activate rafts and other light detectors. /// public VolumeInfo[] lightSourceVolumes; /// /// Add map restriction volumes to this planet. + /// The map will be disabled when inside this volume. /// public VolumeInfo[] mapRestrictionVolumes; /// /// Add notification volumes to this planet. + /// Sends a notification to the player just like ghost matter does when you get too close + /// and also to the ship just like when you damage a component on the ship. /// public NotificationVolumeInfo[] notificationVolumes; @@ -62,7 +70,8 @@ namespace NewHorizons.External.Modules.Volumes public ProbeModule probe; /// - /// Add reference frame blocker volumes to this planet. These will stop the player from seeing/targeting any reference frames. + /// Add reference frame blocker volumes to this planet. + /// These will stop the player from seeing/targeting any reference frames. /// public VolumeInfo[] referenceFrameBlockerVolumes; @@ -82,7 +91,8 @@ namespace NewHorizons.External.Modules.Volumes public RulesetModule rulesets; /// - /// Add speed trap volumes to this planet. Slows down the player when they enter this volume. + /// Add speed trap volumes to this planet. + /// Slows down the player when they enter this volume. /// public SpeedTrapVolumeInfo[] speedTrapVolumes; From 1c88e863bbe7e94f2226998b52d50f1f9b40e2fb Mon Sep 17 00:00:00 2001 From: Ben C Date: Wed, 12 Jul 2023 06:48:17 +0000 Subject: [PATCH 3/3] Updated Schemas --- NewHorizons/Schemas/body_schema.json | 30 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/NewHorizons/Schemas/body_schema.json b/NewHorizons/Schemas/body_schema.json index 3f72f361..76873e3f 100644 --- a/NewHorizons/Schemas/body_schema.json +++ b/NewHorizons/Schemas/body_schema.json @@ -3263,7 +3263,7 @@ }, "destructionVolumes": { "type": "array", - "description": "Add destruction volumes to this planet.", + "description": "Add destruction volumes to this planet.\nDestroys bodies if they enter this volume. Can kill the player and recall the scout probe.", "items": { "$ref": "#/definitions/DestructionVolumeInfo" } @@ -3277,42 +3277,42 @@ }, "hazardVolumes": { "type": "array", - "description": "Add hazard volumes to this planet.", + "description": "Add hazard volumes to this planet.\nCauses damage to player when inside this volume.", "items": { "$ref": "#/definitions/HazardVolumeInfo" } }, "interferenceVolumes": { "type": "array", - "description": "Add interference volumes to this planet.", + "description": "Add interference volumes to this planet.\nHides HUD markers of ship scout/probe and prevents scout photos if you are not inside the volume together with ship or scout probe.", "items": { "$ref": "#/definitions/VolumeInfo" } }, "insulatingVolumes": { "type": "array", - "description": "Add insulating volumes to this planet. These will stop electricty hazard volumes from affecting you (just like the jellyfish).", + "description": "Add insulating volumes to this planet.\nThese will stop electricty hazard volumes from affecting you (just like the jellyfish).", "items": { "$ref": "#/definitions/VolumeInfo" } }, "lightSourceVolumes": { "type": "array", - "description": "Add light source volumes to this planet. These will activate rafts and other light detectors.", + "description": "Add light source volumes to this planet.\nThese will activate rafts and other light detectors.", "items": { "$ref": "#/definitions/VolumeInfo" } }, "mapRestrictionVolumes": { "type": "array", - "description": "Add map restriction volumes to this planet.", + "description": "Add map restriction volumes to this planet.\nThe map will be disabled when inside this volume.", "items": { "$ref": "#/definitions/VolumeInfo" } }, "notificationVolumes": { "type": "array", - "description": "Add notification volumes to this planet.", + "description": "Add notification volumes to this planet.\nSends a notification to the player just like ghost matter does when you get too close\nand also to the ship just like when you damage a component on the ship.", "items": { "$ref": "#/definitions/NotificationVolumeInfo" } @@ -3330,7 +3330,7 @@ }, "referenceFrameBlockerVolumes": { "type": "array", - "description": "Add reference frame blocker volumes to this planet. These will stop the player from seeing/targeting any reference frames.", + "description": "Add reference frame blocker volumes to this planet.\nThese will stop the player from seeing/targeting any reference frames.", "items": { "$ref": "#/definitions/VolumeInfo" } @@ -3355,7 +3355,7 @@ }, "speedTrapVolumes": { "type": "array", - "description": "Add speed trap volumes to this planet. Slows down the player when they enter this volume.", + "description": "Add speed trap volumes to this planet.\nSlows down the player when they enter this volume.", "items": { "$ref": "#/definitions/SpeedTrapVolumeInfo" } @@ -3494,9 +3494,9 @@ "description": "Whether the bodies will shrink when they enter this volume or just disappear instantly.", "default": true }, - "onlyAffectsPlayerAndShip": { + "onlyAffectsPlayerRelatedBodies": { "type": "boolean", - "description": "Whether this volume only affects the player and ship." + "description": "Whether this volume only affects the player, ship, probe/scout, model rocket ship, and nomai shuttle." }, "radius": { "type": "number", @@ -3859,14 +3859,14 @@ "properties": { "destructionVolumes": { "type": "array", - "description": "Add probe destruction volumes to this planet. These will delete your probe.", + "description": "Add probe destruction volumes to this planet.\nThese will delete your probe just like the eye of the universe does.", "items": { "$ref": "#/definitions/VolumeInfo" } }, "safetyVolumes": { "type": "array", - "description": "Add probe safety volumes to this planet. These will stop the probe destruction volumes from working.", + "description": "Add probe safety volumes to this planet.\nThese will stop the probe destruction volumes from working.", "items": { "$ref": "#/definitions/VolumeInfo" } @@ -3968,14 +3968,14 @@ "properties": { "antiTravelMusicRulesets": { "type": "array", - "description": "Add anti travel music rulesets to this planet.", + "description": "Add anti travel music rulesets to this planet.\nThis means no space/traveling music while inside the ruleset/volume.\nUsually used on planets.", "items": { "$ref": "#/definitions/VolumeInfo" } }, "playerImpactRulesets": { "type": "array", - "description": "Add player impact rulesets to this planet.", + "description": "Add player impact rulesets to this planet. ", "items": { "$ref": "#/definitions/PlayerImpactRulesetInfo" }