Jump to content

[LE] Quest help: Give item from inventory to NPC and equip


Recommended Posts

I'm trying to learn how to work with Skyrim quests for a mod, and want to have a quest where you retrieve an item and give it to the quest giver. Once they get the item, I want them to equip it. I couldn't think of any quests where that happens, so I thought I'd practice on "The Jagged Crown" for the Stormcloaks.

 

Using quest CW02b as an example - at stage 180 where you return the crown to Ulfric Stormcloak, I want to place the crown in his inventory and have him equip it. How would that be done in the CK?

 

I've opened the quest window by going to Character > Quest > Civil War and double-clicking CW02b. I can see on the "Quest Stages" tab that stage 180 has a little script on it that adds you to the Stormcloak faction (at least, I think that's what it's doing). I can't find where it actually removes the crown from your inventory, though.

Edited by Omegacron
Link to comment
Share on other sites

The process is as follows:

Game.GetPlayer().RemoveItem(ObjectToRemove,1,false,TargetNPC)
TargetNPC.EquipItem(ObjectToRemove)

The Jagged Crown quest uses an alias called Alias_Book for the crown object. And does not actually give the item to Ulfric or Tullius. It simply removes the object from the player inventory effectively removing it from the game. Look for: Game.GetPlayer().removeitem(Alias_Book.GetReference(), 1) on lines 245 & 572 of the full fragment script QF_MQ103B_0002610B (it is visible on the quest's script tab). Each function on said script corresponds to a fragment box somewhere in the quest, might give clues as to which fragments to look at and / or edit.

Link to comment
Share on other sites

The process is as follows:

Game.GetPlayer().RemoveItem(ObjectToRemove,1,false,TargetNPC)
TargetNPC.EquipItem(ObjectToRemove)

The Jagged Crown quest uses an alias called Alias_Book for the crown object. And does not actually give the item to Ulfric or Tullius. It simply removes the object from the player inventory effectively removing it from the game. Look for: Game.GetPlayer().removeitem(Alias_Book.GetReference(), 1) on lines 245 & 572 of the full fragment script QF_MQ103B_0002610B (it is visible on the quest's script tab). Each function on said script corresponds to a fragment box somewhere in the quest, might give clues as to which fragments to look at and / or edit.

 

So I see now in the fragment script where it's removing the crown from your inventory. Assuming Ulfric has an alias of "Ulfric", I'm thinking I can just add two lines under the existing one you quoted there in purple:

Ulfric.AddItem(Alias_Book, 1)
Ulfric.EquipItem(Alias_Book)

In theory, that would make Ulfric accept the crown, equip it, then move on to the next stage (giving you new orders). Does that sound like it would work?

Edited by Omegacron
Link to comment
Share on other sites

Better to edit the RemoveItem line so that the object is given directly to the target. No idea what happens to an alias object if its reference is removed from gameplay. You can try it, but I would be more comfortable editing the RemoveItem line.

 

Also, you might want to verify that the alias 'Alias_Book' does indeed contain a wearable object. I find it interesting that the alias name refers to a book rather than a crown. Could just be left overs from a previous variation of the quest prior to release. But better to check things out before hand than to wonder why it isn't performing how you want.

Link to comment
Share on other sites

Better to edit the RemoveItem line so that the object is given directly to the target. No idea what happens to an alias object if its reference is removed from gameplay. You can try it, but I would be more comfortable editing the RemoveItem line.

 

Also, you might want to verify that the alias 'Alias_Book' does indeed contain a wearable object. I find it interesting that the alias name refers to a book rather than a crown. Could just be left overs from a previous variation of the quest prior to release. But better to check things out before hand than to wonder why it isn't performing how you want.

I'll give it a shot tonight when I get home and let you know how it goes. Thanks!

 

UPDATE: After playing around with it for a while, I was able to get the script on stage 190 (the one after delivering the crown) to place the crown into Ulfric's inventory. I tried creating my own alias for the crown, but could never get that to work for some reason - although admittedly, I'm still a little unclear on how aliases work. At any rate, I can't get him to actually wear the crown despite it being playable and taking up the hair slot. There is an official tutorial that suggests resetting the NPC's inventory by force-equipping another item afterwards, something like a ring or necklace. I'll try that on my steward when I reach that point, since Ulfric and/or the crown may be a special case in the game.

Edited by Omegacron
Link to comment
Share on other sites

  • Recently Browsing   0 members

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