Jump to content

Advanced Recon Range Finder port to FO4?


Recommended Posts

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

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 by a_blind_man
Link to comment
Share on other sites

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...