10-17-2011, 05:13 PM
Hey guys, the title says it all.. the specific key for the work doesn't work and it says "Cannot use this item this way" or something when i use it on the door, and the script area are supposed to spawn monsters but when i walk on the area it doesn't work..so what's possibly wrong with the scripts ? and sorry for my too many questions
here's the HPS file:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "lolkey_1", "level_orb_room_door_1", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "DoorScare", "DoorScare", true, 1);
AddEntityCollideCallback("Player", "HorrorStart", "CollideHorrorStart", false, 1);
}
void KeyOndoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("level_orb_room_door_1", false);
PlaySoundAtEntity("", "unlock_door", "level_orb_room_door_1", 0, false);
RemoveItem("lolkey_1");
}
void DoorScare(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("TrapzDoor", true, true);
SetSwingDoorLocked("TrapzDoor", true, true);
PlaySoundAtEntity("", "Close_Door.snt", "TrapzDoor", 0.0f, true);
GiveSanityDamage(10, true);
}
void HorrorStart(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "screams", "Player", 0, false);
GiveSanityDamage(10, true);
SetEntityActive("enemy_suitor_alois_1", true);
SetEntityActive("Servant_grunt_1", true);
SetEntityActive("Servant_brute_1", true);
ShowEnemyPlayerPosition("enemy_suitor_alois_1");
}
void OnPickUp(string &in asEntity, string &in type)
{
SetEntityActive("Corpsy", true);
PlaySoundAtEntity("", "screams", "Player", 0, false);
GiveSanityDamage(10, true);
PlaySoundAtEntity("alois_notice_long", "alois_notice_long.snt", "Player", 0, false);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
here's the HPS file:
////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "lolkey_1", "level_orb_room_door_1", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "DoorScare", "DoorScare", true, 1);
AddEntityCollideCallback("Player", "HorrorStart", "CollideHorrorStart", false, 1);
}
void KeyOndoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("level_orb_room_door_1", false);
PlaySoundAtEntity("", "unlock_door", "level_orb_room_door_1", 0, false);
RemoveItem("lolkey_1");
}
void DoorScare(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("TrapzDoor", true, true);
SetSwingDoorLocked("TrapzDoor", true, true);
PlaySoundAtEntity("", "Close_Door.snt", "TrapzDoor", 0.0f, true);
GiveSanityDamage(10, true);
}
void HorrorStart(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "screams", "Player", 0, false);
GiveSanityDamage(10, true);
SetEntityActive("enemy_suitor_alois_1", true);
SetEntityActive("Servant_grunt_1", true);
SetEntityActive("Servant_brute_1", true);
ShowEnemyPlayerPosition("enemy_suitor_alois_1");
}
void OnPickUp(string &in asEntity, string &in type)
{
SetEntityActive("Corpsy", true);
PlaySoundAtEntity("", "screams", "Player", 0, false);
GiveSanityDamage(10, true);
PlaySoundAtEntity("alois_notice_long", "alois_notice_long.snt", "Player", 0, false);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}