Frictional Games Forum (read-only)
[SCRIPT] main (22, 1): ERR : Expected ',' or ';' Please Help Guys ASAP thanks - 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 - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] main (22, 1): ERR : Expected ',' or ';' Please Help Guys ASAP thanks (/thread-23153.html)



main (22, 1): ERR : Expected ',' or ';' Please Help Guys ASAP thanks - nathanial292 - 09-14-2013

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Key_02", "castle_1", "UseKeyOnDoor", true);
}
void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door.snt", asEntity, 0, false);
RemoveItem(asItem);
}

void OnEnter()
{
AddEntityCollideCallback("Player", "AreaCollide", "EventCollide", true, 1);
AddEntityCollideCallback("Player", "AreaCollide_3", "EventCollide_2", true, 1);
}

void EventCollide(string &in asParent, string &in asChild, int alState)
void EventCollide_2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt_2", true);
SetEntityActive("grunt_3", true);
SetEntityActive("grunt_4", true);
ShowEnemyPlayerPosition("grunt_2");
ShowEnemyPlayerPosition("grunt_3");
ShowEnemyPlayerPosition("grunt_4");

SetEntityActive("grunt_1", true);
AddEnemyPatrolNode("grunt_1", "Node_1", 0.001, "");
AddEnemyPatrolNode("grunt_1", "Node_2", 0.001, "");
AddEnemyPatrolNode("grunt_1", "Node_6", 0.001, "");
AddEnemyPatrolNode("grunt_1", "Node_9", 0.001, "");
AddEnemyPatrolNode("grunt_1", "Node_11", 0.001, "");
AddEnemyPatrolNode("grunt_1", "Node_13", 0.001, "");
AddEnemyPatrolNode("grunt_1", "Node_15", 0.001, "");
AddEnemyPatrolNode("grunt_1", "Node_16", 0.001, "");
}

void OnLeave()

{

}
Please help guys fast reponse if possible any help is apprechiated ;D


RE: main (22, 1): ERR : Expected ',' or ';' Please Help Guys ASAP thanks - Daemian - 09-14-2013

Two functions, first one without body

Code:
void EventCollide(string &in asParent, string &in asChild, int alState)
void EventCollide_2(string &in asParent, string &in asChild, int alState)



RE: main (22, 1): ERR : Expected ',' or ';' Please Help Guys ASAP thanks - nathanial292 - 09-14-2013

what do u mean first one without body. sorry Im new to scripting. Smile


RE: main (22, 1): ERR : Expected ',' or ';' Please Help Guys ASAP thanks - Tomato Cat - 09-14-2013

(09-14-2013, 05:24 PM)nathanial292 Wrote: what do u mean first one without body. sorry Im new to scripting. Smile

Anything between the curly braces. -> { }

Code:
void Function1(parameters...) {

//This is a function body

}



RE: main (22, 1): ERR : Expected ',' or ';' Please Help Guys ASAP thanks - nathanial292 - 09-14-2013

Thanks guys I got it working Smile YAY!