Modifié par gamedever, 30 mars 2010 - 05:03 .
[{SOLVED] Subtract money during conversation
Débuté par
gamedever
, mars 29 2010 01:11
#1
Posté 29 mars 2010 - 01:11
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?
#2
Posté 29 mars 2010 - 04:48
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.
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
Posté 30 mars 2010 - 12:08
Thanks. I'll set that up!
#4
Posté 30 mars 2010 - 01:58
I'm still having an issue. You said make a main flag, and a defined flag, but then you tell me to make 2 defined flags. Which should be main and which should be defined?
#5
Posté 30 mars 2010 - 05:02
Never mind, I solved it. The money subtraction part I set as a main flag. All is well, for now.
#6
Posté 30 mars 2010 - 03:17
Sorry, I've edited my post. The taking gold should be a main flag, as you pointed out.





Retour en haut






