Frictional Games Forum (read-only)
Amnesia level editor setting monsters - 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: Amnesia level editor setting monsters (/thread-9199.html)



Amnesia level editor setting monsters - GTalbot - 07-17-2011

Iv'e recently started making a custom story for amnesia and ive starting having a bit of trouble. iv'e made doors unlock with keys and i made a monster also spawn when that door was unlocked but by accident i actually wanted to be able to open the door and walk down the hall to another room and upon walking into the room a monster spawn but it wasn't working this is my .hps script im only 16 and i started learning this stuff yesterday so if its totally wrong im sorry there isnt a tutorial for me to follow.

void OnStart()

{
AddUseItemCallback("", "key", "door", "KeyOnDoor", true);
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door", false, true);
PlaySoundAtEntity("", "unlock_door", "door", 0, false);
RemoveItem("key");
}
{
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt", true);
AddEnemyPatrolNode("grunt", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_3", 4, "");
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}



RE: Amnesia level editor setting monsters - MrCookieh - 07-17-2011

AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);

put this between the {} of the OnStart(). Should work.


RE: Amnesia level editor setting monsters - ferryadams11 - 07-18-2011

Not again this kind of hps -.- sorry but I just see this too much. I'll help.

void OnStart()
{
AddUseItemCallback("", "key", "door", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door", false, true);
PlaySoundAtEntity("", "unlock_door", "door", 0, false);
RemoveItem("key");
}

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt", true);
AddEnemyPatrolNode("grunt", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("grunt", "PathNodeArea_3", 4, "");
}

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

}

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

}


Okay I'm done here Wink You're welcome.
For any further questions, add me on msn: ferry_hooligan@live.nl

Kind regards,
Ferry Adams