Frictional Games Forum (read-only)

Full Version: Small error with simple script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
[Image: Ad58ni8]

It seems like a simple script so what am I missing?

Spoiler below!

int recordingState = 0

void saveGame()
{
AutoSave();
}

void SaveStation(string)
{
saveGame();
{
PlaySoundAtEntity("recording 1", "CassetteRecording5.snt", "saveStation", 0, true);
saveGame();
}
}

Well, first of all, you're making 2 AutoSaves because you're calling saveGame(); twice, which you shouldn't need to anyway.

But I am pretty sure your error is the missing semi-colon on your recording state integer.

I've cleaned up your code a little. Your error also states there is an error at (96, 1), which means that, most of the time, the error is either on or slightly before line 96. Since you have only provided us around 11 lines of code, the error could have been somewhere else entirely.

PHP Code:
int recordingState 0;

void saveGame()
{
    
AutoSave();
}

void SaveStation(string &in asString)
{
    
PlaySoundAtEntity("recording 1""CassetteRecording5.snt""saveStation"0true);
    
saveGame();


I also moved this to development support before Traggey did