The error is from the Return(TableResult) statement at the end of the Sub.
This is the complete text of the error. I am assuming that the problem is because there are commas in the string?
Does anyone know how to fix this error?
Thank you in advance!
java.lang.NumberFormatException: For input string: "NPC CONTINUES +2: The NPC will continue their current Action, or take it to the next level, whichever makes the most sense. Apply a +2 adjustment to their Disposition Score, representing a possible shift in their current attitude. If the NPC has not acted yet in this Scene, then treat the result as a Theme Action +2."
This is the complete text of the error. I am assuming that the problem is because there are commas in the string?
Does anyone know how to fix this error?
Thank you in advance!
java.lang.NumberFormatException: For input string: "NPC CONTINUES +2: The NPC will continue their current Action, or take it to the next level, whichever makes the most sense. Apply a +2 adjustment to their Disposition Score, representing a possible shift in their current attitude. If the NPC has not acted yet in this Scene, then treat the result as a Theme Action +2."
Offending Sub!:
Sub GetTableResult(ResultText As String, TableNum As Short, DiceRolled As Short) As String
LogColor("GetTableResult Sub started", Colors.Black)
Private TableLine As String
Private TextReader1 As TextReader
Private A As Short
Private TableResult As String
Private ExitFlag As Boolean = False
Private TableName As String
For Each TempTableDetails As TableDetails In TableDetailsList
If TempTableDetails.TableNum = TableNum Then
TableName = TempTableDetails.TableName2
ExitFlag = True
Select TempTableDetails.ComplexTables
Case "SS"
'Load the Selected Table and get result from it.
TextReader1.Initialize(File.OpenInput(TableDir, "Table " & TableNum & ".txt"))
TableLine = TextReader1.ReadLine
'Find the highest value in the table by getting the first number from the table. That is the highest.
A = TableLine.SubString2(0,TableLine.IndexOf(".")) 'Limit = the last number like if you want from 0 to 100 then limit will be 100
'Find the correct result in the table. This is set up to handle results that are a range or individual numbers for each line in the table.
Do While TableLine <> Null
If A <= DiceRolled Then
TableResult = TableLine.SubString2(TableLine.IndexOf(".") + 1,TableLine.Length)
'LogColor(TableName(Table)& " Result: " & Result, Colors.Blue)
Exit
End If
TableLine = TextReader1.ReadLine
A = TableLine.SubString2(0,TableLine.IndexOf(".")) 'Limit = the last number like if you want from 0 to 100 then limit will be 100
Loop
TextReader1.Close
Case "CS4"
'**This and other complex tables have yet to be figured out.
End Select
End If
DisplayTableResults(TableNum, TableName, DiceRolled, TableResult)
If ExitFlag = True Then Exit
Next
For Each TempTableDetails As TableDetails In TableDetailsList
If TempTableDetails.TableNum = TableNum Then
TableName = TempTableDetails.TableName2
Exit
End If
Next
RecordTableResults(ResultText, TableNum, TableName, DiceRolled, TableResult)
LogColor("GetTableResult Sub done", Colors.Black)
Return(TableResult)
End Sub
Last edited: