Jump to content

Using enchanting tables to craft items?


Recommended Posts

Sorry my bad, I didn't fully understand what you meant then,, it took some experimenting to figure it out.

 

Now I finally have 2 options, one of them starts the vanilla enchantment feature, and the other activates a custom event that for now only shows a test notification.

I think I'll be able to figure out the rest, but otherwise I will update this thread. Thanks for all the help :>

Edited by Mornedil
Link to comment
Share on other sites

I have one more question related to this:

I have "fake disenchanting" recipes (basically a recipe which sets a global variable to 1). And I have conditional statements to only allow another recipe if the global variable has been set to 1. However, in order for the new recipe to appear on the workbench, I have to press Tab to exit and then press E on the workbench again.

Is there a way to "refresh" the recipes that appear on the crafting menu while you're in it? Or maybe closing then quickly re-opening the menu? (which might refresh it)

Edited by Mornedil
Link to comment
Share on other sites

I find that the crafting menu refreshes whenever my inventory changes. In a couple of other cases,I have found that the get global value condition does not trigger an update properly (e.g. when used as a condition for armor perks). Maybe if you made the new recipes appear as soon as the player added the scripted item to their inventory instead of when the global is set. For example there conditions could be:

 

Player GetInventoryCount YourGlobalItem >= 1 OR

GetGlobalValue YourGlobal == 1

 

That might cause the recipes to appear when the initial item gets crafted (and then not to disappear when the item is removed).

 

I'd say the best way to go about this would be to see what Hearthfire did with the drafting table. That sounds similar to what you are trying to do.

Link to comment
Share on other sites

I find that the crafting menu refreshes whenever my inventory changes. In a couple of other cases,I have found that the get global value condition does not trigger an update properly (e.g. when used as a condition for armor perks). Maybe if you made the new recipes appear as soon as the player added the scripted item to their inventory instead of when the global is set. For example there conditions could be:

 

Player GetInventoryCount YourGlobalItem >= 1 OR

GetGlobalValue YourGlobal == 1

 

That might cause the recipes to appear when the initial item gets crafted (and then not to disappear when the item is removed).

 

I'd say the best way to go about this would be to see what Hearthfire did with the drafting table. That sounds similar to what you are trying to do.

 

For some reason Creation Kit crashes while loading the Hearthfire master file, so can't take a look at that drafting table.

 

But somehow using the GetItemCount condition solved it! Thanks mate

Haha but the temporary item running the script is stuck in the inventory now. I've tried self.Delete() and Game.GetPlayer().RemoveItem(Self, 1, true), but the temporary item is still in the inventory.

Edited by Mornedil
Link to comment
Share on other sites

It sounds like you haven't edited your Creation Kit ini file to allow multiple masters.

 

Inventory items do not have a "self," so you have to create a property and fill it with the item's base object. You can use the RemoveItem function with the property.

MiscObj property ThisItem auto

game.getPlayer().RemoveItem(ThisItem, 1, true)
Link to comment
Share on other sites

 

It sounds like you haven't edited your Creation Kit ini file to allow multiple masters.

 

Inventory items do not have a "self," so you have to create a property and fill it with the item's base object. You can use the RemoveItem function with the property.

MiscObj property ThisItem auto

game.getPlayer().RemoveItem(ThisItem, 1, true)

 

Thanks! I thought I had caused some error, did not expect to have to edit an ini file to load an official game expansion

 

Isn't there a way to reference the item running the script somehow?

The removed item will always be the item the script is attached to. So I thought adding a property would be an extra unnecessary step when making more duplicates of the object, if it was somehow possible to look up the item the code is running on.

Edited by Mornedil
Link to comment
Share on other sites

Not as far as I know.

 

I have googled like crazy and haven't found anything pointing towards that either, so I'll stick to using a property. Kinda ironic though - Object oriented programming without being able to reference the object the script is placed on :laugh:

Link to comment
Share on other sites

Yeah, it's weird. Basically items in inventory aren't "objects" unless they are persistent. Otherwise they are just entries on a spreadsheet. I'd like to say you will get used to it but the truth is it never stops being annoying.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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