amokrun1 Posted January 23, 2019 Share Posted January 23, 2019 You know that schematic you can find to build artillery mortars(from the Old Guns quest I think it's called)? When you pick it up it grants you the ability to craft the defense mortars but it disappears from the world. I am working on a mod and I want to make it so that it's an item I can actually pick up and keep in my inventory, just like the schematic for the robot workbench from Automatron. I found the file in FO4edit and it's not a MISC item but an activator. So, how would I go about changing the activator item into a MISC one without breaking the effect it has on the game? Link to comment Share on other sites More sharing options...
MissingMeshTV Posted January 23, 2019 Share Posted January 23, 2019 You might start by creating a MISC item that’s a duplicate of your Activator item: same name, mesh, etc. Then attach a script to the Activator that when it is activated (and presumably disappears from the game as you described) adds the MISC item to the player’s inventory. Link to comment Share on other sites More sharing options...
amokrun1 Posted January 23, 2019 Author Share Posted January 23, 2019 (edited) You might start by creating a MISC item that’s a duplicate of your Activator item: same name, mesh, etc. Then attach a script to the Activator that when it is activated (and presumably disappears from the game as you described) adds the MISC item to the player’s inventory.That appears quite sound! But I know nothing of scripting. Would scripting this event be very detailed? I guess I need to start watching instructional videos/reading the wiki. Might you be able to suggest some other good sources? Edited January 23, 2019 by amokrun1 Link to comment Share on other sites More sharing options...
MissingMeshTV Posted January 24, 2019 Share Posted January 24, 2019 I'd suggest the CK wiki as a good starting point. Lots of good info there. The scripting tutorials by Darkfox127 helped me immensely in my first projects. Keep in mind his tutorials are for Skyrim, but much of what he shows is relevant to FO4 and at the very least can give you look at the basics. Seddon4494 has the best all-around FO4 CK tutorials I've seen but he doesn't do too much with scripting As for the script itself, this is a bare-bones version of what I've used in the past to do this and should get you started: Event OnActivate(ObjectReference akActionRef) Game.GetPlayer().AddItem(MyMiscItem, 1) EndEvent You'll of course need to define a MiscObject property for MyMiscItem or whatever else you decide you want to call it. Link to comment Share on other sites More sharing options...
amokrun1 Posted January 25, 2019 Author Share Posted January 25, 2019 I'd suggest the CK wiki as a good starting point. Lots of good info there. The scripting tutorials by Darkfox127 helped me immensely in my first projects. Keep in mind his tutorials are for Skyrim, but much of what he shows is relevant to FO4 and at the very least can give you look at the basics. Seddon4494 has the best all-around FO4 CK tutorials I've seen but he doesn't do too much with scripting As for the script itself, this is a bare-bones version of what I've used in the past to do this and should get you started: Event OnActivate(ObjectReference akActionRef) Game.GetPlayer().AddItem(MyMiscItem, 1) EndEvent You'll of course need to define a MiscObject property for MyMiscItem or whatever else you decide you want to call it. So I created a misc item (ID is Artil_Schematics) for the artillery schematics but when I enter the above script it fails to compile it. Returns with a "variable Artil_Schematics is undefined" message. I entered the script as follows: Event OnActivate(ObjectReference akActionRef) Game.GetPlayer().AddItem(Artil_Schematics, 1, true)EndEvent Link to comment Share on other sites More sharing options...
MissingMeshTV Posted January 25, 2019 Share Posted January 25, 2019 Like I said, you need to define a property for your Misc Item. Unless you do that, the script has no idea what items it is supposed to act upon and will give you the error you have. Link to comment Share on other sites More sharing options...
amokrun1 Posted January 25, 2019 Author Share Posted January 25, 2019 Simply wonderful, worked like a charm. Thanks so much for your patience. You just helped someone create his very first script. Link to comment Share on other sites More sharing options...
MissingMeshTV Posted January 25, 2019 Share Posted January 25, 2019 Cool! Glad you got it working. Welcome to the Dark Side. Your soul now belongs to the Dark Lord Papyrus. :laugh: Link to comment Share on other sites More sharing options...
Recommended Posts