Frictional Games Forum (read-only)
Script Problem - 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 Problem (/thread-9082.html)



Script Problem - TimmayIsHawt - 07-11-2011

Hey guys, I need a little help on my scripts, so... I'm pretty much making a basic map (since I'm new to this) and for some reason my script won't read the triggers/areas when i walk into them. Huh

Here's the script ~
Quote://==========================================
// This runs when the map firsts starts
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_One", "enemy1", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_Two", "enemy2", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_Three", "enemy3", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_Four", "enemy4", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_Five", "enemy5", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_Six", "enemy6", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_Seven", "enemy7", true, 1);
}

void enemy1(string &in asParent, string &in asEntity)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 10, "");
}

void enemy2(string &in asParent, string &in asEntity)
{
SetEntityActive("servant_grunt_2", true);
AddEnemyPatrolNode("servant_grunt_2`", "PathNodeArea_2", 10, "");
}

void enemy3(string &in asParent, string &in asEntity)
{
SetEntityActive("servant_grunt_3", true);
AddEnemyPatrolNode("servant_grunt_3", "PathNodeArea_3", 10, "");
}

void enemy4(string &in asParent, string &in asEntity)
{
SetEntityActive("servant_grunt_6", true);
AddEnemyPatrolNode("servant_grunt_6", "PathNodeArea_3", 10, "");
}

void enemy5(string &in asParent, string &in asEntity)
{
SetEntityActive("servant_grunt_4", true);
AddEnemyPatrolNode("servant_grunt_4", "PathNodeArea_4", 10, "");
}

void enemy6(string &in asParent, string &in asEntity)
{
SetEntityActive("servant_grunt_5", true);
AddEnemyPatrolNode("servant_grunt_5", "PathNodeArea_5", 10, "");
}

void enemy7(string &in asParent, string &in asEntity)
{
SetEntityActive("servant_grunt_7", true);
SetEntityActive("servant_grunt_8", true);
SetEntityActive("servant_grunt_9", true);
SetEntityActive("servant_grunt_10", true);
SetEntityActive("servant_grunt_11", true);
SetEntityActive("servant_grunt_12", true);
SetEntityActive("servant_grunt_13", true);
SetEntityActive("servant_grunt_14", true);
SetEntityActive("servant_brute_1", true);
AddEnemyPatrolNode("servant_grunt_7", "PathNodeArea_6", 10, "");
AddEnemyPatrolNode("servant_grunt_8", "PathNodeArea_6", 10, "");
AddEnemyPatrolNode("servant_grunt_9", "PathNodeArea_6", 10, "");
AddEnemyPatrolNode("servant_grunt_10", "PathNodeArea_6", 10, "");
AddEnemyPatrolNode("servant_grunt_11", "PathNodeArea_6", 10, "");
AddEnemyPatrolNode("servant_grunt_12", "PathNodeArea_6", 10, "");
AddEnemyPatrolNode("servant_grunt_13", "PathNodeArea_6", 10, "");
AddEnemyPatrolNode("servant_grunt_14", "PathNodeArea_6", 10, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_6", 10, "");
}

Yeah, i don't know how to explain it any further due to the fact that i have no ideawhy it isn't working Confused


RE: Script Problem - Roenlond - 07-11-2011

change every occurance of
(string &in asParent, string &in asEntity)
to
(string &in asParent, string &in asChild, int alState)

and it should work.


RE: Script Problem - ferryadams11 - 07-11-2011

Haha, sorry I'm saying this but that's a bit noobish cause it is all explained very well in MrBigzy's scripting function descriptions. ;P hope to see your map soon.


RE: Script Problem - TimmayIsHawt - 07-11-2011

Yeah well, i mostly rely on youtube video's to help me. Forums are my last option if i can't figure how to work it out. I also started yesterday :O


RE: Script Problem - ferryadams11 - 07-12-2011

Ah, that so. Smile

Keep me up to date at this thread with screenshots of your map