Area Problems - house - 10-16-2010
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()
{
}
RE: FALAL ERROR: Unexpected end of line - Entih - 10-16-2010
Looks like you forgot a semicolon after 'CompleteQuest("Door02","Door02")'
If that doesn't fix it, try removing the 'END' comment. Sometimes, script and code can be sensitive to where the end of file is, so I usually leave an open line as the very last line as such files.
RE: FALAL ERROR: Unexpected end of line - house - 10-16-2010
(10-16-2010, 09:58 PM)Entih Wrote: Looks like you forgot a semicolon after 'CompleteQuest("Door02","Door02")'
If that doesn't fix it, try removing the 'END' comment. Sometimes, script and code can be sensitive to where the end of file is, so I usually leave an open line as the very last line as such files.
Hmm let be try that.
I did both of what you said. It didn't work. Just edited the code box too with what you said.
RE: FALAL ERROR: Unexpected end of line - Pandemoneus - 10-16-2010
You are still missing the semicolon.
Code: 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") <----------------------------
}
RE: FALAL ERROR: Unexpected end of line - house - 10-16-2010
(10-16-2010, 11:00 PM)Pandemoneus Wrote: You are still missing the semicolon.
Code: 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") <----------------------------
}
Oh I see. I forgot what a semicolon was. Let me try this. Edit: That didn't work either.
RE: FALAL ERROR: Unexpected end of line - Pandemoneus - 10-17-2010
Is the error message still the same?
RE: FALAL ERROR: Unexpected end of line - house - 10-17-2010
(10-17-2010, 10:40 AM)Pandemoneus Wrote: Is the error message still the same?
Yes. The error message will always be the same. Edit: Well, maybe.
RE: FALAL ERROR: Unexpected end of line - Luis - 10-17-2010
Code: void CollidePlayerTeleport()
{
TeleportPlayer("PlayerStartArea_2); <---- Closing double quote is missing
FadeOut(0);
FadeIn(20);
SetMessage("Messages", "Player_1", 5.0f);
}
RE: FALAL ERROR: Unexpected end of line - house - 10-18-2010
(10-17-2010, 06:02 PM)Luis Wrote: Code: void CollidePlayerTeleport()
{
TeleportPlayer("PlayerStartArea_2); <---- Closing double quote is missing
FadeOut(0);
FadeIn(20);
SetMessage("Messages", "Player_1", 5.0f);
}
Thanks! It works now! But I now have problems with the areas. The area to trigger the monster isn't working and the teleport areas aren't working. Any reason why? Look at the code if you have to. I really need them to work for my level. Edit: now I changed the fourm to Area Problems
RE: Area Problems - Luis - 10-18-2010
Your collide callbacks need 3 parameters:
- string &in asParent
- string &in asChild
- int alState
so for example:
void CollidePlayerTeleport()
should be:
void CollidePlayerTeleport(string &in asParent, string &in asChild, int alState)
I am not 100% sure now, but I think the hpl.log file should warn about this kind of stuff when not finding a function. So everytime you run into this sort of problems you might be able to know what's going on by looking in there.
|