After long nights of debugging and trying everything. I found the solution.
It was a Dynamic Text Material I was using so I deleted it and now I don’t get the network connection lost error.
I don’t know if it was some function on the material or me trying to access the material with verse.
This is the code I used to access the material
CharToIndex : [char]int = map{
'0' => 0,
'1' => 1,
'2' => 2,
'3' => 3,
'4' => 4,
'5' => 5,
'6' => 6,
'7' => 7,
'8' => 8,
'9' => 9,
'A' => 10,
'B' => 11,
'C' => 12,
'D' => 13,
'E' => 14,
'F' => 15,
'G' => 16,
'H' => 17,
'I' => 18,
'J' => 19,
'K' => 20,
'L' => 21,
'M' => 22,
'N' => 23,
'O' => 24,
'P' => 25,
'Q' => 26,
'R' => 27,
'S' => 28,
'T' => 29,
'U' => 30,
'V' => 31,
'W' => 32,
'X' => 33,
'Y' => 34,
'Z' => 35,
'$' => 38,
',' => 67,
' ' => 68,
'.' => 63
}
UpdateBaseMaterial(Number: int, Lock: logic):void=
BaseMaterial : DTDM.dtmat2 = DTDM.dtmat2{}
if(Lock = true):
Indices := StringToIndices("Lock")
for (Index -> SlotIndex : Indices):
DigitFloat := SlotIndex * 1.0
if(Index = 0):
set BaseMaterial.slot_index_01 = DigitFloat
if(Index = 1):
set BaseMaterial.slot_index_02 = DigitFloat
if(Index = 2):
set BaseMaterial.slot_index_03 = DigitFloat
if(Index = 3):
set BaseMaterial.slot_index_04 = DigitFloat
else:
var BigNumberFloat : float = 1.0 * Number
BigNumber := big_number{Value := BigNumberFloat} #function I have for reducing big numbers to K, M, B, T and so on (this WASNT the problem as I removed it earlier)
var BigNumberString : string = BigNumber_FormatDisplay(BigNumber)
Indices := StringToIndices(BigNumberString)
for (Index -> SlotIndex : Indices):
DigitFloat := SlotIndex * 1.0
if(Number < 10):
set BaseMaterial.slot_index_02 = 68.0
set BaseMaterial.slot_index_03 = 28.0
set BaseMaterial.slot_index_04 = 68.0
if(Index = 0):
set BaseMaterial.slot_index_01 = DigitFloat
set BaseMaterial.slot_index_03 = 28.0
set BaseMaterial.slot_index_04 = 68.0
if(Index = 1):
set BaseMaterial.slot_index_02 = DigitFloat
set BaseMaterial.slot_index_03 = 28.0
set BaseMaterial.slot_index_04 = 68.0
BaseText.SetMaterial(BaseMaterial, ?Index := 0)
I hope someone will find this helpful because I was lost for a lot of days