Kanlaon Posted September 10, 2023 Posted September 10, 2023 Hello, Does anybody have a good idea how to detect if a workshop furniture or regular furniture is placed in open air ? My own idea works, but not reliable. Basically my own idea was to place a small object somewhat above the furniture and check if there is Line of sight available. So here is my function: bool Function isbedinopenair (objectreference testbed) If DownLookerRef else form tform = Game.getform (0x214007) ; Mine DownLookerRef = pl_ref.PlaceAtMe (tform, 1, false, true, false) endif ; DownLookerRef.MoveTo (testbed, 0.0, 0.0, 340.0) ; a) works in sanctuary DownLookerRef.MoveTo (testbed, 0.0, 0.0, 600.0) ; b) works in redrocket under the roof DownLookerRef.enable () utility.wait (0.05) bool bopenair = DownLookerRef.HasDirectLOS (testbed) ; DownLookerRef.disable () Log ("Bed in open air 600 " + bopenair + " DownLooker " + DownLookerRef) Debug.Notification ("Bed in open air " + bopenair ) return bopenair endfunction Placing the "Downlooker" 600 units above the furniture works well in Red rocket location and the roof high in the air is detected. However the same function fails and delivers false in sanctuary with no roof above the furniture. If the "Downlooker" is placed 340 units above the furniture the function works correct in sanctuary. Anyway with 340 units the "Downlooker" will be also under the 'high' roof in red rocket and therefore the function does not deliver the correct result in Red rocket. Maybe something is wrong with the function and a fix is possible. But maybe someone has a complete different idea.
Kanlaon Posted September 24, 2023 Author Posted September 24, 2023 I do not know the reason, but instead of using a mine as the downlooker I've tested it with a sleeping bag as a downlooker. And now the script works also in sanctuary as desired with the distance 600 units. Maybe it has something to do with the 'root node' in the mesh file, but I completely have no knowledge abaout mesh files.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now