Jump to content

Need script to make a crafted Item a Quest Object.


Masterofnet

Recommended Posts

I'm making and testing this myself to avoid any further snags, but I need to know what the item is that's being crafted. Is it a generic item that might be found elsewhere or is it a unique item that can only be obtained through crafting.

 

For the record, my script nearly worked except it needed the "Form" changed to "ObjectReference" and "Silent" changed to "abSIlent". I had to remove the Crafting Menu check because it wasn't registering. Thus the need to know if the item might be obtained elsewhere. I used a generic iron dagger, and when I crafted it, it immediately became a quest item like expected. The only problem is that it would have done the same thing if I'd found the dagger instead of crafting it.

Edited by Xander9009
Link to comment
Share on other sites

This code from Xander9009 ( with his modifications ) works. It registers the alias right out of the forge. But you can not drop the item when the quest ends.

 

Maybe We are back to trying to force the Alias in the Stage. Or maybe this code can be fixed.

 

Scriptname A1TQPlayerForceAliasScript extends ReferenceAlias

Armor Property MyObject Auto

ReferenceAlias Property RefAlias Auto

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

 

Utility.Wait(0.1)

ObjectReference MyObjectRef = Game.GetPlayer().DropObject(MyObject)

RefAlias.ForceRefTo(MyObjectRef)

Game.GetPlayer().AddItem(MyObjectRef, abSilent = True)

A1TQCraft1.SetObjectivedisplayed(10)

A1TQCraft1.SetStage(20)

EndEvent

Quest Property A1TQCraft1 Auto

 

 

With this code you can force the alias of a note if you ad the property to the quest script that you can drop after the quest.

 

alias_Note.ForceRefTo(Game.GetPlayer().PlaceAtMe(Note))
(WICourier as WICourierScript).addAliasToContainer(alias_Note)
Edited by Masterofnet
Link to comment
Share on other sites

The item will not drop out of inventory.

 

Alias_TheArmor.Clear()

 

Is there a reason we could not force the Alias in the Stage?

 

 

With this code you can force the alias of a note if you ad the property to the quest script that you can drop after the quest.

 

alias_Note.ForceRefTo(Game.GetPlayer().PlaceAtMe(Note))
(WICourier as WICourierScript).addAliasToContainer(alias_Note)
The note is an alias and it able to be dropped after the quest ends.
Edited by Masterofnet
Link to comment
Share on other sites

Is it something the player shouldn't have access to later? Something like Meridia's Beacon? If so, then use:

Game.GetPlayer().RemoveItem(Alias_TheArmor, 1) 

Or if that gives you an error, try:

Game.GetPlayer().RemoveItem(Alias_TheArmor.GetRef(), 1)

They're guesses, though. I don't know why Clear() wouldn't work.

Link to comment
Share on other sites

Its a weapon or piece or armor that is crafted and used in a specific quest against a specific opponent. After the quest it should be treated like any quest item and discarded if the player chooses.

 

Did you try to clear the alias and see if you could drop the item? I could be doing something wrong.

 

Is there a reason we can not try forcing the alas in the Stage?

Edited by Masterofnet
Link to comment
Share on other sites

I'm a bit confused. Did you actually stop the quest at the end, or just mark it as finished? Stopping the quest really should empty all of the aliases. I think you should try that again. Just, at the last step in the last stage, put in Stop(). Or if that gives you an error, perhaps GetOwningQuest().Stop().

 

If that doesn't work (and it really should), then I'll get it working from here and let you know. I'll probably end up using ForceRefTo(Something_Innocuous).

Link to comment
Share on other sites

  • Recently Browsing   0 members

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