temnix Posted July 29, 2021 Share Posted July 29, 2021 I'm making a mechanic where characters can carry around a lot of stashed gold, hidden in an item, separate from both party gold and the creature gold stat, and recover it from the item whenever they want. Gold can be stashed in increments: 100, 200, 500, 1000 or 2000. However, when the character is hit in a fight wearing the item, there is a chance that he will lose some of the coins and get back less cash later, when he opens it up to transfer the money to the party purse. I need to take account of this loss and factor it in later. The items are not unique, there can be several of them in a character's possession and they can trade them around, so obviously I can't do it on a per-item basis or even per-character. My idea is to do it on the whole-party level. Whenever someone using this item is hit (a contingency), a global gets decreased, from zero into the negative. Later, when the item is opened up and its extraction dialogue appears, a global is set corresponding to the amount of stashed gold (100 and so on), then the AddGlobals action is used to call in the loss global and adjust the first. (There is a potential problem here that the first global may careen into the negative if too much had been knocked out, but that's not so important.) According to plan, on the heels of AddGlobals will follow GivePartyGoldGlobal, which will produce the right amount of gold. The problem is that GivePartyGoldGlobal isn't working. I'm trying it with a simple script, which takes into account the detail that the gold is supposedly taken from the script runner's gold stat. At least, the Gibberlings guide to that action so says, I don't have the impression that this is a well-verified statement. Anyway, when NPC join the party, they surrender their gold stat into the party purse, so they are all at 0. Therefore I give them a thousand in this script, then I want them to shell out that much for the party's benefit. IF True() THEN RESPONSE #1 ChangeStat(Myself,GOLD,1000,SET) SetGlobal("GOLD","GLOBAL",1000) SmallWait(1) GivePartyGoldGlobal("GOLD","GLOBAL") Wait(10) END Nothing happens. Anybody know why? I have a list of people I'm going to have to thank, by the way, in the mod thread, for having helped at some point about some topic. A hit list, so to speak. Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.