Jump to content

Sell Items via Dialogue


Plarux

Recommended Posts

Yeah, that'd be incredibly easy to do. NV does it too. First one that comes to mind is Motor Runner with chems. But I know there's plenty more.

 

Just have a dialogue option with a condition of checking if the player has an item and how many. Then have a choice that says here are so many of the item, remove the item from the player inventory, and give them caps in exchange.

Link to comment
Share on other sites

When youre writing your NPCs dialogue, you should notice a Result Script Begin/End at the bottom. Begin runs at the beginning of the dialogue, End runs at the end.

 

Lets say you want to have the NPC pay the play 25 caps for every Scrap Metal the player has.

 

To do this, put this in either the begin or end result script:

 

int iCaps

set iCaps to ((player.getItem spareparts) * 25)

Player.removeitem spareparts (player.getitem spareparts)

Player.additem caps001 iCaps

 

This should be what youre looking for.

Link to comment
Share on other sites

@sullyvanj93 and @StealthDick thank you! I did get a chance to create a quest, but the sell ALL option script does not compile.

 

Using a similar setup as VMS07 (Vault 3 Freeform Quest), it keeps saying "missing variable" for one of my int values.

I will update this post when I have tried the method suggested by StealthDick.

 

Happy Holidays and Merry Christmas!

 

UPDATE: The method StealthDick mentioned worked! Here's the result script that compiled successfully:

 

int iCigPackCount
int iDynamiteCount


set iCigPackCount to (player.getitemcount CigarettePack)
set iDynamiteCount to (iCigPackCount)
player.removeitem CigarettePack (iCigPackCount)
player.additem WeapNVDynamite (iDynamiteCount)
Exchange rate is 1 to 1, so there is no need to multiply the itemcount by the cap value. Appreciate all of the help so far!
Edited by Plarux
Link to comment
Share on other sites

  • Recently Browsing   0 members

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