Exchange money for objects with a limit

So, I want to make an “Text appears when…” script that if you don’t have enough money you can’t select the conversation entry.

Any way to do that??

I assume there is a dialogue like that:

Merchant: “<do you want to buy this extra magical longsword for 1000 gold only?”

PC’s answer options:

  • “Yes”
  • “No, maybe later”

The “yes” gets a script in “Text appears when”

int StartingConditional()
  return (GetGold(GetPCSpeaker()) > 999);

leaves the little something to do the exchange :slight_smile:

If you look at the conversations section of The Guide to Building Volume I – The Aurora Toolset Manual, you will see how to use the built-in scripting wizard which will help you (by automatically generating the script for you) for future problems of this type. Another good source of information is Just The FAQs, ma’am, which contains Frequently Asked Questions with Answers and a list of built-in text appears when functions of this type. There is also the very useful LS-TK Script Generator (Lilac Soul’s Script Generator, updated for NWN 1.69). For more tutorials see this pinned thread - The Starting Point - module building tutorials for beginners - and where to find them.



He also should insert the same check in the NPC’s answer, to prevent the player from exploiting a bug where the PC can simply drop all the GP to the ground after they start the conversation.

1 Like

Of course, but we didn’t talk about the exchange … yet.

1 Like

Thanks, this worked perfectly for what I need!!