Aller au contenu

Photo

[{SOLVED] Subtract money during conversation


2 réponses à ce sujet

#1
gamedever

gamedever
  • Members
  • 4 messages
 Simple question: How can I subtract an amount of money from the player during (or after) a conversation like done in The Pearl? And how can I check if the player doesn't have enough money and say so in the conversation?

Modifié par gamedever, 30 mars 2010 - 05:03 .


#2
DavidSims

DavidSims
  • BioWare Employees
  • 196 messages
To do this, you'll have to create some main and defined flags. If you don't know how to do this, you may want to look for a tutorial. I'll cover it at a high level here.

Make a plot, or use one you've already got for your quest. Make a main flag and name it something appropriate, like MY_QUEST_TAKE_GOLD. In the plot script, add that flag as a case and within the case, use UT_MoneyTakeFromObject(GetHero(), 0, 0, 10). This will subtract 10 gold, so substitute however much you want. The first number is copper, the second silver, the third gold.

For the condition, make a defined flag, something like MY_QUEST_CHECK_GOLD. Add it as a case in the bottom half of the script, where the conditions go. In it, use nResult = UT_MoneyCheck(GetHero, 0, 0, 10). This will return true only if the player has 10 gold. Again, adjust to however much you want to check for.

Once you’ve got the flags, attach them to the conversation. On the line where the player offers to give the money, add the defined flag as the condition. On the same line, or some line after it if the player can back out, add the main flag as an action.

Modifié par DavidSims, 30 mars 2010 - 03:16 .


#3
DavidSims

DavidSims
  • BioWare Employees
  • 196 messages
Sorry, I've edited my post. The taking gold should be a main flag, as you pointed out.