fairplayer916 Posted October 1, 2016 Share Posted October 1, 2016 Put simply, Id like to learn how to completely replace one weapons existence in the game with a weapon mod. Specifically i want to replace the in game semi-auto and full-auto pipe rifle/pistol with YonaTakus' "Defense Gun"http://www.nexusmods.com/fallout4/mods/14598/? I THINK the simplest way to do this would be to change the form id call from the old weapon to the new one. Problem is i dont know how to do that. I would appreciate any and all help with this. Thank you in advance. Link to comment Share on other sites More sharing options...
zilav Posted October 1, 2016 Share Posted October 1, 2016 Would be much easier just to replace the original mesh. Link to comment Share on other sites More sharing options...
fairplayer916 Posted October 2, 2016 Author Share Posted October 2, 2016 well the file structure of the defense gun mod is alittle weird. figured the attachments wouldnt sink up if i jsut swapped the main mesh/textures Link to comment Share on other sites More sharing options...
FiftyTifty Posted October 2, 2016 Share Posted October 2, 2016 When it comes to replacing placed references, that's easy. Simply change the "NAME" element in all REFR records. A small excerpt-come-example from one of my scripts: eName := ElementBySignature(e, 'NAME'); strName := GetEditValue(eName); for iCounter := 0 to iNumEntriesInList - 1 do begin if strName = tstrlistOriginal[iCounter] then //Compare the reference's placed object. If it matches an entry in our list SetEditValue(eName, tstrlistReplace[iCounter]); //Replace it with the object in our second list end; The whole script: unit userscript; var tstrlistOriginal, tstrlistReplace: TStringList; //tstrlistOriginal Will contain all the NAME values that we're looking for. //tstrlistReplace Will contain the ones we want to change them to. //It's done on a line by line basis. The script looks through each line in //tstrlistOriginal. Once it finds a match with the currently selected record, //it looks in tstrlistReplace at the same line number, to get the replacement. iNumEntriesInList: integer; function Initialize: integer; begin tstrlistOriginal := TStringList.Create; tstrlistOriginal.LoadFromFile(ProgramPath + 'Edit Scripts\FyTy\NAME Replace - Source.txt'); tstrlistReplace := TStringList.Create; tstrlistReplace.LoadFromFile(ProgramPath + 'Edit Scripts\FyTy\NAME Replace - Replacement.txt'); iNumEntriesInList := tstrlistOriginal.Count; end; function Process(e: IInterface): integer; var eName: IInterface; strName: string; iCounter: integer; begin if Signature(e) <> 'ACHR' then if Signature(e) <> 'REFR' then exit; AddMessage('Processing: ' + FullPath(e)); eName := ElementBySignature(e, 'NAME'); strName := GetEditValue(eName); for iCounter := 0 to iNumEntriesInList - 1 do begin if strName = tstrlistOriginal[iCounter] then SetEditValue(eName, tstrlistReplace[iCounter]); end; end; function Finalize: integer; begin end; end. As for changing entries in leveled lists and NPC inventories, it's pretty much the same gig, but you have to loop through all the entries in NPC inventories, in form lists and in leveled items. Here's the documentation for xEdit scripting: http://www.creationkit.com/index.php?title=TES5Edit_Scripting_Functions Luckily, this is a really easy task, so it's a good first-time foray into scripting with pascal. Link to comment Share on other sites More sharing options...
Recommended Posts