ablindm4n Posted March 11, 2017 Share Posted March 11, 2017 Managed to get it working this morning by using a projectile explosion to spawn an object, then running a script on the object to find the distance to the player and then delete itself. Was still having trouble with the projectile cause enemies to detect the player, but I think I've solved that now - needs more testing though. Link to comment Share on other sites More sharing options...
ablindm4n Posted March 11, 2017 Share Posted March 11, 2017 (edited) I can't seem to get all enemies to ignore the weapon being fired - it only seems to work on standard raiders. This is the code I am using to get the distance: Scriptname RangeFinderScript extends ObjectReference float UnitDistance float MetreDistance Event OnLoad() debug.EnableDetection(false) UnitDistance = Game.GetPlayer().GetDistance(self) MetreDistance = (UnitDistance * 1.428) / 100 Debug.notification("Distance: " + MetreDistance + "M") self.delete() debug.EnableDetection(true) endEvent And it is attached to a MoveableStatic, which is spawned by an Explosion, which is triggered by the Projectile that the rangefinders shoot. Without using debug.EnableDetection() the projectile will alert enemies every time, but using it only works for certain enemies. Edit: Turns out EnableDetection (or tdetect in the console) just doesn't work on some enemies for some reason. Even if it did work though, there doesn't seem to be any way of extending the usable range to over ~200m, so it's not that much use. Edited March 11, 2017 by a_blind_man Link to comment Share on other sites More sharing options...
jackjack86 Posted March 12, 2017 Author Share Posted March 12, 2017 well going off the meter distance formula you got there 200M= 14005 units which is just shy of the max vanilla 308 range (15000 units). I don't see why the actors would be alerted by a moveable static tho. Link to comment Share on other sites More sharing options...
ablindm4n Posted March 12, 2017 Share Posted March 12, 2017 I think it's to do with the projectile impacting the ground near them. Even with everything (weapon, projectile, explosion) set to silent they will still be alerted by the impact - and the same even without the explosion altogether. It would be usable if only `debug.EnableDetection(false)` worked as it is supposed to, but I think there must be a bug with the game that stops it from working on all enemies. Link to comment Share on other sites More sharing options...
deadbeeftffn Posted March 12, 2017 Share Posted March 12, 2017 (edited) ----- deleted -----think before post :-\ Edited March 12, 2017 by deadbeeftffn Link to comment Share on other sites More sharing options...
Recommended Posts