Jump to content

How to have an NPC give the player an item?


tenth88sphere

Recommended Posts

I'm pretty sure this should be a simple question. Feel free to refer me to a tutorial if it has this info in it, my googling didn't turn anything up.

 

Basically I just want to take EXISTING dialogue, and make it so that when it is said, the NPC will give the player an item. I assume I can do this by adding a script, but wouldn't know what to put. And if it's not too complicated, letting me know how to make it only happen once would also be great.

 

Thanks

Link to comment
Share on other sites

I am afraid it is not a simple question. Or maybe it is a simple question, but implementing the answer will be hard.

 

It is a bit dangerous and dirty to modify the existing generic dialogs. The best thing would be to create a "Quest." (In CS terminology, a quest does not necessarily involve an adventure or mission to find something or do something.) Once you had the quest, you would create or use a "Topic." The easiest way would be to use the pre-existing topic GREETING. That is the line the NPC will use when first talking to you in any conversation. If you have a custom GREETING it will always be used unless conditions are placed upon it. You will not get the standard random Vanilla Oblivion greetings from that particular NPC. GREETING is great because you do not have to use the AddTopic command anywhere.

 

I just re-read your post, and realized you might be operating under a misconception about scripts. For what you are doing you probably won't need a script as such. You will work under TES CS\Quests\Topics. You will work in the "Result Script" block. On that line, you will put a command like:

 

Player.AddItem WeapIronDaggerRusty 1

 

This adds one Rusty Iron Dagger to the player's inventory.

 

So what you would need to do would be to create a quest. Something like: aaRustyDaggerQUEST (Right click the leftmost long skinny box in the Quest Window) (Quest window found by clicking the "Q" icon.)

 

Then add the Topic GREETING to it. (Right click under "Editor ID," in the long vertical box second from the left in the Quest window.)

 

Then create a new Info. Something like, "I want you to have my prized possession!" Check the box "Say Once" This way it will only be said once in the game, and only one item will be given. Add the line of code above to "Result Script."

 

Now very importantly, you must place the condition that only your NPC will say this. If you do it wrong, everyone in Cyrodiil will say it.

 

Click the "New" box to create the condition

GetIsID NPC: [Your NPC's form ID] == 1

(GetIsID is a condition function saying "execute the following if and only if the identity of the NPC is [Your NPC's Name.]" ) (== 1 means yes) (== 0 means no)

 

 

Here is the link to a tutorial that is hard to use:

 

http://cs.bethsoft.com/constwiki/index.php..._Quest_Dialogue

 

That site has a search engine so you can look for information on any of the boxes or commands or such.

 

You might find it instructive to start the CS, and open up a quest or a mod where you know an NPC gives the player an object and see how they did it.

 

Learning dialog can be very frustrating, but is so fun and useful once you have the hang of it. If you get stuck, feel free to send me a Personal Message.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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