Jump to content

Using enchanting tables to craft items?


Recommended Posts

I'm trying to use the existing enchanting table and turn it into an item crafting station. But I obviously don't want to mess with the enchanting feature, so my idea is that when the player presses E on the enchanting table, they're given a choice to either enchant normally or craft items.

 

I figure the steps of achieving this would be something like:

1. check if player activates an enchanting workbench

2. cancel the enchantment workshop/crafting menu so it doesn't appear

3. Display a simple message with 2 options to choose from

4. depending on choice, either re-activate the normal enchantment menu or activate a custom crafting station menu

 

But I have no idea which events and functions to use, or where to place the script. Any ideas where to start?

 

I've tried using the OnPlayerUseWorkBench event to check if a player uses the workbench, but it doesn't seem to work

Edit: scratch that, that was the wrong event. The OnSit event worked. But I still need to figure out how to cancel the furniture's default workbench type and give the choice to the player to use a different one.

Edited by Mornedil
Link to comment
Share on other sites

Just use a perk entry point to add a new activate option. Check out the vampire feeding perk for an example.

 

I've figured out where to place the script now, so the big problem now is how to change the "Bench Type" of the enchanting table depending on a popup message with 2 choices.

The Furniture Script section of the wiki is completely empty of functions.

Edited by Mornedil
Link to comment
Share on other sites

One option activates the enchanting table, one option activates hidden piece of furniture and brings up a crafting menu. Check out Throwing Weapons Lite or SPERG for examples. They both do exactly what you are trying to do.

 

SPERG:

http://www.nexusmods.com/skyrim/mods/24445

 

Throwing Weapons Lite:

http://www.nexusmods.com/skyrim/mods/62017

 

Thank you, I will check it out

 

Edit: Well.. Throwing Weapons Lite crashes the Creation Kit, and the "edit script source" button is grayed out for the SPERG scripts. Edit2: Found script sources, they were placed in a different location

Edited by Mornedil
Link to comment
Share on other sites

Found the script sources, but to be honest SPERG is way too heavyweight to find the functions I'm looking for. It feels like finding a needle in a haystack.

 

And this is all the code for the crafting station in the Throwing Weapons Lite mod:

Scriptname PRKF_000_JZBai_CraftingPerk_030FA3FA Extends Perk Hidden

Function Fragment_0(ObjectReference akTargetRef, Actor akActor)
    CraftingStation.Activate(Game.GetPlayer())
EndFunction

ObjectReference Property CraftingStation  Auto  

But since that mod instantly crashes the creation kit, I can't see how it's used.

Edited by Mornedil
Link to comment
Share on other sites

Yeah, I just took a peek at SPERG to see if I can be more helpful and while it's an impressive mod I feel like they did everything in the most complex imaginable way for some reason.

 

As I understand it, you basically have a workbench that is disabled and thus invisible. When the player activates the enchanter, they get a choice to either activate the enchanter normally or to craft items. If they select craft items, you either use PlaceAtMe to create an invisible workbench or you activate a persistent reference remotely. This will open the crafting menu for that workbench.

Link to comment
Share on other sites

Thanks, that's a start. Found the right section in the script while searching for "PlaceAtMe"!

I think I found something interesting related to the activation choice. In the perk itself (searching "glittering" in the creation kit), it has an Entry Point with the settings "Activate" and "Add activate choice". Hopefully it will lead me towards adding a new option to the enchant table

Edited by Mornedil
Link to comment
Share on other sites

  • Recently Browsing   0 members

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