Frictional Games Forum (read-only)

Full Version: Game Crashes (No Error issues)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
There is a script error in first line in your hps file.
(07-25-2011, 02:21 PM)Tanshaydar Wrote: [ -> ]There is a script error in first line in your hps file.

Take a look at my script on the first page, the first line is just a bunch of "/"s which has no effect on anything, the game never set an error for the 1st line before.
Found it:
SetEntityPlayerInteractCallback("kitchenkey_1", MomentoDoorSlamComplete", true);

You forgot the " before MomentoDoorSlamComplete, it should've been:
SetEntityPlayerInteractCallback("kitchenkey_1", "MomentoDoorSlamComplete", true);

And this mistake broke the rest of the code.

If script does not work, it's %90 typing error.
Wow, careless mistake, though I did put it in at the last minute, it works now. I'll try not to have this problem again fellas.
As a programmer, I could say most of the mistakes, like %90, are always typing errors. Good thing is they are easy to solve Smile
I get the same mistake, gonna link in both of my maps:

Code:
void OnStart()
{
AddEntityCollideCallback("Player", "CaveIn", "Ras", true, 1);
AddEntityCollideCallback("servant_grunt_1", "despawn", "monsterdespawn", true, 1);
SetEntityPlayerLookAtCallback("gris", "Scare_1", true);
SetEntityPlayerLookAtCallback("look_here", "monsterspawn", true);
SetEntityCollideCallback("Player", "Let_there_be_light", true, 1);
AddEntityCollideCallback("brick", "lever_simple01_1", "unstucklever", true, 1);
//SetMultiSliderCallback("lever_simple01_1", "unlockdoor");
AddEntityCollideCallback("lever_simple01_1", "leverplace", "unlockdoor", true, 1);
    
}

void monsterdespawn(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", false);
PlaySoundAtEntity("", "hit_generic.snt", "floor_deafult_111", 3.0, false);
PlaySoundAtEntity("", "big_scream.snt", "floor_deafult_111", 3.0, false);
}

void Scare_1(string &in asEntity, int alState)
{
SetEntityActive("look_here", true);
GiveSanityDamage(10, true);
PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false);
}

void monsterspawn(string &in asEntity, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "go_to_1", 0, "walk.anm");
AddEnemyPatrolNode("servant_grunt_1", "go_to_2", 2.0, "idle.anm");
AddEnemyPatrolNode("servant_grunt_1", "go_to_3", 0, "run.anm");
SetSwingDoorLocked("sewer_arched_1", false);
}

void Ras(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("cave_in_1", true);
PlaySoundAtEntity("", "general_rock_rumble.snt", "cave_in_1", 2.0, false);
}

void Ras(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("lys", true)
GiveSanityDamage(15, true"
StartPlayerLookAt("corpse_pile2_1", 2, 3, "");
StopPlayerLookAt();
}

void unstucklever(sting &in asParent, string &in as Child, int alState)
{
SetPropObjectStuckState("lever_simple01_1", false);
GiveSmallSanityBoost();
PlaySoundAtEntity("", "lever_stuck_clank.snt", "lever_simple01_1", 2.0, false);
}
void unlockdoor(string &in asEntity, int alState)
{
PlaySoundAtEntity("", "door_level_wood_open.snt", "level_hub_1", 0, false);
SetLevelDoorLocked("level_hub_1", false);
PlaySoundAtEntity("", "lever_success.snt", "lever_simple01_1", 0, false);
}



void OnEnter()
{
}

void OnLeave()
{
}

Code:
////////////////////////////
// Run first time starting map
void OnStart()
{
    AddEntityCollideCallback("Player", "tihi", "boo", true, 1);
    AddEntityCollideCallback("Player", "Skremme_1", "lawl", true, 1);
    AddEntityCollideCallback("Player", "Water_Area_1", "vannmonster", true, 1);
    AddEntityCollideCallback("Player", "Water_Area_2", "vannmonster1", true, 1);
    AddEntityCollideCallback("Player", "Water_Area_3", "vannmonster2", true, 1);
    AddEntityCollideCallback("Player", "Water_Area_4", "vannmonster3", true, 1);
    AddEntityCollideCallback("Player", "Water_Area_5", "vannmonster4", true, 1);
    SetEntityCallbackFunc("KitchenKey_1", "vannmonster5");
    AddUseItemCallback("", "KitchenKey_1", "level_celler_1", "UseKeyOnDoor", true);
    SetEntityCallbackFunc("Bobby_Pin", "lolattack");
    SetLightVisible("SpotLight_1", false);
    SetLightVisible("SpotLight_2", false);
    SetLightVisible("SpotLight_3", false);
    SetLightVisible("SpotLight_4", false);
    SetLightVisible("SpotLight_5", false);
    SetLightVisible("SpotLight_6", false);
    SetLightVisible("SpotLight_7", false);
    SetLightVisible("SpotLight_8", false);
    SetLightVisible("SpotLight_9", false);
    SetLightVisible("SpotLight_10", false);
    AddUseItemCallback("crowbar_1", "crowbar_1", "wooden_boards_block_1", "AttatchCrowbar", true);
    AddEntityCollideCallback("crowbar_joint_1", "Knekk", "BreakBoards", true, 1);
    SetLevelDoorLocked("level_celler_1", true);
    
}

void boo(string &in asParent, string &in asChild, int alState)
{
    GiveSanityDamage(5, true);
    PlaySoundAtEntity("", "react_pant.snt", "Player", 0, false);
    StartPlayerLookAt("look_here", 1, 3, "");
    StopPlayerLookAt();
    SetLightVisible("SpotLight_10", true);
}
void lawl(string &in asParent, string &in asChild, int alState)
{
    PlaySoundAtEntity("", "scare_steps_big1.ogg", "Player", 0, false);
    PlaySoundAtEntity("", "react_pant.snt", "Player", 0, false);
    GiveSanityDamage(5, true);
}


void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("level_celler_1", false);
    PlaySoundAtEntity("", "unlock_door", "level_celler_1", 0, false);
    RemoveItem("KitchenKey_1");
}

