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
[SOLVED]No scripts work
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#1
[SOLVED]No scripts work

I have a serious problem in my newest map!
None of my scripts work! NONE!

I tried adding a debug message in void OnStart(). Nothing happens.
My map and .hps file has the same name (doublechecked)

Script:
Spoiler below!


void OnStart()
{

AddDebugMessage("SCRIPT", false);

AddEntityCollideCallback("Player", "AreaOpenDoorGrunt", "OpenDoorGrunt", true, 0);
AddEntityCollideCallback("servant_grunt_3", "AreaMonsterDisappear_1", "MonsterDisappear_1", true, 0);
AddEntityCollideCallback("Player", "AreaStopMonster", "StopMonster", false, 0);
for(int p=1;p<3;p++) AddEntityCollideCallback("saw_"+p, "AreaWoodSaw", "BuildLadder", true, 0);

AddTimer("ScareSounds_"+RandInt(1, 5), RandInt(5, 15), "ScareSounds");
AddTimer("ScareSounds_"+RandInt(1, 5), RandInt(5, 15), "ScareSounds");

}

//////////////
//SAW PUZZLE//

void InteractWoodSaw(string &in asEntity)
{
AddDebugMessage("SCRIPT", false);
SetMessage("Messages", "04_saw", 0);
AddQuest("04_NeedSaw", "04_NeedSaw");
}

void BuildLadder(string &in asParent, string &in asChild, int alState)
{
if(GetLocalVarInt("MonsterIsActive", 1);

if(asTimer == "BuildLadder_1")
{
SetEntityActive("wooden_board01_1", false);
SetEntityActive("wooden_board01_2", false);
SetEntityActive("wooden_board_pile01_2", false);
SetEntityActive("ladder_item_1", true);
FadeIn(2);
AddTimer("BuildLadder_2", 2, "BuildLadder");
return;
}

if(asTimer == "BuildLadder_2")
{
AddPlayerSanity(10);
CompleteQuest("04_NeedSaw", "Quest_04_NeedSaw_Text");
return;
}

if(asTimer == BuildLadder)
{
FadeOut(0);
PlaySoundAtEntity("", "26_saw.snt", "Player", 0, false);
AddTimer("BuildLadder_1", 5, "BuildLadder");
}
}

//SAW PUZZLE END//
//////////////////

////////////////
//SCARE SOUNDS//

void ScareSounds(string &in asTimer)
{
if(asTimer == "ScareSounds_1")
{
PlaySoundAtEntity("", "scare_male_terrified.snt", "ScareSounds_"+RandInt(1, 5), 0, false);
AddTimer("ScareSounds_"+RandInt(1, 5), 0, "ScareSounds");
}

if(asTimer == "ScareSounds_2")
{
PlaySoundAtEntity("", "scare_male_terrified.snt", "ScareSounds_"+RandInt(1, 5), 0, false);
AddTimer("ScareSounds_"+RandInt(1, 5), 0, "ScareSounds");
}

if(asTimer == "ScareSounds_3")
{
PlaySoundAtEntity("", "scare_male_terrified.snt", "ScareSounds_"+RandInt(1, 5), 0, false);
AddTimer("ScareSounds_"+RandInt(1, 5), 0, "ScareSounds");
}

if(asTimer == "ScareSounds_4")
{
PlaySoundAtEntity("", "scare_human_noices.snt", "ScareSounds_"+RandInt(1, 5), 0, false);
AddTimer("ScareSounds_"+RandInt(1, 5), 0, "ScareSounds");
}

if(asTimer == "ScareSounds_5")
{
PlaySoundAtEntity("", "pounding_suitor_low.snt", "ScareSounds_"+RandInt(1, 5), 0, false);
AddTimer("ScareSounds_"+RandInt(1, 5), 0, "ScareSounds");
}


AddTimer("ScareSounds", RandInt(5, 15), "ScareSounds");
}

//SCARESOUNDS END//
///////////////////

///////////
//ENEMIES//

//ENEMIES END//
///////////////

void OnEnter()
{



}

void OnLeave()
{



}



Does anybody know what to do?

Trying is the first step to success.
(This post was last modified: 09-01-2012, 10:04 AM by FlawlessHappiness.)
08-31-2012, 05:11 PM
Find
shadowZgamerZ Offline
Junior Member

Posts: 18
Threads: 3
Joined: Jul 2012
Reputation: 1
#2
RE: No scripts work

Script is missing some of these: { and }

void BuildLadder(string &in asParent, string &in asChild, int alState)
{
if(GetLocalVarInt("MonsterIsActive", 1);
{ //THIS ONE IS MISSING
if(asTimer == "BuildLadder_1")
{
SetEntityActive("wooden_board01_1", false);
SetEntityActive("wooden_board01_2", false);
SetEntityActive("wooden_board_pile01_2", false);
SetEntityActive("ladder_item_1", true);
FadeIn(2);
AddTimer("BuildLadder_2", 2, "BuildLadder");
return;
}
} //THIS ONE IS MISSING

Project: Another Penumbra Story - Chapter 1 - Deep Underground
Level Editor: 18%, Scripting: 8%, Gameplay: 3 hours or more!
(This post was last modified: 08-31-2012, 05:49 PM by shadowZgamerZ.)
08-31-2012, 05:48 PM
Find
GoranGaming Offline
Member

Posts: 183
Threads: 30
Joined: Feb 2012
Reputation: 7
#3
RE: No scripts work

if(GetLocalVarInt("MonsterIsActive")== 1)

not

if(GetLocalVarInt("MonsterIsActive", 1);

Current projects:

The Dark Prison 85 % (Stopped working on this one)

Unnamed Project 7 %
08-31-2012, 06:29 PM
Website Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#4
RE: No scripts work

But don't i get an error then? It doesn't check the script. It just plays the level as if there were no script

Trying is the first step to success.
08-31-2012, 06:56 PM
Find
Froge Offline
Posting Freak

Posts: 2,955
Threads: 176
Joined: Jul 2012
Reputation: 125
#5
RE: No scripts work

Is the name of your .hps script file the same as your map file?

E.x. If your map's name is Entrance_Hall.map then your script file for it should be Entrance_Hall.hps

[Image: p229xcq]
08-31-2012, 07:43 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#6
RE: No scripts work

As i wrote in my first post: Yes and i've double checked

Trying is the first step to success.
08-31-2012, 07:55 PM
Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#7
RE: No scripts work

Have you created the script file while you were playing the map?

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
08-31-2012, 08:04 PM
Website Find
Froge Offline
Posting Freak

Posts: 2,955
Threads: 176
Joined: Jul 2012
Reputation: 125
#8
RE: No scripts work

First of all, the fact that the game isn't even noticing the {} errors in your actual coding means that it is not even registering that the script file exists.

Did you put your .hps files in your maps folder?

[Image: p229xcq]
08-31-2012, 08:05 PM
Find
Robby Offline
Posting Freak

Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation: 47
#9
RE: No scripts work

Try exiting Amnesia, re-enter it, and re-launch the map. I had this issue, and this worked.

Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
08-31-2012, 08:06 PM
Website Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#10
RE: No scripts work

[Image: 2aep361.png]

Trying is the first step to success.
08-31-2012, 08:13 PM
Find




Users browsing this thread: 1 Guest(s)