Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Amnesia level editor setting monsters
GTalbot Offline
Junior Member

Posts: 3
Threads: 1
Joined: Jul 2011
Reputation: 0
#1
Amnesia level editor setting monsters

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()
{

}
07-17-2011, 09:22 PM
Find
MrCookieh Offline
Member

Posts: 157
Threads: 8
Joined: Jul 2011
Reputation: 0
#2
RE: Amnesia level editor setting monsters

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

put this between the {} of the OnStart(). Should work.
07-17-2011, 11:01 PM
Find
ferryadams11 Offline
Junior Member

Posts: 17
Threads: 1
Joined: Apr 2011
Reputation: 0
#3
RE: Amnesia level editor setting monsters

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
07-18-2011, 09:25 AM
Find




Users browsing this thread: 1 Guest(s)