HeyYou Posted January 14, 2019 Share Posted January 14, 2019 Is it possible to determine distance to the crosshair reference? (for purposes of a range-finding scope.) Is it even possible to GET the crosshair reference?? I know in past games, this was a script extender function, but, I am not finding anything in the documentation for it. I would love to have an "In Range" indicator on my sniper rifle..... something simply inserted into the scope overlay perhaps? Even if I can just get the crosshair ref, should be able to use registerforevent of some variety to 'turn on' the indicator..... The game knows what I am aiming at after all, and the game also knows how far away I am. I am just tired of having a long range weapon, that can't hit what I am aiming at.... Seems I can see stuff a LOT further away, than I can expect to hit with my .50 BMG Anti-Material rifle...... seems odd. (even with a range of 778.....) I know there is a mod that simply uses a specific weapon/ammo, and you shoot your target to determine range..... but I would rather not have to resort to that. Link to comment Share on other sites More sharing options...
Reneer Posted January 14, 2019 Share Posted January 14, 2019 (edited) Probably the easiest / broadest way to do this would be to use IsInIronSights to check to see if the player is in IronSights / zoomed (polling every second or so). If that happens, then you would start up a timer that would PlaceAtMe a projectile (with painless / no damage settings) near the player (obviously facing the direction that the player is aiming) that moves as fast as possible and when it hits it would spawn / place an item that would check the distance from itself to the Player (then delete itself) and then you have the distance to whatever the player is aiming at. Getting that info to display on the HUD is another matter entirely and would probably involve mucking around with Flash files. Also figuring out whether the actual bullet being fired would be "in range" or not is not easy because, surprise, surprise, you can't get any information on that from Papyrus. Alternatively, you could use something like the Target Reticule spell but also have it calculate distance when the player's Heading Angle to the spell target is roughly zero. Edited January 14, 2019 by Reneer Link to comment Share on other sites More sharing options...
HeyYou Posted January 14, 2019 Author Share Posted January 14, 2019 Probably the easiest / broadest way to do this would be to use IsInIronSights to check to see if the player is in IronSights / zoomed (polling every second or so). If that happens, then you would start up a timer that would PlaceAtMe a projectile (with painless / no damage settings) near the player (obviously facing the direction that the player is aiming) that moves as fast as possible and when it hits it would spawn / place an item that would check the distance from itself to the Player (then delete itself) and then you have the distance to whatever the player is aiming at. Getting that info to display on the HUD is another matter entirely and would probably involve mucking around with Flash files. Also figuring out whether the actual bullet being fired would be "in range" or not is not easy because, surprise, surprise, you can't get any information on that from Papyrus. Alternatively, you could use something like the Target Reticule spell but also have it calculate distance when the player's Heading Angle to the spell target is roughly zero.Ouch. Couldn't be easy huh? :) Target Reticule spell? I am not familiar with that one. Link to comment Share on other sites More sharing options...
Reneer Posted January 15, 2019 Share Posted January 15, 2019 (edited) I might be naming it wrong. It's the one that puts red triangles over enemies heads and is attached to scopes, like this one. That runs a script / magiceffect on enemies and you could create a new spell that calculates the distance from the enemy to the player. Edited January 15, 2019 by Reneer Link to comment Share on other sites More sharing options...
HeyYou Posted January 15, 2019 Author Share Posted January 15, 2019 (edited) I might be naming it wrong. It's the one that puts red triangles over enemies heads and is attached to scopes, like this one. That runs a script / magiceffect on enemies and you could create a new spell that calculates the distance from the enemy to the player.Now THERE is an interesting idea. Wonder if it is possible to get the reference for the diamond. I know it allows to track multiple references. Thank You. :D Another member sent me a script to display target distance in the hud as well. That was VERY nice. Haven't looked at it yet though. :D (Thank YOU DieFeM!!!) Edit: Works great! Doesn't show in the scope view, but, that is a minor issue. Trouble is, there has to be a 'correction factor' between weapon range, and in-game units. Any clue what that might be? Best info I can find is 12, or perhaps, 11. (from a post on steam forums.) Edited January 15, 2019 by HeyYou Link to comment Share on other sites More sharing options...
HeyYou Posted January 16, 2019 Author Share Posted January 16, 2019 (edited) Anyone know the formula the game uses to display range of a weapon in any of the screens? I can convert units to inches/feet, but, knowing what 'units' the game was using to describe the range of the weapon, and display it, would sure help. It sure ain't game units..... I suspect it may be feet, but, its also a real possibility it is in yards...... I simply don't know, and can't find the calculation. Mainly because I don't know where to look. Could it be a property of one of the swf files?? Edited January 16, 2019 by HeyYou Link to comment Share on other sites More sharing options...
HeyYou Posted January 16, 2019 Author Share Posted January 16, 2019 (edited) Ok, went in game, had the "mechanical menace" (mechanist) quest, "Speak to the Robot" being the next stage. So, went to where Ada was, as she was conveniently the quest target, and tested various ranges, comparing the quest marker distance, to what the widget displayed. With some wiggle room, (as the quest marker is integers only) it appears that distance on the quest target is distance/100. Think I am going to use (target distance +50)/100, so it will round up. (distance shown appears to be integer only as well. Now to see how that relates to weapon range...... Edited January 16, 2019 by HeyYou Link to comment Share on other sites More sharing options...
HeyYou Posted January 16, 2019 Author Share Posted January 16, 2019 Ok, apparently, because I use NMM, I seem to be unable to compile scripts. Compiler keeps telling me <unknown>(0,0): unable to locate script tdmaliasscript.psc (script name probably isn't correct here, as I am typing it from memory, in the actual error message, it is indeed correct though.) Does the compiler not support the symlinks NMM uses?? Link to comment Share on other sites More sharing options...
DieFeM Posted January 16, 2019 Share Posted January 16, 2019 Probably you are getting errors compiling scripts because you need to place HUDFramework.psc in Scripts/Source/User, you'll find it in HUDFramework Development Kit from the HUDFramework mod page. Link to comment Share on other sites More sharing options...
HeyYou Posted January 16, 2019 Author Share Posted January 16, 2019 (edited) Probably you are getting errors compiling scripts because you need to place HUDFramework.psc in Scripts/Source/User, you'll find it in HUDFramework Development Kit from the HUDFramework mod page.I'll give that a shot. :smile: In the meantime, I have been doing some testing. Using my .50bmg sniper rifle, (modern firearms) with a range of 766, it appears that 10,000 units plus or minus a few, is max range that I can actually hit something. I had one instance of hitting/killing something at 10160, but, I couldn't repeat it. Now, there is a real possibility that the max range for the BULLETS I am firing, is set at 10000... gonna have to check that. :smile: Edit: Confirmed, the 'projectile' the weapon uses has a range of 10,000. That explains a bit. :) Edited January 16, 2019 by HeyYou Link to comment Share on other sites More sharing options...
Recommended Posts