So when I try to implement it in the code below, my program crashes. It still creates the text objects fine, and I'm able to verify that it does exist, but the call to DeleteText always crashes it.
function AgeText()//delete text that has faded out
print(ShotText.TextNum[ShotText.NextToDelete])
print(GetTextExists(ShotText.TextNum[ShotText.NextToDelete]))
if GetTextExists(ShotText.TextNum[ShotText.NextToDelete]) and ShotText.DeleteTimer[ShotText.NextToDelete] > CurTime#
DeleteText(ShotText.TextNum[ShotText.NextToDelete])
ShotText.NextToDelete = Mod(ShotText.NextToDelete+1,50)
endif
endfunction
And here's where I create it, but like I said, it's creating them fine. It's just trying to delete them that causes the crash.
ShotText.TextNum[ShotText.NextToCreate] = CreateText(Str(Shots[i].Damage))
SetTextPosition(ShotText.TextNum[ShotText.NextToCreate],GetSpriteX(Shots[i].SprNum),GetSpriteY(Shots[i].SprNum))
ShotText.DeleteTimer[ShotText.NextToCreate]=CurTime#+1
PlayTweenText(1,ShotText.TextNum[ShotText.NextToCreate],0)
ShotText.NextToCreate = Mod(ShotText.NextToCreate+1,50)
That's it so far as interactions with the text objects go. Am I missing something or doing something wrong? I was able to get the sample code on the command page to run, just can't figure out why or where it goes wrong with mine.