Frictional Games Forum (read-only)
Anyone need help? - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Anyone need help? (/thread-7825.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22


RE: Anyone need help? - xtron - 05-22-2011

(05-22-2011, 07:33 PM)Kyle Wrote: What is the name of the key that you want to be interacted with which then causes the monster to spawn?

What is the name of the monster that will spawn?

the key: keyhall2
monster name: monster_key_keeper1

thanks for helping me out Smile


RE: Anyone need help? - Kyle - 05-22-2011

Here you go. Smile

Code:
////////////////////////////
// Run first time starting map
void OnStart()
//The key "Hall2" is needed to unlock the room called "Hall2" and plays the unlock_door sound.
{
    SetEntityPlayerInteractCallback("keyhall2", "monsterspawn", true);
    AddUseItemCallback("", "keyhall2", "room_hall2", "UsedKeyOnDoor", true);
    AddUseItemCallback("", "key_office", "room_office", "UsedKeyOnDoor2", true);
    AddUseItemCallback("", "key_prison", "door_prison", "UsedKeyOnDoor3", true);
    AddEnemyPatrolNode("monster_key_keeper1", "PosNodeArea_1", 0.0f, "IdleExtra3");
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("room_hall2", false, true);
    PlaySoundAtEntity("", "unlock_door", "room_hall2", 0, false);
    RemoveItem("keyhall2");
}

void UsedKeyOnDoor2(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("room_office", false, true);
    PlaySoundAtEntity("", "unlock_door", "room_office", 0, false);
    RemoveItem("key_office");
}

void UsedKeyOnDoor3(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("door_prison", false, true);
    PlaySoundAtEntity("", "unlock_door", "door_prison", 0, false);
    RemoveItem("key_prison");
}

void TriggerSanityDamageLook(string &in asEntity, int alState)
{
    PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);
    GiveSanityDamage(60.0f, true);
    PlayMusic("05_event_steps.ogg", false, 80, 0, 10, false);
    SetMessage("Inventory","SH*T!",0);
}

void monsterspawn(string &in asEntity)
{
    SetEntityActive("monster_key_keeper1", true);
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}



RE: Anyone need help? - xtron - 05-22-2011

(05-22-2011, 07:37 PM)Kyle Wrote: Here you go. Smile

Code:
////////////////////////////
// Run first time starting map
void OnStart()
//The key "Hall2" is needed to unlock the room called "Hall2" and plays the unlock_door sound.
{
    SetEntityPlayerInteractCallback("keyhall2", "monsterspawn", true);
    AddUseItemCallback("", "keyhall2", "room_hall2", "UsedKeyOnDoor", true);
    AddUseItemCallback("", "key_office", "room_office", "UsedKeyOnDoor2", true);
    AddUseItemCallback("", "key_prison", "door_prison", "UsedKeyOnDoor3", true);
    AddEnemyPatrolNode("monster_key_keeper1", "PosNodeArea_1", 0.0f, "IdleExtra3");
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("room_hall2", false, true);
    PlaySoundAtEntity("", "unlock_door", "room_hall2", 0, false);
    RemoveItem("keyhall2");
}

void UsedKeyOnDoor2(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("room_office", false, true);
    PlaySoundAtEntity("", "unlock_door", "room_office", 0, false);
    RemoveItem("key_office");
}

void UsedKeyOnDoor3(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("door_prison", false, true);
    PlaySoundAtEntity("", "unlock_door", "door_prison", 0, false);
    RemoveItem("key_prison");
}

void TriggerSanityDamageLook(string &in asEntity, int alState)
{
    PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);
    GiveSanityDamage(60.0f, true);
    PlayMusic("05_event_steps.ogg", false, 80, 0, 10, false);
    SetMessage("Inventory","SH*T!",0);
}

void monsterspawn(string &in asEntity)
{
    SetEntityActive("monster_key_keeper1", true);
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}


Thanks man! ^^.

Btw how do i do so he walks from the spawn point to another point?

I already got a Patrolnode but it does'nt work :O.


RE: Anyone need help? - Kyle - 05-22-2011

Actually, you don't put it inside the void OnStart()

You should put it into the function in which the monster is spawned.

Also, I don't think you should have some animation for the monster in the patrol node.

So remove the AddEnemyPatrolNode that's in your void OnStart() and then make the function look like this:

Code:
void monsterspawn(string &in asEntity)
{
     SetEntityActive("monster_key_keeper1", true);
     AddEnemyPatrolNode("monster_key_keeper1", "PosNodeArea_1", 0.0f, "");
}



RE: Anyone need help? - xtron - 05-22-2011

(05-22-2011, 07:44 PM)Kyle Wrote: Actually, you don't put it inside the void OnStart()

You should put it into the function in which the monster is spawned.

Also, I don't think you should have some animation for the monster in the patrol node.

So remove the AddEnemyPatrolNode that's in your void OnStart() and then make the function look like this:

Code:
void monsterspawn(string &in asEntity)
{
     SetEntityActive("monster_key_keeper1", true);
     AddEnemyPatrolNode("monster_key_keeper1", "PosNodeArea_1", 0.0f, "");
}

And if I want more than 1 place to patrol i just add more nodes?..like

Code:
void monsterspawn(string &in asEntity)
{
     SetEntityActive("monster_key_keeper1", true);
     AddEnemyPatrolNode("monster_key_keeper1", "PosNodeArea_1", 0.0f, "");
     AddEnemyPatrolNode("monster_key_keeper1", "PosNodeArea_2", 0.0f, "");
     AddEnemyPatrolNode("monster_key_keeper1", "PosNodeArea_3", 0.0f, "");
}

etc...

?


RE: Anyone need help? - Kyle - 05-22-2011

Yes, that is exactly how you do it. ^.^


RE: Anyone need help? - xtron - 05-22-2011

Thanks for helping but the patroling does'nt work :S


RE: Anyone need help? - Kyle - 05-22-2011

(05-22-2011, 07:54 PM)xtron Wrote: Thanks for helping but the patroling does'nt work :S

It doesn't patrol. It goes from where it spawns to point A then to point B and then disappears when the player isn't looking.


RE: Anyone need help? - xtron - 05-22-2011

(05-22-2011, 08:03 PM)Kyle Wrote:
(05-22-2011, 07:54 PM)xtron Wrote: Thanks for helping but the patroling does'nt work :S

It doesn't patrol. It goes from where it spawns to point A then to point B and then disappears when the player isn't looking.

The problem is that the monster aint walking to point B.


RE: Anyone need help? - Kyle - 05-22-2011

Did you name it correctly? Check and make sure that the PathNode is called what you want it to be called.