Frictional Games Forum (read-only)
Making grunt active and patrol on key pickup - 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: Making grunt active and patrol on key pickup (/thread-13935.html)



Making grunt active and patrol on key pickup - craazyy1 - 03-12-2012

So I watched "ThisIsYourComputer"'s vid "Activate monster upon key pickup" on Youtube, and followed the instructions, but when I try to load up the map, this appears:
http://pastie.org/3574259
I'm guessing you'll need the script it's trying to run:

http://pastie.org/3574272


I just started learning this stuff, so I still don't know that much, sorry for any obvious mistakes...


RE: Making grunt active and patrol on key pickup - Strembitsky - 03-12-2012

Code:
void OnStart()
{
  SetEntityPlayerInteractCallback("key_study_1", "ActivateMonster", true);
}
void ActivateMonster(string &in item)
{
  SetEntityActive("servant_grunt_1", true);
  AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", "0", "idle");
  AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", "0", "idle");
}


void OnEnter()
{
  
}

void OnLeave()
{
  
}
try this, your code wasn't anywhere. It didn't know whether to start when you leave a map, when you enter a map, or when it simply starts.



RE: Making grunt active and patrol on key pickup - craazyy1 - 03-12-2012

Thanks for quick response, but still doesn't work. Sad
Same error, different lines,
6,3 and 7,3

Also, is there a way to run the client and not have it close everytime it fails to load. Think I saw something like that on the wiki, can't remember where.


RE: Making grunt active and patrol on key pickup - Your Computer - 03-12-2012

Strings aren't integers or floats.


RE: Making grunt active and patrol on key pickup - DaAinGame - 03-12-2012

(03-12-2012, 01:55 AM)Your Computer Wrote: Strings aren't integers or floats.

Meaning it should be like this:

void OnStart()
{
SetEntityPlayerInteractCallback("key_study_1", "ActivateMonster", true);
}

void OnEnter()
{

}

void OnLeave()
{

}

void ActivateMonster(string &in item)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "idle");
}

Or- You had AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", "0", "idle");
Should be: AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "idle");




RE: Making grunt active and patrol on key pickup - craazyy1 - 03-12-2012

Not sure what you mean Your computer, but I got it to work.
http://pastie.org/3574683

Had some things in quotation marks that weren't supposed to be in quotation marks. What I hate about scripting is that a small error, can ruin everything...

Edit: Guy above kind of ninjad me...