Scott Ayers
11-01-2010, 04:23 PM
Hey guys,
I've figured out how to read values from an external text file and use them to control objects.
But the problem is I can only use the last value listed in the text file.
Can anyone tell me how to target specific text entries from the text files?
Here's my text value reader code: var name = doc->GetFilename();
name->SetFullString("C:/Users/user/Desktop");
name->AddLast("values.txt");
var filename = name;
var file = new(BaseFile);
file->Open(filename, GE_READ);
var str = file->ReadString(file->GetLength());
var y = evaluate(str); //Converts string info from the file into a float value
op#ID_BASEOBJECT_REL_POSITION:VECTOR_Y = y;// Set the Y position to this value
Here's what's inside of my text file: 150;20;50;
-ScottA
I've figured out how to read values from an external text file and use them to control objects.
But the problem is I can only use the last value listed in the text file.
Can anyone tell me how to target specific text entries from the text files?
Here's my text value reader code: var name = doc->GetFilename();
name->SetFullString("C:/Users/user/Desktop");
name->AddLast("values.txt");
var filename = name;
var file = new(BaseFile);
file->Open(filename, GE_READ);
var str = file->ReadString(file->GetLength());
var y = evaluate(str); //Converts string info from the file into a float value
op#ID_BASEOBJECT_REL_POSITION:VECTOR_Y = y;// Set the Y position to this value
Here's what's inside of my text file: 150;20;50;
-ScottA
