mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Made maxTargetDistance accurate and added targetColliderRadius
This commit is contained in:
parent
e833512bda
commit
c0ad3a0fa7
@ -15,6 +15,7 @@ namespace NewHorizons.Builder.General
|
|||||||
|
|
||||||
var SC = rfGO.AddComponent<SphereCollider>();
|
var SC = rfGO.AddComponent<SphereCollider>();
|
||||||
SC.isTrigger = true;
|
SC.isTrigger = true;
|
||||||
|
// This radius ends up being set by min and max collider radius on the RFV but we set it anyway because why fix what aint broke
|
||||||
SC.radius = sphereOfInfluence * 2;
|
SC.radius = sphereOfInfluence * 2;
|
||||||
|
|
||||||
var RFV = rfGO.AddComponent<ReferenceFrameVolume>();
|
var RFV = rfGO.AddComponent<ReferenceFrameVolume>();
|
||||||
@ -23,7 +24,8 @@ namespace NewHorizons.Builder.General
|
|||||||
|
|
||||||
var RV = new ReferenceFrame(owrb);
|
var RV = new ReferenceFrame(owrb);
|
||||||
RV._minSuitTargetDistance = minTargetDistance;
|
RV._minSuitTargetDistance = minTargetDistance;
|
||||||
RV._maxTargetDistance = 0;
|
// The game raycasts to 100km, but if the target is farther than this max distance it ignores it
|
||||||
|
RV._maxTargetDistance = module.maxTargetDistance;
|
||||||
RV._autopilotArrivalDistance = 2.0f * sphereOfInfluence;
|
RV._autopilotArrivalDistance = 2.0f * sphereOfInfluence;
|
||||||
RV._autoAlignmentDistance = sphereOfInfluence * 1.5f;
|
RV._autoAlignmentDistance = sphereOfInfluence * 1.5f;
|
||||||
|
|
||||||
@ -35,7 +37,7 @@ namespace NewHorizons.Builder.General
|
|||||||
|
|
||||||
RFV._referenceFrame = RV;
|
RFV._referenceFrame = RV;
|
||||||
RFV._minColliderRadius = minTargetDistance;
|
RFV._minColliderRadius = minTargetDistance;
|
||||||
RFV._maxColliderRadius = module.maxTargetDistance > -1 ? module.maxTargetDistance : sphereOfInfluence * 2f;
|
RFV._maxColliderRadius = module.targetColliderRadius > 0 ? module.targetColliderRadius : sphereOfInfluence * 2f;
|
||||||
RFV._isPrimaryVolume = true;
|
RFV._isPrimaryVolume = true;
|
||||||
RFV._isCloseRangeVolume = false;
|
RFV._isCloseRangeVolume = false;
|
||||||
|
|
||||||
|
|||||||
@ -16,7 +16,7 @@ namespace NewHorizons.External.Modules
|
|||||||
public bool hideInMap;
|
public bool hideInMap;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Radius of the brackets that show up when you target this. Defaults to the sphereOfInfluence.
|
/// Radius of the brackets that show up when you target this. Defaults to the sphere of influence.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DefaultValue(-1)] public float bracketRadius = -1;
|
[DefaultValue(-1)] public float bracketRadius = -1;
|
||||||
|
|
||||||
@ -26,8 +26,13 @@ namespace NewHorizons.External.Modules
|
|||||||
public bool targetWhenClose;
|
public bool targetWhenClose;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The maximum distance that the reference frame can be targeted from. Defaults to double the sphereOfInfluence.
|
/// The maximum distance that the reference frame can be targeted from. Defaults to 100km and cannot be greater than that.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DefaultValue(-1)] public float maxTargetDistance = -1;
|
public float maxTargetDistance; // If it's less than or equal to zero the game makes it 100km
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The radius of the sphere around the planet which you can click on to target it. Defaults to twice the sphere of influence.
|
||||||
|
/// </summary>
|
||||||
|
public float targetColliderRadius;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user