10-16-2010, 09:49 PM
Something wrong with my areas. They won't do what they are supposed to do. :( I really need them to do what they do. Can anyone find out why they won't work? The ones that don't work are a area that triggers a monster and the area that triggers the player to teleport. Theres two areas that teleport you. Those are the only ones not working. Plus, they are the only ones not working. This is whats in the .hps file of my map:
Code:
void OnStart()
{
AddUseItemCallback("UnlockDoor", "key_study_1", "mansion_1", "UsedKeyOnDoor", false);
AutoSave();
GiveHint("", "Messages", "Hint_3", 4.5f);
AddQuest("Door02", "Door02");
SetMapDisplayNameEntry("Hallway");
SetDeathHint("Messages", "Death_Hint_1");
AddQuest("Door02", "Door02");
PlayMusic("18_amb.ogg", false, 0.7f, 0, 10, false);
AddEntityCollideCallback("Player", "SlimeAreaActive_1", "CollideSlimeActive", true, 1);
AddEntityCollideCallback("Player", "Servent_Active_1", "CollideGruntActive", true, 1);
AddEntityCollideCallback("servent_grunt_1", "AreaGruntDeactivate", "CollideGruntDeactivate", true, 1);
AddEntityCollideCallback("Player", "AreaPlayerTeleport", "CollidePlayerTeleport", true, 1);
AddEntityCollideCallback("Player", "AreaPlayerTeleport_2", "CollidePlayerTeleport2", true, 1);
}
void CollideGruntDeactivate(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servent_grunt_1", false);
SetDeathHint("Messages", "Death_Hint_1");
PlayMusic("18_amb.ogg", false, 0.7f, 0, 10, false);
}
void CollidePlayerTeleport(string &in asParent, string &in asChild, int alState)
{
TeleportPlayer("PlayerStartArea_2");
FadeOut(0);
FadeIn(20);
SetMessage("Messages", "Player_1", 5.0f);
AddDebugMessage("Teleporting!", false);
}
void CollidePlayerTeleport2(string &in asParent, string &in asChild, int alState)
{
TeleportPlayer("PlayerStartArea_3");
FadeOut(0);
FadeIn(20);
AddDebugMessage("Home? NOOO!", false);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("key_study_1");
AutoSave();
PlayMusic("04_puzzle_acid.ogg", false, 0.7f, 0, 10, false);
GiveSanityBoostSmall();
CompleteQuest("Door02", "Door02");
AddDebugMessage("Key Used on door Success.", false);
}
void InteractLockedDoor(string &in asEntity)
{
SetMessage("Messages", "Door_Locked_9", 0);
PlayGuiSound("locked_door.snt", 0.8f);
AddTimer("castle_1", 1.0f, "TimerDoorMessageOnAgain");
AddDebugMessage("Stupid Door!", false);
}
void TimerDoorMessageOnAgain(string &in asTimer)
{
SetEntityPlayerInteractCallback("castle_1", "InteractLockedDoor", true);
}
void CollideSlimeActive()
{
PlaySoundAtEntity("slime", "slime/slime_create1.ogg", "Player", 0, false);
AutoSave();
}
void CollideGruntActive()
{
PlayMusic("10_event_coming.ogg", false, 1, 0.1, 10, false);
PlaySoundAtEntity("grunt","grunt/amb_idle.snt", "mansion_2", 3, false);
AddDebugMessage("MONSTER!", false);
SetPlayerSanity(40.0f);
AutoSave();
SetEntityActive("servent_grunt_1", true);
SetDeathHint("Messages", "Death_Hint_2");
ClearEnemyPatrolNodes("servent_grunt_1");
AddEnemyPatrolNode("servent_grunt_1", "PathNodeArea_21", 5, "");
AddEnemyPatrolNode("servent_grunt_1", "PathNodeArea_32", 1, "");
AddEnemyPatrolNode("servent_grunt_1", "PathNodeArea_35", 1, "");
AddEnemyPatrolNode("servent_grunt_1", "PathNodeArea_41", 2, "");
AddEnemyPatrolNode("servent_grunt_1", "PathNodeArea_40", 4, "");
AddEnemyPatrolNode("servent_grunt_1", "PathNodeArea_50", 1, "");
AddEnemyPatrolNode("servent_grunt_1", "PathNodeArea_54", 1, "");
AddEnemyPatrolNode("servent_grunt_1", "PathNodeArea_56", 0, "");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
SetupLoadScreen("LoadingText", "2_level_loading", 5, "game_loading_alexander.jpg");
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}