Jump to content

How to change an activator item into an item you can keep?


amokrun1

Recommended Posts

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

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 by amokrun1
Link to comment
Share on other sites

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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...