Frictional Games Forum (read-only)
[SCRIPT] Collapse - 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] Collapse (/thread-11016.html)

Pages: 1 2


RE: Collapse - flamez3 - 10-28-2011

(10-28-2011, 03:16 PM)devin413 Wrote: rofl >.> i nerver make an f behind it Big Grin


it worked?


RE: Collapse - devin413 - 10-28-2011

(10-28-2011, 03:27 PM)flamez3 Wrote:
(10-28-2011, 03:16 PM)devin413 Wrote: rofl >.> i nerver make an f behind it Big Grin


it worked?
ämm yes Big Grin


RE: Collapse - Sauron The King - 10-28-2011

Thanks folks it's working now Big Grin
I have added the sound and the shaking camera.
This is how it looks now:
Code:
//////////////////////////////////////////////////
// Slaapkamer Geheime doorgang
void OnStart()
{
SetEntityConnectionStateChangeCallback("Lever_Sleepingroom", "func_shelf");
}


void func_shelf(string &in asEntity, int alState)
{
    if (alState == 1)
    {
    SetMoveObjectState("Shelf_Secret_Sleepingroom",1.0f);
    PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
          return;
    }
}
//////////////////////////////////////////////////
// Slaapkamer boel stort in
void OnEnter()
{
AddEntityCollideCallback("Player", "Collapse_Sleepingrooms", "Collidewhencollapse", true, 1);
}

void Collidewhencollapse(string &in asParent, string &in asChild, int alState)
{SetEntityActive("cave_in_1", true);
StartScreenShake(0.5, 2, 1, 2);
PlaySoundAtEntity("Cave_in", "04_rock_break.snt", "Player", 0, true);
}

If I come across another problem, I will post it right here in this topic.
Thanks for the great help and tips! Angel



RE: Collapse - devin413 - 10-28-2011

yehh ok i will be have an eye on it Big Grin


RE: Collapse - Sauron The King - 10-30-2011

Hello,

I am now a bit further. Everything will cave in correctly. Now I added a monster. The monster does its work perfectly, but now I want it to exist forever, until the player enters the hidden room. So the patroll nodes will keep looping forever. If you don't find the hidden room, you will keep having the chance you will come across the monster and it will kill you.
Here you will see the code I made.
In short, what do I want?
1) The monsters starts at "PathNodeArea_1".
2) When the monster gets at "PathNodeArea_25", he will start over at "PathNodeArea_1". nr. 25 is next to point 1, so he can walk from point 25 to 1 easily.

That's all Smile

EDIT:
I've edited it a bit, and it seems the monster now keeps following his waypoint, untill I reach the secret room.


Code:
//////////////////////////////////////////////////
// Slaapkamer Geheime doorgang
void OnStart()
{
SetEntityConnectionStateChangeCallback("Lever_Sleepingroom", "func_shelf");
}


void func_shelf(string &in asEntity, int alState)
{
    if (alState == 1)
    {
    SetMoveObjectState("Shelf_Secret_Sleepingroom",1.0f);
    PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
          return;
    }
}
//////////////////////////////////////////////////
// Slaapkamer boel stort in
void OnEnter()
{
AddEntityCollideCallback("Player", "Hallwaysleepingrooms_Monstersound", "Grunt_Sound", true, 1);
AddEntityCollideCallback("Player", "Collapse_Sleepingrooms", "Collidewhencollapse", true, 1);
AddEntityCollideCallback("Player", "Monster_sleepingrooms", "Grunt_Sleepingrooms", true, 1);
AddEntityCollideCallback("Player", "Monster_Disappear", "Monster_Fadetodust", true, 1);
} ///Deze is voor het monster///

void Collidewhencollapse(string &in asParent, string &in asChild, int alState)
{SetEntityActive("cave_in_1", true);
StartScreenShake(0.3, 2, 1, 2);
PlaySoundAtEntity("Cave_in", "04_rock_break.snt", "Player", 0, true);
PlayMusic("00_event_gallery.ogg", false, 1, 0, 9, true);
}

////////////////////////////////////////////////////
/// Monster in slaapkamer

void Grunt_Sleepingrooms(string &in asParent, string &in asChild, int alState)
{    SetEntityActive("Grunt_Sleepingrooms", true);
{for (int i = 1; i <6; i++)
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_1", 2, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_3", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_4", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_5", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_7", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_8", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_9", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_10", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_11", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_12", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_13", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_14", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_15", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_16", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_17", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_18", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_19", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_20", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_21", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_22", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_23", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_2", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_24", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_25", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_26", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_3", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_4", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_5", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_6", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_7", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_8", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_9", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_10", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_11", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_12", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_13", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_14", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_15", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_16", 0, "");
    AddEnemyPatrolNode("Grunt_Sleepingrooms", "PathNodeArea_17", 4, "");}
PlayMusic("search_grunt.ogg", true, 2, 0, 1, true);
}

////////////////////////////////////////////
///Grunt geluid begin slaapkamers

void Grunt_Sound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("Brute_Wake_up", "amb_idle_whimp.snt", "Player", 0, false);
}

////////////////////////////////////////////
///Grunt Verdwijnt

void Monster_Fadetodust(string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke("Grunt_Sleepingrooms", true);
PlayMusic("02_amb_safe.ogg", false, 1, 0, 10, true);
}





RE: Collapse - Sauron The King - 11-02-2011

I've started a new topic here:
http://www.frictionalgames.com/forum/thread-11132.html