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
Area Problems
house Offline
Member

Posts: 195
Threads: 11
Joined: Oct 2010
Reputation: 1
#1
Area Problems

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:

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

}
10-16-2010, 09:49 PM
Find
Entih Offline
Junior Member

Posts: 47
Threads: 4
Joined: Sep 2010
Reputation: 0
#2
RE: FALAL ERROR: Unexpected end of line

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.
10-16-2010, 09:58 PM
Find
house Offline
Member

Posts: 195
Threads: 11
Joined: Oct 2010
Reputation: 1
#3
RE: FALAL ERROR: Unexpected end of line

(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.
10-16-2010, 10:39 PM
Find
Pandemoneus Offline
Senior Member

Posts: 328
Threads: 2
Joined: Sep 2010
Reputation: 0
#4
RE: FALAL ERROR: Unexpected end of line

You are still missing the semicolon.

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") <----------------------------
}

10-16-2010, 11:00 PM
Find
house Offline
Member

Posts: 195
Threads: 11
Joined: Oct 2010
Reputation: 1
#5
RE: FALAL ERROR: Unexpected end of line

(10-16-2010, 11:00 PM)Pandemoneus Wrote: You are still missing the semicolon.

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. Sad
10-16-2010, 11:15 PM
Find
Pandemoneus Offline
Senior Member

Posts: 328
Threads: 2
Joined: Sep 2010
Reputation: 0
#6
RE: FALAL ERROR: Unexpected end of line

Is the error message still the same?

10-17-2010, 10:40 AM
Find
house Offline
Member

Posts: 195
Threads: 11
Joined: Oct 2010
Reputation: 1
#7
RE: FALAL ERROR: Unexpected end of line

(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.
10-17-2010, 04:31 PM
Find
Luis Offline
Frictional Games

Posts: 280
Threads: 19
Joined: Jun 2006
Reputation: 9
#8
RE: FALAL ERROR: Unexpected end of line

void CollidePlayerTeleport()
{
   TeleportPlayer("PlayerStartArea_2); <---- Closing double quote is missing
   FadeOut(0);
   FadeIn(20);
   SetMessage("Messages", "Player_1", 5.0f);
}

EOF
10-17-2010, 06:02 PM
Find
house Offline
Member

Posts: 195
Threads: 11
Joined: Oct 2010
Reputation: 1
#9
RE: FALAL ERROR: Unexpected end of line

(10-17-2010, 06:02 PM)Luis Wrote:
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
10-18-2010, 02:32 AM
Find
Luis Offline
Frictional Games

Posts: 280
Threads: 19
Joined: Jun 2006
Reputation: 9
#10
RE: Area Problems

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.

EOF
10-18-2010, 04:48 PM
Find




Users browsing this thread: 1 Guest(s)