othunderx Posted November 25, 2016 Share Posted November 25, 2016 As I know this can be done by create a base item and attach all other object mods. ObjectReference newItem = PlayerREF.PlaceAtMe(givenWeapon)int j = 0while j < givenMods.getSize()newItem.attachMod( givenMods.GetAt( j ) as ObjectMod )j += 1EndWhilePlayerREF.addItem( newItem, 1, true ) But how can I get all base forms of attached object mods on an exists item? If there are workarounds though, any information would be appreciated. Link to comment Share on other sites More sharing options...
Comiconomist Posted November 26, 2016 Share Posted November 26, 2016 I could be wrong but I believe this isn't in the base game - but fallout 4 script extender has a function GetAllMods at the bottom of their version of ObjectReference.psc, so that might do the trick. If you're lucky it will be as simple as putting givenMods = givenWeapon.GetAllMods() just before your loop. I've never actually used the script extender, but that might be a good starting point. Link to comment Share on other sites More sharing options...
othunderx Posted November 26, 2016 Author Share Posted November 26, 2016 (edited) Thank you for your reply Comiconomist , thats really a good point.I think there is a way I do not even need to use F4SE in developing time, it should exists in its runtime after I installed F4SE and run f4se_loader.exe.And for script I intend to using reflection:givenMods = givenWeaponRef.CallFunction( "GetAllMods", new Var[0])But sadly it runs failed with error "Failed to call member function GetAllMods on [ObjectReference <Item 6 in container (190055D0)>] - function name likely invalid, or object incorrect type".Still need to figure out how to using F4SE to developing. Edited November 26, 2016 by othunderx Link to comment Share on other sites More sharing options...
TrickyVein Posted November 26, 2016 Share Posted November 26, 2016 Things in containers aren't treated like object references anymore, and you can't run scripts on them. Try testing on something in the world. Link to comment Share on other sites More sharing options...
othunderx Posted November 26, 2016 Author Share Posted November 26, 2016 Things in containers aren't treated like object references anymore, and you can't run scripts on them. Try testing on something in the world.I've test item in the world, but still face the same error "Failed to call member function GetAllMods on [ObjectReference < (190055D3)>] - function name likely invalid, or object incorrect type". Link to comment Share on other sites More sharing options...
othunderx Posted November 28, 2016 Author Share Posted November 28, 2016 It works !!!But according to f4se this scripts is for test only now.In archive http://f4se.silverlock.org/beta/f4se_0_02_07.7z just copy all .pex files under folder _for_test_only/Data/Scripts to Fallout 4/Data/ScriptsThen using ScriptObject's reflection method to call the expended function. Link to comment Share on other sites More sharing options...
othunderx Posted November 28, 2016 Author Share Posted November 28, 2016 This is really a nightmare, after givenMods = givenWeaponRef.CallFunction( "GetAllMods", new Var[0])I just found out I can't do anything on givenMods because its Var type and function GetAllMods it returned ObjectMod[].Compile will failed on cast givenMods to any object array type, Dose anyone face same issue before? Link to comment Share on other sites More sharing options...
Recommended Posts