Need Help - Equipping stuff on NPCs and more

Post » Sat May 28, 2011 2:16 pm

Hello everyone :)

First off let me warn you all that I'm extremely new (like, within a few days) to TESCS. I have been reading Wikis and tutorials and trying to get through the Morrowind Scripting for Dummies document, to get an idea of what I need to do for what I want to happen. It's been really helpful, all of the resources I've found online, and searching through the forums here have helped me a lot. But I've gotten to the point where I'm so frustrated at not being able to figure out what to do that I think I need to ask someone else's help. So I apologize for my noob-ishness. XD Now here's the situation...

I have this cave, it's very dark in there, and I have a non-hostile NPC in there. I've gotten her to say specific things I want (GREETING*, other topics), but I don't want her to open up and talk about her situation until the Player does something for her. I want the Player to have a Torch removed from their inventory, placed into the inventory of the NPC, and then equipped straight away. Only after she has the torch do I want her to open up and allow the player to access other Topics.

It sounds so simple, but I'm just not sure how to go around doing it, and while the tutorials and wiki information has been really helpful, something just isn't clicking in my head. So yeah... If someone has any ideas, that would be wonderful. Or if anyone knows any good NPC tutorials that dive deeper than the ones I found on the TESCS Wiki, that would be even better. Thank you very much! :D
User avatar
Alex Blacke
 
Posts: 3460
Joined: Sun Feb 18, 2007 10:46 pm

Post » Sat May 28, 2011 1:40 pm

Ok, you need to be more specific. What do you want to trigger the torch removal? A line of dialogue?

ASSUMING that's what you want, it's fairly simple.

Firstly, within your line of dialogue triggering this, you need to make a conditional to see if the player has a torch.

Under your topic, have two possible lines of dialogue. Make the NPC say something like "gimme that torch" when the player has at least one torch, or "come back with a torch noob" if the player doesn't. In addition to the GetIsID condition for your NPC, add the following conditions:

For your dialogue taking the torch:
Player.GetitemCount Torch01 >= 1

For your dialogue telling the player to find a torch:
Player.GetitemCount Torch01 == 0

Now, under the result script of the dialogue when the player HAS the torch, simply do the following:

YourNPCREF.additem Torch01 1
YourNPCREF.equipitem Torch01
Player.Removeitem Torch01 1

And for your NPC's other topics to only say when the player has given them the torch, just use:

YourNPCREF.GetItemCount Torch01 == 1

These conditionals are set up the way they would look in a script, but for the dialogue you have to use the drop down conditionals.
User avatar
Mel E
 
Posts: 3354
Joined: Mon Apr 09, 2007 11:23 pm

Post » Sat May 28, 2011 8:17 am

Ohhh thank you so much! That's exactly what I needed! :D
User avatar
Ludivine Dupuy
 
Posts: 3418
Joined: Tue Mar 27, 2007 6:51 pm


Return to IV - Oblivion