Frictional Games Forum (read-only)
What's wrong with this script? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: What's wrong with this script? (/thread-7529.html)



What's wrong with this script? - D3AD UPR1S1NG - 04-21-2011

I need help fixing this script?

void OnStart()
{
PlayMusic("02_amb_safe.ogg", true, 100.0, 0.0, 1, true);
Checkpoint("Check01", "PlayerStartArea_2", "Check01", "DeathHint", "DeathHint01",);
}
void Check01(string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);
{
RemoveItem(Lantern);
}

The error is } unexpected token


RE: What's wrong with this script? - jens - 04-21-2011

There is a ; after the ) in the Check01 line which should not be there. There is a , before the ) that should not be there on the CheckPoint line. There must also be "" surrounding the Lantern in RemoveItem();

The whole Check01 will not work as there is no such thing, but what you want to do is probably:

void OnStart()
{
PlayMusic("02_amb_safe.ogg", true, 100.0, 0.0, 1, true);
Checkpoint("Check01", "PlayerStartArea_2", "Check01", "DeathHint", "DeathHint01");
}

void Check01(string &in asName, int alCount);
{
RemoveItem("Lantern");
AddDebugMessage("Checkpoint callback occurred!", false);
}


RE: What's wrong with this script? - D3AD UPR1S1NG - 04-21-2011

(04-21-2011, 07:40 AM)jens Wrote: There is a ; after the ) in the Check01 line which should not be there. There is a , before the ) that should not be there on the CheckPoint line. There must also be "" surrounding the Lantern in RemoveItem();

The whole Check01 will not work as there is no such thing, but what you want to do is probably:

void OnStart()
{
PlayMusic("02_amb_safe.ogg", true, 100.0, 0.0, 1, true);
Checkpoint("Check01", "PlayerStartArea_2", "Check01", "DeathHint", "DeathHint01");
}

void Check01(string &in asName, int alCount);
{
RemoveItem("Lantern");
AddDebugMessage("Checkpoint callback occurred!", false);
}

Thanks Big Grin although it's still coming up with an error is this right?

void OnStart()
{
PlayMusic("02_amb_safe.ogg", true, 100.0, 0.0, 1, true);
Checkpoint("Check01", "PlayerStartArea_2", "Check01", "DeathHint", "DeathHint01");
}

void Check01(string &in asName, int alCount);
{
RemoveItem("Lantern");
AddDebugMessage("Checkpoint callback occurred!", false);

Do you have to place somethin besides a start area in the editor?
}


RE: What's wrong with this script? - MrBigzy - 04-21-2011

He accidentally left in the ; when he copied your script. Put:

void Check01(string &in asName, int alCount)

As opposed to the:

void Check01(string &in asName, int alCount);

with the ; on the end. It's not supposed to be there.


RE: What's wrong with this script? - D3AD UPR1S1NG - 04-21-2011

(04-21-2011, 02:23 PM)MrBigzy Wrote: He accidentally left in the ; when he copied your script. Put:

void Check01(string &in asName, int alCount)

As opposed to the:

void Check01(string &in asName, int alCount);

with the ; on the end. It's not supposed to be there.

Yeah thanks Big Grin that got rid of the error but now I have 2 new ones saying Compiling void OnStart () and no matching signatures to checkpoint(string@&, - and repeat string@& 5 times any suggestions?
(04-21-2011, 04:46 PM)D3AD UPR1S1NG Wrote:
(04-21-2011, 02:23 PM)MrBigzy Wrote: He accidentally left in the ; when he copied your script. Put:

void Check01(string &in asName, int alCount)

As opposed to the:

void Check01(string &in asName, int alCount);

with the ; on the end. It's not supposed to be there.

Yeah thanks Big Grin that got rid of the error but now I have 2 new ones saying Compiling void OnStart () and no matching signatures to checkpoint(string@&, - and repeat string@& 5 times any suggestions?



RE: What's wrong with this script? - MrBigzy - 04-21-2011

It has to be CheckPoint, not Checkpoint.


RE: What's wrong with this script? - D3AD UPR1S1NG - 04-21-2011

(04-21-2011, 05:18 PM)MrBigzy Wrote: It has to be CheckPoint, not Checkpoint.

THANK YOU Big Grin