void lolattack(string &in asEntity, string &in type)
{
    SetEntityActive("servant_grunt_1", true);
    SetSwingDoorClosed("cellar_wood01_1", true, true);
    ShowEnemyPlayerPosition("servant_grunt_1");
}
void vannmonster(string &in asParent, string &in asChild, int alState)
{
    SetLightVisible("SpotLight_4", true);
    SetLightVisible("SpotLight_5", true);
    SetLightVisible("SpotLight_6", true);
    SetEntityActive("waterlurker_music02_1", true);
    SetEntityActive("waterlurker_music02_2", true);
    SetEntityActive("waterlurker_music02_3", true);
}
void vannmonster1(string &in asParent, string &in asChild, int alState)
{
    SetLightVisible("SpotLight_4", false);
    SetLightVisible("SpotLight_5", false);
    SetLightVisible("SpotLight_6", false);
    SetEntityActive("waterlurker_music02_1", false);
    SetEntityActive("waterlurker_music02_2", false);
    SetEntityActive("waterlurker_music02_3", false);
}
void vannmonster2(string &in asParent, string &in asChild, int alState)
{
    SetLightVisible("SpotLight_3", true);
    SetLightVisible("SpotLight_2", true);
    SetLightVisible("SpotLight_1", true);
    SetEntityActive("waterlurker_music02_6", true);
    SetEntityActive("waterlurker_music02_5", true);
    SetEntityActive("waterlurker_music02_4", true);
}
void vannmonster3(string &in asParent, string &in asChild, int alState)
{
    SetLightVisible("SpotLight_3", false);
    SetLightVisible("SpotLight_2", false);
    SetLightVisible("SpotLight_1", false);
    SetEntityActive("waterlurker_music02_6", false);
    SetEntityActive("waterlurker_music02_5", false);
    SetEntityActive("waterlurker_music02_4", false);
}
void vannmonster4(string &in asParent, string &in asChild, int alState)
{
    SetLightVisible("SpotLight_9", true);
    SetLightVisible("SpotLight_8", true);
    SetLightVisible("SpotLight_7", true);
    SetEntityActive("waterlurker_music02_8", true);
    SetEntityActive("waterlurker_music02_7", true);
    SetEntityActive("waterlurker_music02_9", true);
}
void vannmonster5(string &in asEntity, string &in type)
{
    SetLightVisible("SpotLight_9", false);
    SetLightVisible("SpotLight_8", false);
    SetLightVisible("SpotLight_7", false);
    SetEntityActive("waterlurker_music02_8", false);
    SetEntityActive("waterlurker_music02_7", false);
    SetEntityActive("waterlurker_music02_9", false);
}

////Ødelegge plankene/////
void AddCrowBarQuest(string &in asParent, string &in asChild, int alState)
{
AddQuest("", "CrowBarQuest");
}

void BreakBoards(string &in asParent, string &in asChild, int alState)
{

SetEntityActive("block_box_1", false);  
SetEntityActive("block_box_2", false);
SetEntityActive("crowbar_broken_1", true);
SetEntityActive("crowbar_joint_1", false);

CompleteQuest("", "CrowBarQuest");

PlayMusic("12_puzzle_cavein.ogg", false, 1.0, 0, 1, true); //Optional music for completing puzzle, remove this line if desired

AddTimer("", 30.0, "ResetMusic"); //Reset the music

GiveSanityBoost(); //Sanity boost for completing puzzle, also optional

SetPropHealth("wooden_boards_block_1", 0.0);

}

void AttatchCrowbar(string &in asItem, string &in asEntity)
{
SetEntityActive("crowbar_joint_1", true);

SetPlayerActive(false);

StartPlayerLookAt("crowbar_joint_1", 2, 2, "");

PlaySoundAtEntity("", "player_crouch.snt", "crowbar_joint_1", 0, false);

AddTimer("", 1.0, "ResetPlayer");
AddTimer("", 1.5, "StopPlayerLook");
RemoveItem(asItem);

}
void StopPlayerLook(string &in asTimer)
{
StopPlayerLookAt();
}
void ResetPlayer(string &in asTimer)
{
SetPlayerActive(true);
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{
ChangeMap("asdad_1.map", "from_asdad", "", "");
SetupLoadScreen("LoadingText", "Kitchen_01", 0, "");
}

On the first script, on your 46th line, you forgot to finish the line with );
It's GiveSanityDamage(15, true"
but it should be GiveSanityDamage(15, true);

What's wrong with the second script?
And giving the exact error would likely help us to see the problem, because it might be hard to inspect whole code to find what is wrong.
Pages: 1 2