Loading a file ingame problem
by Dennis Lamers · in Torque Game Engine · 03/02/2018 (2:28 pm) · 0 replies
Hey all,
For the past five hours I have been trying to get this to work. It was a simple copy-paste from another game but had to change the %missionFile into other stuff. Ingame it keeps showing up an empty GuiScrollProfile list. After searching on Google a lot I have found nothing that helped me solve the problem.
Edit: I got it working for 90% now. When it loads the persistence file it does not load the persistence name correctly. Instead of the name it will load 0.persistence. Any solution to fix this?
Edit 2: Fixed!
For the past five hours I have been trying to get this to work. It was a simple copy-paste from another game but had to change the %missionFile into other stuff. Ingame it keeps showing up an empty GuiScrollProfile list. After searching on Google a lot I have found nothing that helped me solve the problem.
Edit: I got it working for 90% now. When it loads the persistence file it does not load the persistence name correctly. Instead of the name it will load 0.persistence. Any solution to fix this?
Edit 2: Fixed!
function PersistenceList::OnSelect( %this, %id, %text )
{
txtSaveLoad.setValue(%text);
//%filename = getField(PersistenceList.getRowTextById(%id), 1);
//P_image.setBitmap("fps/data/missions/Saves/" @ "*" @ ".png");
}
function BricksMenuGui::onWake(%this)
{
PersistenceList.clear();
%i = 0;
%filename = "fps/data/missions/Saves/" @ "*" @ ".persistence";
for(%file = findFirstFile(%filename);%file !$= ""; %file = findNextFile(%filename))
{
if (strStr(%file, "CVS/") == -1 && strStr(%file, "common/") == -1)
{
%string = getPersName(%file);
%toAdd = getsubstr(%string,strstr(%string,"_") +1,strlen(%string) - strstr(%string,"_"));
PersistenceList.addRow(%i++, %toAdd);
$TotalPersistenceFiles++;
}
}
PersistenceList.sort(0);
PersistenceList.scrollVisible(1);
}
function getPersName( %filename )
{
return fileBase(%filename);
}About the author
Creator of Peekarica and Blockland Classic Mod.