Frictional Games Forum (read-only)
Where do I put this code? [SOLVED] - 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: Where do I put this code? [SOLVED] (/thread-24747.html)



Where do I put this code? [SOLVED] - Radical Batz - 03-02-2014

I mean this makes sense, I put the spawn enemy code inside the break door code! because when you unlock the door, i want an enemy to spawn and I made the code like this! it's right, right?

Code:
void BreakDoor(string &in asParent, string &in asChild, int alState)
{
    SetEntityActive("Joint", false);
    SetEntityActive("Broken", true);

    SetSwingDoorLocked("CrowbarDoor", false, false);
    SetSwingDoorClosed("CrowbarDoor", false, false);
    SetSwingDoorDisableAutoClose("CrowbarDoor", true);

    AddPropImpulse("CrowbarDoor", 0, 0, -3, "world");

    CreateParticleSystemAtEntity("", "ps_hit_wood.ps", "AreaEffect", false);
    PlaySoundAtEntity("", "break_wood_metal", "AreaEffect", 0, false);

    GiveSanityBoostSmall();

    SetEntityActive("Dog", true);
    AddEnemyPatrolNode("Dog", "Node_1",0.001f, "");
AddEnemyPatrolNode("Dog", "Node_4",0.001f, "");
AddEnemyPatrolNode("Dog", "Node_6",0.001f, "");
AddEnemyPatrolNode("Dog", "Node_10",0.001f, "");
AddEnemyPatrolNode("Dog", "Node_15",0.001f, "");
AddEnemyPatrolNode("Dog", "Node_18",0.001f, "");
AddEnemyPatrolNode("Dog", "Node_26",0.001f, "");

    AddTimer("",0.1,"TimerPushDoor");
}

I mean it gets me an error, then where am I supposed to add the spawn enemy code, i want it to function when you unlock/break the door!

am I supposed to add something in void on start because I didn't, but I think you don't have to!

don't tell me to add void onstart() because it's already there, I just copied this part only of the code


RE: Where do I put this code? - Putmalk - 03-02-2014

What error are you receiving? What is happening vs. desired effects? Post the entire code, since just a segment doesn't help at all.


RE: Where do I put this code? [Solved] - Radical Batz - 03-02-2014

(03-02-2014, 07:53 PM)Putmalk Wrote: What error are you receiving? What is happening vs. desired effects? Post the entire code, since just a segment doesn't help at all.