Jump to content

Crafting a LIGHT object such as a torch.


Gunner6999

Recommended Posts

Hello, I am making a mod that brings usable lanterns to Skyrim. I wanted the lanterns be given to the player through immersible means such as purchasing from vendors or (more preferably) crafting them. However, my issue is that since they are LIGHT objects, and not normal objects like armor/weapons/misc they won't show up in the purchase menu on vendors nor will they show up in the craft menu. I have been trying to find a way around this but have come up blank thus far. One thing I have considered is making a shield object with the torch model, animations, and light source but I don't know how possible that is. Thanks.
Link to comment
Share on other sites

I was actually going to do a similar mod, looks like you beat me too it. You may try the shield thing, in theory it should work, but maybe a torch or mace would work better, since then you could have a combat animation and effect to it as well.

 

Also did you try adding it manually to a vendors list or inventory?

Link to comment
Share on other sites

Thats the thing, my lantern is based off the torch but the torch is not handled the same way as all the other items. I put my lantern, which is a copy of a torch, into the vendors inventory but it never shows up in the buy menu, I even clipped through the ground and opened the vendor's chest and the lanterns were in there, but they just won't sell it. The same thing happens when I make it a craftable item. If i go over to the forge or any other equipment I set it to, it will never show the option to be able to craft it. This is why I'm thinking I need to make it not a torch item, but something like a shield or a mace like you suggested, but I don't know how to go about doing this. An important part is being able to have it use the torch animations in order for the holder to hold it up like a torch instead of swinging it around like its not there.
Link to comment
Share on other sites

You might be missing something simple in the item editing. Try copying something that is sold in the vendors and then editing the mesh information so that it points to your lantern and then see if it shows up in merchant inventories. If it does then compare the two items information and add anything missing to your lantern item. Edited by KaptTorbjorn
Link to comment
Share on other sites

  On 2/13/2012 at 8:15 AM, KaptTorbjorn said:

Try copying something that is sold in the vendors and then editing the mesh information so that it points to your lantern and then see if it shows up in merchant inventories.

 

That's the thing, I don't know about anyone else but I never see any vendors selling torches. Everything else the vendor sells is a different type of item. My lantern is a mesh replacer of a duplicated torch which is not a normal item. The way I been trying to go around this is copying an item that they do sell such as a shield or weapon, however I do not know how to mod the item at that point to make it work like a lantern, and not a weapon or a shield. Or of course if there is a way to make the vendors sell torches some how ;p;.

 

I was able to find the name of the animations torches use, they all begin with "Tor_" any idea how I would make the game use those for a certain weapon/shield?

 

Edit: Torches do occupy the shield slot according to the wiki so that would be my best bet of doing what I want to do.

Edited by Gunner6999
Link to comment
Share on other sites

Well they have a value, which means it is marketable, I thought at first the keyword tag for vending needed to be added but I do not see any keywords. If you make it off a weapon or armor however make sure the right vendor keyword is assigned too it.
Link to comment
Share on other sites

Ok, I looked through the entire Idle Animation list for human characters (where u click gameplay -> animations) and I found how the game handles nearly every single combat animation, however what I did not find was the the piece that makes characters raise their arm to hold the torch. Both the shield and the torch work off the same logic of "left click, if left arm doesn't have a weapon then block". I also noticed all shield items have a identifier value of 10, torch (Light) items have a identifier of 11. I guess if I am to trick the game into making a shield act as a torch, the shield will have to have an identifier of 11, I don't even know if this is possible

 

This makes me think my only option is to figure out a way to make the torch (Light) object show up on vendors and in crafting stations.

 

Ugh

Link to comment
Share on other sites

There's an easy solution: Make a dummy item. It has the same name as the carryable light item you want to give to the player but is a different type of object, say a weapon. Give it a script that makes it remove itself and add a torch once added into the player's inventory.
Link to comment
Share on other sites

Ok so I got the dummy item to show up in the crafting menu and it does craft and add to my inventory. I also got a script to change it into the appropriate lantern when i pick it up from the GROUND using "Event OnActivate", however this is not the even I need since it is added to my inventory without activating it.

 

I tried to use this event, "Event OnItemAdded" however the event is not being triggered when it is added to my inventory from the ground or the crafting menu.

 

Here is the portion that I am trying to get to work.

 

Scriptname newscriptthing extends ObjectReference  

Light Property newlight  Auto  

Armor Property newdummylight  Auto  

Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)

Debug.MessageBox("test1")
Game.GetPlayer().AddItem(newlight, 1 )
Game.GetPlayer().RemoveItem(akItemReference, 1)

endEvent

 

as you can see I added a debug message to see if I get anything at all from within the event but I'm not, meaning the event is not running.

 

Edit: just for a reference for my lame variable names, 'newlight' is the real lantern, 'newdummylight' is the dummy lantern I am to replace and which the script is run on.

 

EDIT AGAIN: After looking it over a bunch of times I'm pretty sure I used this function wrong, it need to be called on the player's inventory "Event received when an item is inserted into this object's container.". Item added into this objects container, not when this item is added into a container. Also noticing an obvious problem, the code i have their will start an infinite loop of adding and removing items since i left out the item filter to prevent it from running with any item.

Edited by Gunner6999
Link to comment
Share on other sites

  • Recently Browsing   0 members

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