FiftyTifty Posted December 23, 2015 Share Posted December 23, 2015 (edited) It seems that I've figured out why items will randomly sink into objects and/or disappear beneath the ground; whenever a cell is reloaded, certain items move up/down, which causes the aforementioned bugs. I discovered this by creating a Four Dragon script that disables most of the dynamic havok physics on an item (essentially making the item a static object), unloaded the cell (Red Rocket) by travelling to Sanctuary Hills, then repeatedly fast traveled to Red Rocket. After each fast travel, certain items either moved up or down in position. Here is the .cs file (might crash after some use; compiling into a .dll file remedies it): using System; using System.Collections.Generic; using Fallout; namespace FyTyTest { public static class FyTyCommonUtils/// Static since the function doesn't change anything, it just returns a value { public static void SetItemStayStill(ObjectReference FyTyobjref)/// Also doesn't change anything { FyTyobjref.SetMotionType(2, true);/// SetMotionType(Set the item to not be movable, set the item to be activateable) } } public class FreezeObject : ScriptObject { public FreezeObject() { }/// The hell does this even do? bool bGotObject = false; ObjectReference ItemReference; public override void OnStaticTick()///(void makes the function similar to Pascal's "Procedure") Every frame, do: { bool bGetObjectHotkey = Fallout.Keyboard.IsKeyJustUp(System.Windows.Forms.Keys.F6);/// Set the freeze object hotkey to F6 bool bFreezeObjectHotkey = Fallout.Keyboard.IsKeyJustUp(System.Windows.Forms.Keys.F7); if (bGetObjectHotkey)/// When the key is pressed { //Debug.Notification("Pressed The Hotkey"); ItemReference = Game.GetPlayerGrabbedRef();/// Get the item as an ObjectReference. int ItemValue = ItemReference.GetGoldValue(); if (ItemValue != -1)/// Make sure we have something selected in the console { //Debug.Notification("Got the Item"); bGotObject = true; } } if (bFreezeObjectHotkey && bGotObject) { if (bGotObject)/// Make sure we have an item by checking the value. ///Turns out that Fallout 4 added the GetIsFormType() function. Hooray! But Four Dragon throws an error. D'aww. ///if (ItemReference.GetIsFormType("ALCH") || ItemReference.GetIsFormType("MISC") || ItemReference.GetIsFormType("WEAP") || ItemReference.GetIsFormType("ARMO")) { FyTyCommonUtils.SetItemStayStill(ItemReference);/// Freeze the item in place //Debug.Notification("Froze the item"); bGotObject = false; } } } } } Nuka Cola would move downwards, whereas Potato Crisps and Pork & Beans would move upwards. The Boston Bugle, on the other hand, stayed in place, as did the Plastic Plate and the Giddyup Buttercup head. After fast travelling four times, here is the end result: http://i.imgur.com/5xfagsQ.png Took a gander at the .nif files using Nifskope; didn't find anything out of the ordinary, so I doubt it's an issue with the meshes. Perhaps the issue may lie with the "Object Bounds" element in the records of the problematic items? Edit: Nope. Changing the Object Bounds values does nothing to remedy the issue. Edited December 23, 2015 by FiftyTifty Link to comment Share on other sites More sharing options...
FiftyTifty Posted December 25, 2015 Author Share Posted December 25, 2015 Turns out that it is a problem with the .nif files. With the Nuka Cola Quantum .nif, I changed the Translation Z value to "-4.8623", for the nodes: "NiNode OrderedRenderingNode [2]""NiNode Nuka Cola Quantum [3]""Nuka Cola Quantium [3]" And now the Nuka Cola Quantum doesn't sink. It's going to be hell changing the Z values of all the bugged items. Ergh. Link to comment Share on other sites More sharing options...
SergeantGrrock Posted January 2, 2016 Share Posted January 2, 2016 I'm glad this "bugs" other people too. I hate that I can't set my items on tables and shelves. Why did they even include fricking shelves??? It was a huge pain to set things up in FO3 and Skyrim but at least it was possible! With the build mode included in FO4 it's just unforgivable that this happens. Thanks for looking into it. As usual... hopefully mods will correct this. Link to comment Share on other sites More sharing options...
Aintiarna Posted January 2, 2016 Share Posted January 2, 2016 I was curious about this as well. I wonder why they're all bugged like that. I don't envy anyone the tedious task of fixing the items though. Might be better to wait to and see if Bethesda fix it themselves in a future patch. Or is that ridiculous wishful thinking? Imagine if you fixed every nif file and then Beth fixed it anyway. That would hurt. Link to comment Share on other sites More sharing options...
FiftyTifty Posted January 3, 2016 Author Share Posted January 3, 2016 I was curious about this as well. I wonder why they're all bugged like that. I don't envy anyone the tedious task of fixing the items though. Might be better to wait to and see if Bethesda fix it themselves in a future patch. Or is that ridiculous wishful thinking? Imagine if you fixed every nif file and then Beth fixed it anyway. That would hurt. Bethesda fixing bugs is a pipe dream, really. They haven't fixed the 64hz bug that has been in their post-Morrowind games, for example. And aye, it's probably best to wait for Bethesda to finish patching the game, just in case we luck out. Link to comment Share on other sites More sharing options...
Deleted31005User Posted January 6, 2016 Share Posted January 6, 2016 Placing objects is just impossible, unless you place static version of them so this issue you describe nor npcs will move them ever again:http://www.nexusmods.com/fallout4/mods/4270/? Link to comment Share on other sites More sharing options...
FiftyTifty Posted January 6, 2016 Author Share Posted January 6, 2016 Placing objects is just impossible, unless you place static version of them so this issue you describe nor npcs will move them ever again:http://www.nexusmods.com/fallout4/mods/4270/? Or just fix the meshes. And if ya want them to be static, just call the Papyrus SetMotionType() function on it. Replacing the items with statics is just bleh. And is not even a workaround; it can only be done in settlements. Link to comment Share on other sites More sharing options...
SergeantGrrock Posted January 6, 2016 Share Posted January 6, 2016 I looked into Ac3s's link and checked out the Papyrus thing. But both looked tl;dr. If no other fixes pop up in the next few weeks I might look into those suggestions but I guess I'm not that fanatical about it (yet :laugh:). Not to go on a rant but man... I would have gladly paid double for my Beth games if they would've just worked properly "out of the box". :mad: Pipe dreams I guess. Thank you both for the tips! Link to comment Share on other sites More sharing options...
SergeantGrrock Posted January 6, 2016 Share Posted January 6, 2016 What? I can't give kudos in the forums anymore?? I thought we were able to do that before. Link to comment Share on other sites More sharing options...
FiftyTifty Posted January 8, 2016 Author Share Posted January 8, 2016 (edited) As an update, I found out how to obtain the necessary XYZ values to put into the "Transform" XYZ entries. First, add this improved FourDragon script by copy-pasting it into a text file, saving it in your "Fallout 4\Data\FourDragon" folder with the extension being .cs. For example: FyTyTest.cs using System; using System.Collections.Generic; using Fallout; public class FreezeObject : ScriptObject { public FreezeObject() { } bool bGotObject = false; ObjectReference ItemReference; ObjectReference EmptyReference; int ObjRefID; public override void OnStaticTick() {try { base.OnStaticTick(); bool isF8 = Fallout.Keyboard.IsKeyJustUp(System.Windows.Forms.Keys.F8); if(isF8) { ObjRefID = GameConsole.GetSelectedFormId(); Form TempForm = Game.GetForm(ObjRefID); ItemReference = TempForm.ToObjectReference(); int ItemValue = ItemReference.GetGoldValue(); if (ItemValue > -1) { ItemReference.SetMotionType(2, true); } } } catch { } } } In-game, get two copies of the item (e.g Potato Crisps). Place one of them on a flat surface, such as a table. Open the console, select the crisps. Close the console. Press F8 (default hotkey for freezing the item, in my script). Travel to a different location to unload the cell (e.g, fast travel from Red Rocket, to Abernathy Farm). Return to the cell, the potato crisps will now have changed position. For potato crisps, they went upwards. For Nuka Cola, they sunk downwards. Place the 2nd tub of crisps on the same flat surface. Open the console, select the 1st tub and type GetPos Z. Write down this number. Repeat for the 2nd tub. We now want to get the change in position. Since the crisps went downwards, we'll subtract the 1st crisps' Z value from the 2nd. The result will be 20.13 for the potato crisps, should you have followed the instructions. Copy-paste the .nif file (.ba2 extractor @ the F4SE site) "meshes\SetDressing\FoodAndFoodWare\PotatoCrisps.nif" to your data folder, keeping the paths the same. Open the copied .nif file in Nifskope 2.0 Select the root NiNode "Name - 0 NiNode | Value - WaterPurified". Yeah, the crisps use the same mesh as the purified water. On the bottom pane, look for the entry name "Translation". The value should be "X - 0 | Y - 0 | Z - 0". Since the crisps move upwards in-game, we want to compensate by moving the .nif downwards; change the z value we got earlier to a negative (20.13 -> -20.13). Set the Transformation Z value to -20.13. Save the .nif and praise Crom. Yeah, it's a complete and utter pain in the ass to do this. So far, I think only the Z value gets changed, so at least positioning the items is simple enough. If we can get a list of all the items that change in position, that would make things much easier; if nobody else is willing to do the tedious nightmare of editing the .nif files, I could do it once we know the problem items. Edited January 8, 2016 by FiftyTifty Link to comment Share on other sites More sharing options...
Recommended Posts