Jump to content

Need script to make a crafted Item a Quest Object.


Masterofnet

Recommended Posts

Does anyone know I how to make a crafted item (an item crafted at a crafting station) a quest item?

 

Making the item an Alias and checking the quest item box will only work if you created a Ref Alias for the item and placed it in the environment.

 

There has to be a simple script you can put on a item to make it a quest item but I can not find it. I have found script on how to drop a quest item, pick it back up, mark it as not a quest item. But I have not been able to find any script that you can put on a item to make it a quest object so it can't be dropped until the quest is over.

 

Can anyone help?

 

Regards

Masterofnet.

Link to comment
Share on other sites

Try this: Make the ref alias and check the box, then put a script on the item at force fills that alias. Paste this into the script. When the the weapon instance is created, it'll become a quest item.

ReferenceAlias Property RefAlias Auto

Event OnInit()
	RefAlias.ForceRefTo(self)
EndEvent

Keep in mind, unless you remove that instance manually or clear the alias, it'll remain a quest item indefinitely.

Link to comment
Share on other sites

Yes I do need to get the game to fill the alias. I am familiar with forcing the a item to alias via the courier missions. However I am not sure how to script that on a item. That is the problem. When the item is crafted the game will not fill the alias.

 

Example : I create and alias and craft and item at a forge. It will not fill the Alias.

 

If I create and alias for an item and place it in a chest using an Alias and pick the item up and them craft the same item it will become a quest item.

 

I would have 2 of the items in my inventory and not be able to drop either one.

 

If the item is just crafted at a forge it can be dropped.

 

Do you have any ideas on how to script the item itself to auto fill the alias?

 

Regards
Masterofnet

Link to comment
Share on other sites

The script I gave you should do that. Just stick on a Weapon script or Armor script on the item in the base object in the CK. The script runs when it initializes, which should happen as soon as it's created by being crafted. If it's a generic item, then that won't work without duplicating it. If you can't or don't want to duplicate it, then add a player alias in you quest, have that alias run a script that is registered for any animation events that will tell you the player has started/stopped crafting. Waits for something new to be added to the player's inventory while they're crafting, and check the new item to see if it's the right thing. If it is, force that new item into the alias and you're goo to go (unregister for the animation events). It's untested, but it might work.

Link to comment
Share on other sites

How would the game know what Alias to fill?

 

Wouldn't the script need to identify the alias?

 

Like this script:

Alias_Note.ForceRetTo(GameGetPlayer().PlaceAtMe(Note)

 

The note is script property Note - Book - ID of book.

 

If I could put a script like this on an item it should work.

 

In this case the not alias in empty accept for the is quest item box being checked. The script forces it.

 

Regards
Miasterofnet

Link to comment
Share on other sites

It knows which alias to fill because I put in a property for a reference alias that you'd need to fill.

 

If you're referring to checking the inventory for the new item and what-not, then the same thing, you make a reference alias property. When you make a Reference Alias property in a script, then when you fill it, it asks which quest and which property.

Link to comment
Share on other sites

Yes, My mistake I thought it was supposed to be default.

 

Unfortunately it does not work. I craft the item and can drop it. I go and pick it up from a chest and I can not. If I craft the item after I have picked up the Item for the chest I can not drip it.

 

Same item.

 

I do not understand how this does not work. Why is the game ignoring this script?

 

 

Regards
Masterofnet

Link to comment
Share on other sites

So, the script is directly on the main object, correct? Such that every instance of the object will have the script? If so, then put in these two lines

utility.wait(0.1)
debug.notification("Script is working")

Also, the alias is initially empty, correct?

Link to comment
Share on other sites

http://forums.nexusmods.com/index.php?/topic/1489353-need-script-to-make-a-crafted-item-a-quest-object/

Xander I'll leave you to handle this. I think you got a better grasp of what the OP wants. Might as well move from the OP's duplicate thread into this one.

 

 

I did have a thought with regards to why a crafted item might not register. When it first appears, it appears in the player inventory. Some things do not process on objects when in a container (which is what the player inventory is). Might need to setup a hidden chest and a small player alias script to move the item from player to chest and back.

Link to comment
Share on other sites

This is very frustrating. I placed the item in the cell manually. Your ( Xander9009 ) script works great. The item is a quest I tem.

 

When craft the same item at a forge the script is ignored?? Like I have said , if I put a script on the item to trigger an event like set stage or display objective it is not ignored. Why is it ignoring this script and IsharaMeradin's script.

 

I did not make 2 posts because I did not find your Ishara's advice helpful. I do. I though that I posted this in the wrong place because all of the posts on the other topic were about mods people had downloaded. This is the first time I have posted here.

 

Forcing the alias is the way to go in my opinion. However when crafted it does not work.

 

I hope Ishara you stay with this. I am interested in finding out why this type of script is ignored with the item is crafted. This is what I have be dealing with for days.

 

Regards
Masterofnet

Edited by Masterofnet
Link to comment
Share on other sites

  • Recently Browsing   0 members

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