Jump to content

Need help with scripting for crafting station


Recommended Posts

Posted

Hello.  First time posting here.  I created a crafting station for soul gem merging.  What I'm trying to do :  

 

  • I created 5 ConstructibleObjects, each produces average of 1 black soulgems by merging variety quantities of filled soulgems.  Each time item is created I wanted Debug.Notification("[quantity] white souls had been released').  That's all.  Apparently this is complicated because as you see the script attached, I have no clue what I was doing.  It won't compile as ConstructibleObject is not variable.  Should it be made into variable?
  • I tried to see how it is done with the blacksmithing tutorial, and I see in the quest it uses GetItemCount condition.  Well, the crafting station will produce black soulgems with other things too, so it wont be specific to the filled soulgems used.  And I have no clue how it decided you completed making whatever object (i see the xmarker on the forge etc), but i think it was iron dagger that has 2, and if you make the wrong one it wont update your objective.  so this really confused me.
  • Initially I thought about creating a FormList, and put all the ConstructibleObjects I want in that form list, and get it to check formlist on activate, and maybe instead of specific number of white soul release i can just have Debug.Notification('White Souls had been released').  I just have no clue how to do that, and have not find any scripts in skyrim vanilla I can learn from.  Or maybe set it up in quest, then use IsInList condition?  I can put script in the crafting station, have it to run the quest when activated, how can i make sure the quest only runs when i activated it? maybe another notification of say.... blessing given?      

 

I really have no clue what i'm doing, the script i attached here obviously tells you so.    maybe i'm just over thinking this.  i'm just learning and scripting gave me anxiety, but I want to do this.  Even if someone can just point out a script to learn from.  Thank you

 

Scriptname SoulMergeScript.txt

Posted
On 8/14/2025 at 9:49 AM, abraincell8 said:

Hello.  First time posting here.  I created a crafting station for soul gem merging.  What I'm trying to do :  

 

  • I created 5 ConstructibleObjects, each produces average of 1 black soulgems by merging variety quantities of filled soulgems.  Each time item is created I wanted Debug.Notification("[quantity] white souls had been released').  That's all.  Apparently this is complicated because as you see the script attached, I have no clue what I was doing.  It won't compile as ConstructibleObject is not variable.  Should it be made into variable?
  • I tried to see how it is done with the blacksmithing tutorial, and I see in the quest it uses GetItemCount condition.  Well, the crafting station will produce black soulgems with other things too, so it wont be specific to the filled soulgems used.  And I have no clue how it decided you completed making whatever object (i see the xmarker on the forge etc), but i think it was iron dagger that has 2, and if you make the wrong one it wont update your objective.  so this really confused me.
  • Initially I thought about creating a FormList, and put all the ConstructibleObjects I want in that form list, and get it to check formlist on activate, and maybe instead of specific number of white soul release i can just have Debug.Notification('White Souls had been released').  I just have no clue how to do that, and have not find any scripts in skyrim vanilla I can learn from.  Or maybe set it up in quest, then use IsInList condition?  I can put script in the crafting station, have it to run the quest when activated, how can i make sure the quest only runs when i activated it? maybe another notification of say.... blessing given?      

 

I really have no clue what i'm doing, the script i attached here obviously tells you so.    maybe i'm just over thinking this.  i'm just learning and scripting gave me anxiety, but I want to do this.  Even if someone can just point out a script to learn from.  Thank you

 

Scriptname SoulMergeScript.txt 993 B · 2 downloads

 

I assume you're trying to attach that script to the work bench?  Unfortunately it's not as simple as that.  The OnActivate will trigger when you active the workbench,

not when you craft something.   If you craft something the story manager will create a craft event that includes the object that is constructed. You'd need to create a quest and register that in the story manager to get access to that information. The blacksmith `comment' quest (that plays a scene that consists of speaking a single line like, `fine weapon you made there') is an example of that.

 

Not sure why you want to run a script though, unless it is to create some side effect when creating the gem. For allowing gem merging it would be enough to have the constructable objects with the right ingredients (maybe test them on an existing workbench by choosing an appropriate keyword).

You can set the conditions so that is only shows up if you have the required ingredients in your inventory to prevent overloading the menus,

 

Can't really help further as I've never (successfully) created story manager quests or worked on custom workbenches.

 

 

Posted
1 hour ago, MTB said:

 

I assume you're trying to attach that script to the work bench?  Unfortunately it's not as simple as that.  The OnActivate will trigger when you active the workbench,

not when you craft something.   If you craft something the story manager will create a craft event that includes the object that is constructed. You'd need to create a quest and register that in the story manager to get access to that information. The blacksmith `comment' quest (that plays a scene that consists of speaking a single line like, `fine weapon you made there') is an example of that.

 

Not sure why you want to run a script though, unless it is to create some side effect when creating the gem. For allowing gem merging it would be enough to have the constructable objects with the right ingredients (maybe test them on an existing workbench by choosing an appropriate keyword).

You can set the conditions so that is only shows up if you have the required ingredients in your inventory to prevent overloading the menus,

 

Can't really help further as I've never (successfully) created story manager quests or worked on custom workbenches.

 

 

Hello.  Thank you for the reply.   I realized it's not that simple :(  .  What I want is every time I used certain ConstructibleObject in that crafting station that uses filled soul gem it gives notification " # white souls had been released" .   I can create the ConstructibleObject, but to make it so it show the notification is what puzzled me.  Hmmm, i thought it would be simple :( . I will look into this story manager in ck, and maybe do autopsy on the tutorial blacksmith quest once more.  Thank you again, at least now I have more clues of how to make this work.

Posted (edited)

Hi,

 

Bane Master's FMEA mod might be a good inspiration, too. Among many other cool things, it also triggers random events when using crafting stations such as the alchemy lab. It seems you want different things to happen, but the coding needed behind it might be very similar.

 

Edited by El_Duderino
Posted

So far as I know, Skyrim will tell you what got crafted, but not by which recipe nor which ingredients got used.

 

To get around this, if it's possible at all, you'd need a SKSE plugin that hooks into the low-level code; perhaps that plugin already exists, though I have not encountered it.

 

You might also use the station's "OnActivate" event and the "SM Item Crafter event" to read the player's inventory and deduce what got consumed... 

 

Posted

Hearthfires uses the event OnContainerChanged to determine when an item is created at a workbench. The prior container is none, and the new one is the player. The same one should fire, with the opposite conditions, for the ingredients. If you attach a script to the soul gems,  you should be able to notify the release,  but  it may have to be a message for each one. 

 

You will need to check some other things, as just dropping a gem is also a container change. Your requirements are likely to require multiple scripts notifying each other.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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