Frictional Games Forum (read-only)
Script error (forget it) - 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: General Discussion (https://www.frictionalgames.com/forum/forum-18.html)
+--- Thread: Script error (forget it) (/thread-7723.html)



Script error (forget it) - waqas12346 - 05-01-2011

Quote:void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Function01", true, 1);
}
void Function01(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Monster", true);
AddEnemyPatrolNode("Monster", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_15", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_16", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_17", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_18", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_19", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_20", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_21", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_22", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_23", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_25", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_26", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_27", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_28", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_29", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_30", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_31", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_32", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_33", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_34", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_35", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_36", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_37", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_38", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_39", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_40", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_41", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_42", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_43", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_44", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_45", 0, "");
}

{
AddUseItemCallback("", "key_tower_1", "castle_arched01_7", "KeyOnDoor", true);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "mansion_1", 0.0f, true);
}

main (55,1) : ERR : Unexpected token '{''
AngryAngryAngryAngry


RE: Script error (forget it) - gandalf91 - 05-01-2011

Is the use item callback meant to be created on start or as part of the monster function? If On Start, remove the surrounding brackets {} and move it into the onstart blocks under AddEntityCollideCallback. If it's part of the monster function, removes the } after the last enemy patrol node and the { before the callback. Wink


RE: Script error (forget it) - Roenlond - 05-01-2011

(05-01-2011, 10:29 AM)waqas12346 Wrote:
Quote:void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Function01", true, 1);
}
void Function01(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Monster", true);
AddEnemyPatrolNode("Monster", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_15", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_16", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_17", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_18", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_19", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_20", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_21", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_22", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_23", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_25", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_26", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_27", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_28", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_29", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_30", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_31", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_32", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_33", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_34", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_35", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_36", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_37", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_38", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_39", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_40", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_41", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_42", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_43", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_44", 0, "");
AddEnemyPatrolNode("Monster", "PathNodeArea_45", 0, "");
}

{
AddUseItemCallback("", "key_tower_1", "castle_arched01_7", "KeyOnDoor", true);
}


void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "mansion_1", 0.0f, true);
}

main (55,1) : ERR : Unexpected token '{''
AngryAngryAngryAngry

The bold part has no function and should therefore not have any {}'s. I would remove the brackets and move it up inside the OnStart function.


RE: Script error (forget it) - Kyle - 05-02-2011

I feel like I've seen some script almost exactly like this a while ago... oh well. :/