I have a problem with game crashing when I play this out.
The start script is just the set up at start marker, nothing but init and main
Next script is in a big rock. This is the script for text on screen for Rank, Level Score and Total Score
Then when level is complete, player walks over a trigger zone and the players Rank is then written to a file.
Problem. When player does walk over trigger zone, file is written but then game freezes and crashes and reloads previous saved.
Running the write script with the text script not placed then the game does not crash.
So I guess that the textscore script must be causing the crash some how.
Completely stuck on this.
Hope the scripts show OK. Never used the thingy before.
The Start Script
KillCountLVL = 0
KillCountTotal = 0
Rank = "SecondLieutenant"
function kcstart_init(e)
end
function kcstart_main(e)
end
The text Score script
function paneltext_init(e)
end
function paneltext_main(e)
TextCenterOnXColor(90,86,4,KillCountTotal, ("KillCountTotal"),240,157,40 ) -- The colour for text is not rgb but green, red, blue grb.
TextCenterOnXColor(95,86,4,KillCountLVL,("KillCountLVL"),40,240,157) -- This shows Dark BLUE.
TextCenterOnXColor(92,80,4,Rank, ("Rank"),240,40,157) -- This shows GREEN.
-- Panel(86,83,94,90)
TextCenterOnXColor(90,85,3, "Total Score", 240,157,40) -- This colour is rgb
TextCenterOnXColor(96,85,3, "Level Score", 40,240,157) -- This is rgb.
TextCenterOnXColor(89,79,3, "Rank", 240,40,157) -- This shows RED
end
The write to file script
function writetodisk_init(e)
end
function writetodisk_main(e)
-- PlayerDist = GetPlayerDistance(e) -- Try this on a Barrel
-- if PlayerDist < 180 then -- Try this on a Barrel
if g_Entity[e]['plrinzone']==1 then -- Do not use on a Barrel
Prompt ( "You are in Zone." ) -- This Prompt does not show.
file = io.open("C:\\Users\\Public\\mortt\\Games\\TKEW\\EP1\\rank.txt", "w")
Rank = file:write("It does write, but game then freezes and then crashes and reloads to previous saved." .. "\n")
file:close()
else
-- ActivateIfUsed(e)
-- Destroy(e)
end
end
(Custom) Intel i7 3.3 Mhz. 16 GB fast ram. EVGA Nvidia 560 Ti 4GB. Dell US27 2560 x 1440. AOC 24 1920 x 1080. Awesome.
Next G. Card EVGA GeForce GTX 970 Superclocked ACX 2.0 Gaming 4GB GDDR5 PCIe3.0 Graphics Card.
Would Like EVGA NVIDIA GeForce GTX 1080 8GB GDDR5X PCIe3.0 Graphics Card