I'm working on a suikoden-inspired dice cup game. However, I'm running into a problem getting the house to roll.
I have 3 common events: Rolling the dice, Evaluating, and Scoring. Rolling the dice works fine, but when going through this event, the Evaluating, it fails when it's the house's turn to roll. And it skips the Scoring event entirely as a result.
I'm happy to provide any answers, but I have been staring at this for a while and don't see the issue.
Thanks for any help!
I have 3 common events: Rolling the dice, Evaluating, and Scoring. Rolling the dice works fine, but when going through this event, the Evaluating, it fails when it's the house's turn to roll. And it skips the Scoring event entirely as a result.
I'm happy to provide any answers, but I have been staring at this for a while and don't see the issue.
Code:
◆Comment:---Sorting Dice---
◆Control Variables:#0027 Temp = 0
◆If:Die 1 > Die 2
◆Control Variables:#0027 Temp = Die 1
◆Control Variables:#0021 Die 1 = Die 2
◆Control Variables:#0022 Die 2 = Temp
◆
:End
◆If:Die 2 > Die 3
◆Control Variables:#0027 Temp = Die 2
◆Control Variables:#0022 Die 2 = Die 3
◆Control Variables:#0023 Die 3 = Temp
◆
:End
◆If:Die 1 > Die 2
◆Control Variables:#0027 Temp = Die 1
◆Control Variables:#0021 Die 1 = Die 2
◆Control Variables:#0022 Die 2 = Temp
◆
:End
◆Comment:---Score Calculation---
◆Control Variables:#0027 Temp = 0
◆Comment:---Triples---
◆If:Script:($gameVariables.value(21) === $gameVariables.value(22)) && ($gameVariables.value(22) === $gameVariables.value(23))
◆Control Variables:#0027 Temp = 100 + $gameVariables.value(21)
◆Jump to Label:ScoreDone
◆
:End
◆Comment:---1-2-3(Auto Loss)---
◆If:Script:[1,2,3].toString() === [$gameVariables.value(21),$gameVariables.value(22),$gameVariables.value(23)].sort().toString()
◆Control Variables:#0027 Temp = -1
◆Jump to Label:ScoreDone
◆
:End
◆Comment:---4-5-6(Auto Win)---
◆If:Script:[4,5,6].toString() === [$gameVariables.value(21),$gameVariables.value(22),$gameVariables.value(23)].sort().toString()
◆Control Variables:#0027 Temp = 200
◆Jump to Label:ScoreDone
◆
:End
◆Comment:---Check pairs: (x, x, y) → score = y---
◆If:Script:$gameVariables.value(21) === $gameVariables.value(22)
◆Control Variables:#0027 Temp = $gameVariables.value(23)
◆Text:None, Window, Bottom
: :Score of \v[23]
◆Jump to Label:ScoreDone
◆
:Else
◆If:Script:$gameVariables.value(23) === $gameVariables.value(22)
◆Control Variables:#0027 Temp = $gameVariables.value(21)
◆Text:None, Window, Bottom
: :Score of \v[21]
◆Jump to Label:ScoreDone
◆
:Else
◆If:Script:$gameVariables.value(23) === $gameVariables.value(21)
◆Control Variables:#0027 Temp = $gameVariables.value(22)
◆Text:None, Window, Bottom
: :Score of \v[22]
◆Jump to Label:ScoreDone
◆
:Else
◆Control Variables:#0027 Temp = 0
◆Text:None, Window, Bottom
: :No score
◆Jump to Label:ScoreDone
◆
:End
◆
:End
◆
:End
◆Label:ScoreDone
◆If:House Turn is OFF
◆Comment:Player Turn
◆Control Variables:#0025 Player Score = Temp
◆Text:None, Window, Bottom
: :Player score is \v[25]
◆
:Else
◆Comment:House Turn
◆Control Variables:#0026 House Score = Temp
◆Text:None, Window, Bottom
: :House score is \v[25]
◆Common Event:Compare Results
◆
:End
◆Comment:---Re-Roll Logic---
◆If:House Turn is OFF
◆If:Roll Attempts < 2
◆Show Choices:Roll again, Keep (Window, Right, #1, #2)
:When Roll again
◆Control Variables:#0024 Roll Attempts += 1
◆Common Event:Roll Dice
◆
:When Keep
◆Comment:End Player Turn
◆Control Switches:#0008 House Turn = ON
◆
:End
◆
:End
◆
:End
◆If:Roll Attempts < 2
◆If:House Score = 0
◆Comment:House re-rolls bad rolls
◆Control Variables:#0024 Roll Attempts += 1
◆Common Event:Roll Dice
◆
:End
◆
:End
Thanks for any help!