Frictional Games Forum (read-only)

Full Version: Script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When you load my level,some reason the player,does not look at second of the scripts.
Explain, in what an error script:
PHP Code:
void OnStart()
{
SetEntityPlayerInteractCallback("potion_health_1""Slime"true);
AddEntityCollideCallback("crowbar_joint_1""AreaBreakBoards_1""BreakBoards"true1);
AddEntityCollideCallback("Player""AreaCrowBarQuest_1""AddCrowBarQuest"true1);
AddUseItemCallback("crowbar""crowbar""chest_of_drawers_simple_new_1""AttatchCrowbar"true);
FadeOut(0);
ClearSavedMaps();
SetPlayerHealth(40);
SetPlayerActive(false);
MovePlayerHeadPos(-1.250050.0f);
StartPlayerLookAt("lamp_wall_flour_1"99"");
AddTimer("Look1"4"Look1");
AddTimer("FadeIn"2"FadeIn");
}
void Broken_Castle(string &in asEntity)
{
SetPropHealth("prison_1"0.0f); 
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false);  
PlaySoundAtEntity("""react_scare""Player"0false); 
GiveSanityDamage(5.0ftrue);
}
void Broken_Castle2(string &in asEntity)
{
SetPropHealth("prison_2"0.0f); 
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false);  
PlaySoundAtEntity("""react_scare""Player"0false); 
GiveSanityDamage(5.0ftrue);
}
void Slime(string &in item)
{
SetPropActiveAndFade("slime_6way_trollface_1"true1.2f);
SetPropActiveAndFade("slime_pile_trollface_1"true1.2f);
SetPropActiveAndFade("slime_pile_trollface_2"true1.2f);
SetPropActiveAndFade("slime_pile_trollface_3"true1.2f);
SetPropActiveAndFade("slime_pile_trollface_4"true1.2f);
SetPropActiveAndFade("slime_pile_trollface_5"true1.2f);
SetPropActiveAndFade("slime_pile_trollface_6"true1.2f);
SetPropActiveAndFade("slime_pile_trollface_7"true1.2f);
SetPropActiveAndFade("slime_6way_trollface_2"true1.2f);
SetPropActiveAndFade("slime_6way_trollface_3"true1.2f);
SetPropActiveAndFade("sslime_6way_trollface_4"true1.2f);
SetPropActiveAndFade("slime_6way_trollface_5"true1.2f);
SetPropActiveAndFade("slime_6way_trollface_6"true1.2f);
SetPropActiveAndFade("slime_3way_trollface_1"true1.2f);
SetPropActiveAndFade("SlimeDamageArea_1"true1.2f);
SetPropActiveAndFade("SlimeDamageArea_2"true1.2f);
SetPropActiveAndFade("SlimeDamageArea_3"true1.2f);
SetPropActiveAndFade("SlimeDamageArea_4"true1.2f);
SetPropActiveAndFade("SlimeDamageArea_5"true1.2f);
SetPropActiveAndFade("SlimeDamageArea_6"true1.2f);
SetPropActiveAndFade("SlimeDamageArea_7"true1.2f);
SetPropActiveAndFade("SlimeDamageArea_8"true1.2f);
PlayMusic("trolls.ogg"true2.00.00true);
}
void AttatchCrowbar(string &in asItemstring &in asEntity)
{
SetEntityActive("crowbar_joint_1"true);

SetPlayerActive(false);

StartPlayerLookAt("crowbar_joint_1"22"");

PlaySoundAtEntity("""player_crouch.snt""crowbar_joint_1"0false);
RemoveItem(asItem);
}
void BreakBoards(string &in asParentstring &in asChildint alState)
{
SetEntityActive("crowbar_broken_1"true);
SetEntityActive("crowbar_joint_1"false);
CompleteQuest("crowbarquest""CrowBarQuest");
GiveSanityBoost();
SetEntityActive("chest_of_drawers_simple_new_1"false);        
SetEntityActive("chest_of_drawers_simple_1"true);
StopPlayerLookAt();
SetPlayerActive(true);
}
void FadeIn(string&in asTimer)
{
SetPlayerSanity(10);
FadeIn(2);
PlaySoundAtEntity("""react_sigh""Player"0false);
}


void Look1(string&in asTimer)
{
SetPlayerSanity(30);
StartPlayerLookAt("Look1"11"");
AddTimer("Look2"3.0f"Look2");
PlaySoundAtEntity("""player_climb""Player"0false);
}

void Look2(string&in asTimer)
{
PlaySoundAtEntity("""react_breath""Player"0false);
StartPlayerLookAt("Look2"23"");
MovePlayerHeadPos(00050.0f);
AddTimer("Look3"2.5f"Look3");
}

void Look3(string&in asTimer)
{
StartPlayerLookAt("Look3"35"");
MovePlayerHeadPos(0, -0.5, -0.310.0f);
AddTimer("Look4"0.5f"Look4");
PlaySoundAtEntity("""player_climb""Player"0false);
}

void Look4(string&in asTimer)
{
StartPlayerLookAt("Look4"11"");
AddTimer("stoplooking"1.5f"stoplooking");
MovePlayerHeadPos(00050.0f);
PlaySoundAtEntity("""player_climb""Player"0false);
AutoSave();
}

void stoplooking(string&in asTimer)
{
    
StopPlayerLookAt();
    
SetPlayerActive(true);
}
void OnEnter()
{
SetEntityPlayerInteractCallback("potion_health""potion_health"true);
SetEntityPlayerInteractCallback("Health""Health"true);
AddEntityCollideCallback("Player""Damage""Damage"true1);
AddEntityCollideCallback("male_arm_trol_1""Path""Path"true1);
AddPlayerHealth(80);
AddUseItemCallback("""key_tower""level_hub_1""OpenDoor"true);
}
void Test_Door(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked("level_hub_1"falsetrue);
PlaySoundAtEntity("""unlock_door""level_hub_1"0false);
RemoveItem("key_tower");
SetEntityActive("male_arm_trol_1"true);
AddEnemyPatrolNode("male_arm_trol_1""MaleArmPath_1"1"run");
}
void Health(string &in item)
{
RemoveItem("asItem");
SetPlayerHealth(100);
SetEntityActive("Damage"true);
SetSwingDoorClosed("prison_1"truetrue);
SetSwingDoorClosed("prison_2"truetrue);
PlaySoundAtEntity("""door_prison_open.snt""Player"0false); 
}
void potion_health(string &in item)
{
GiveItemFromFile("key_tower""key_tower.ent");
GiveItemFromFile("potion_health_empty""potion_health_empty.ent");
RemoveItem("asItem");
}
void Damage(string &in asParentstring &in asChildint alState)
{
GivePlayerDamage(2.0f"BloodSplat"falsefalse);
AddTimer(""2.0f"Timer_1");
}
void Timer_1(string &in asTimer)
{
GivePlayerDamage(2.0f"BloodSplat"falsefalse);
AddTimer(""2.0f"Timer_2");
}
void Timer_2(string &in asTimer)
{
GivePlayerDamage(2.0f"BloodSplat"falsefalse);
AddTimer(""2.0f"Timer_3");
}
void Timer_3(string &in asTimer)
{
GivePlayerDamage(2.0f"BloodSplat"falsefalse);
AddTimer(""2.0f"Timer_4");
}
void Timer_4(string &in asTimer)
{
GivePlayerDamage(2.0f"BloodSplat"falsefalse);
AddTimer(""2.0f"Timer_5");
}
void Timer_5(string &in asTimer)
{
GivePlayerDamage(2.0f"BloodSplat"falsefalse);
AddTimer(""2.0f"Timer_6");
}
void Timer_6(string &in asTimer)
{
GivePlayerDamage(2.0f"BloodSplat"falsefalse);
AddTimer(""2.0f"Timer_7");
}
void Timer_7(string &in asTimer)
{
GivePlayerDamage(2.0f"BloodSplat"falsefalse);
AddTimer(""2.0f"Timer_8");
}
void Timer_8(string &in asTimer)
{
GivePlayerDamage(2.0f"BloodSplat"falsefalse);
AddTimer(""2.0f"Timer_9");
}
void Timer_9(string &in asTimer)
{
GivePlayerDamage(2.0f"BloodSplat"falsefalse);
AddTimer(""2.0f"Timer_10");
}
void Timer_10(string &in asTimer)
{
GivePlayerDamage(2.0f"BloodSplat"falsefalse);
AddTimer(""2.0f"Timer_11");
}
void Timer_11(string &in asTimer)
{
GivePlayerDamage(2.0f"BloodSplat"falsefalse);
AddTimer(""2.0f"Timer_12");
}
void Timer_12(string &in asTimer)
{
GivePlayerDamage(2.0f"BloodSplat"falsefalse);
AddTimer(""2.0f"Timer_13");
}
void Timer_13(string &in asTimer)
{
GivePlayerDamage(2.0f"BloodSplat"falsefalse);
AddTimer(""2.0f"Timer_14");
}
void Timer_14(string &in asTimer)
{
GivePlayerDamage(2.0f"BloodSplat"falsefalse);
AddTimer(""2.0f"Timer_15");
}
void Timer_15(string &in asTimer)
{
GivePlayerDamage(2.0f"BloodSplat"falsefalse);
AddTimer(""2.0f"Timer_16");
}
void Timer_16(string &in asTimer)
{
GivePlayerDamage(2.0f"BloodSplat"falsefalse);
AddTimer(""2.0f"Timer_17");
}
void Timer_17(string &in asTimer)
{
GivePlayerDamage(2.0f"BloodSplat"falsefalse);
AddTimer(""2.0f"Timer_18");
}
void Timer_18(string &in asTimer)
{
GivePlayerDamage(2.0f"BloodSplat"falsefalse);
AddTimer(""2.0f"Timer_19");
}
void Timer_19(string &in asTimer)
{
GivePlayerDamage(2.0f"BloodSplat"falsefalse);
AddTimer(""2.0f"Timer_20");
}
void Timer_20(string &in asTimer)
{
GivePlayerDamage(2.0f"BloodSplat"falsefalse);
AddTimer(""2.0f"Timer_death");
}
void Timer_death(string &in asTimer)
{
GivePlayerDamage(40.0f"BloodSplat"falsefalse);
}
void Path(string &in asParentstring &in asChildint alState)
{
AddEnemyPatrolNode("male_arm_trol_1""MaleArmPath_2"0"run");
}
void OnLeave()
{
StopMusic(3.00);

[img][Image: bandicam20_3744987_8500686.jpg][/img]
Does your other script works ?
(07-19-2013, 10:19 AM)No Author Wrote: [ -> ]Does your other script works ?
No,I already say.
What's the problem here? Is one of the look at scripts doesn't work? If so, please tell me which one.
(07-19-2013, 11:46 AM)JustAnotherPlayer Wrote: [ -> ]What's the problem here? Is one of the look at scripts doesn't work? If so, please tell me which one.
void Look2(string&in asTimer)
{
PlaySoundAtEntity("", "react_breath", "Player", 0, false);
StartPlayerLookAt("Look2", 2, 3, "");
MovePlayerHeadPos(0, 0, 0, 5, 0.0f);
AddTimer("Look3", 2.5f, "Look3");
}
Remove the MovePlayerHeadPos part. Maybe it'll work now.