Script not fully working - set global if...

Post » Tue May 07, 2013 4:01 am

I have a setup for brawling where if you win I want the wager/winnings to go down, to prevent abuse for lots of money but still allow bigger winnings initially. And if you lose the wager/winnings go up, to help compensate and encourage the player to keep trying. However no matter whether I lose or win, the wager global is never changed. Everything else works, the player is rewarded the initial 200 gold (From an initial 100 gold wager), but the actual number never changes for future brawls. Here's the script:

Int property OpponentCon AutoGlobalVariable Property FSBrawlWager AutoMiscObject Property Gold001 AutoQuest Property FalskaarUniqueDialogue Auto;Pay the player the proper amount based on the global for payment, then alter the global appropriatelyFunction RewardPlayer(int iWonBrawl = 1)   If iWonBrawl == 0 ; player has lost the brawl, increase wager and potential winnings      Int WagerCost = (FSBrawlWager.GetValueInt())         If WagerCost < 200 ; wager tops out at 200 gold            Int iLower = (WagerCost + 25)               FSBrawlWager.SetValueInt(iLower)               FalskaarUniqueDialogue.UpdateCurrentInstanceGlobal(FSBrawlWager)         EndIf   ElseIf iWonBrawl == 1 ; player has won brawl, reward and reduce potential winnings      Int WagerWinnings = (FSBrawlWager.GetValueInt())         Game.GetPlayer().AddItem(Gold001, (WagerWinnings*2))         If WagerWinnings > 25 ; wager bottoms out at 25 gold             Int iRaise = (WagerWinnings - 25)                FSBrawlWager.SetValueInt(iRaise)                FalskaarUniqueDialogue.UpdateCurrentInstanceGlobal(FSBrawlWager)         EndIf   EndIfEndFunction

Does anyone see anything wrong? As far as I can tell, everything in the script except the SetValue on the global works just fine, but that part does not work.

Thanks for any input,

AJV

EDIT: Edited the script so it's legible. :P

User avatar
Rinceoir
 
Posts: 3407
Joined: Thu Jun 29, 2006 1:54 am

Return to V - Skyrim