The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Error
Icaab2608 Offline
Member

Posts: 85
Threads: 37
Joined: Jul 2013
Reputation: 0
#1
Question  Error

Where here eroor:
PHP Code: (Select All)
const string PLAYER = "Player";
const 
int ON_ENTER_AND_LEAVE = 0;
const 
int ON_ENTER = 1;
const 
int ON_LEAVE = -1;
const 
bool ONCE = true;
const 
bool PERSIST = false;
const 
bool DESTROY_ITEM = true;
const 
bool KEEP_ITEM = false;
const 
bool ACTIVE = true;
const 
bool INACTIVE = false;
const 
string NO_ANIMATION = "";
const 
string NO_FUNCTION = "";
const 
string NO_CALLBACK = "";
const 
string EMPTY = "";

int iFlyingCorpse = 0 ;
void OnStart()
{
RotatePropToSpeed("human_bone_1", 0.3f, 2, 0, 1, 0,false,"");
RotatePropToSpeed("human_bone_2", 0.3f, 2, 0, 1, 0,false,"");
RotatePropToSpeed("human_bone_3", 0.3f, 2, 0, 1, 0,false,"");
RotatePropToSpeed("human_bone_4", 0.3f, 2, 0, 1, 0,false,"");
RotatePropToSpeed("human_bone_5", 0.3f, 2, 0, 1, 0,false,"");
RotatePropToSpeed("human_bone_6", 0.3f, 2, 0, 1, 0,false,"");
RotatePropToSpeed("human_bone_7", 0.3f, 2, 0, 1, 0,false,"");
RotatePropToSpeed("human_bone_8", 0.3f, 2, 0, 1, 0,false,"");
RotatePropToSpeed("human_bone_9", 0.3f, 2, 0, 1, 0,false,"");
RotatePropToSpeed("human_bone_10", 0.3f, 2, 0, 1, 0,false,"");
AddEntityCollideCallback("Player", "ScriptArea_1", "Playerfalls", true, 1);
AddEntityCollideCallback("Player", "Area_TriggerBehindNoise_2", "CollideStairsSteps2", true, 0);
AddEntityCollideCallback("Player", "Area_TriggerBehindNoise_3", "CollideStairsSteps3", true, 0);
AddEntityCollideCallback("Player", "Area_TriggerBehindNoise_4", "CollideStairsSteps4", true, 0);
AddEntityCollideCallback("Player", "Area_TriggerBehindNoise_5", "CollideStairsSteps5", true, 0);
AddEntityCollideCallback("Player", "Area_Stairs", "CollideStairs", false, 0);
AddEntityCollideCallback("Player", "AreaClarice_1", "CollideAreaClarice_1", true, 1);
AddEntityCollideCallback("Player", "Health1", "CollideHealth1", true, 1);
AddEntityCollideCallback("Player", "Health2", "CollideHealth2", true, 1);
AddEntityCollideCallback("Player", "Spawn1", "Spawn1", true, 1);
AddEntityCollideCallback("Player", "Spawn2", "Spawn2", true, 1);
for( 
int i = 1; i <= 22; i++)
AddEntityCollideCallback("Skull_Brick_*", "BreakArea_"+i, "BreakArea", false, 1);
AddEntityCollideCallback("Player", "Scream2", "Grunt", true, 1);
AddEntityCollideCallback("Player", "Scream3", "Brunt", true, 1);
AddEntityCollideCallback("Player", "Scream4", "suitor", true, 1);
for(
int i=1; i<=7; ++i)
AddEntityCollideCallback("Player", "AreaTerror_"+i, "CollideTerrorArea", false, 0);
AddEntityCollideCallback("Player","AreaCradleSoundEvent", "CollideCradleSoundEvent", true, 1);
AddEntityCollideCallback("AreaStrappadoEvent_*", "strappado_shackles_2", "CollideStrappadoShackles",true, 1);
for(
int i=1; i<=4; ++i)
AddEntityCollideCallback("Player", "AreaSawSounds_"+i, "CollideSawSounds",true, 1);
AddEntityCollideCallback("Player", "Locked", "Locked",true, 1);
AddEntityCollideCallback("thin_straight_mini_open_1", "pipe", "pipe",true, 1);
AddEntityCollideCallback("Player", "button1", "wooden_slide_door",true, 1);
AddEntityCollideCallback("Player", "button1", "wooden_slide_door2",true, 1);
AddEntityCollideCallback("ladder_grab_1", "ScriptArea_5", "ladder",true, 1);
for(
int i=1; i<=11; ++i)
AddEntityCollideCallback("wood_box02_"+i, "Break", "Break", true, 1);
AddEntityCollideCallback("Player", "Locked_Door", "Locked_Door", true, 1);
AddEntityCollideCallback("Player", "Locked_Door2", "Locked_Door2", true, 1);
AddEntityCollideCallback("Player", "OpenDoors", "OpenDoors", true, 1);
AddEntityCollideCallback("Player", "Grunt", "Grunt", true, 1);
AddEntityCollideCallback("Player", "Grunt2", "Grunt2", true, 1);
AddEntityCollideCallback("Player", "AGRIPPA", "AGRIPPA", true, 1);
AddEntityCollideCallback("Player", "GruntAndDoor", "GruntAndDoor", true, 1);
AddEntityCollideCallback("Player", "collapse", "Broken", true, 1);
AddEntityCollideCallback("Player", "END1", "BeginCavein", true, 1);
AddEntityCollideCallback("Player", "AreaDamage_1", "CaveDamage", false, 0);
AddEntityCollideCallback("Player", "AreaIronMaidenOpen", "OpenIronMaiden", true, 1);
AddEntityCollideCallback("Player", "AreaInMaiden", "CollideAreaInMaiden", false, 0);
AddEntityCollideCallback("Player", "Lamps", "Lamps", false, 0);
InteractConnectPropWithRope("wheelrope", "crank_iron_2","RopeArea_1", true, 6,3,3, false, 0);
InteractConnectPropWithRope("wheelrope2", "crank_iron_1","RopeArea_3", true, 6,3,3, false, 0);
InteractConnectPropWithRope("wheelrope3", "crank_wood_1","RopeArea_6", true, 6,3,3, false, 0);
InteractConnectPropWithRope("wheelrope4", "crank_wood_2","RopeArea_7", true, 6,3,3, false, 0);
SetEntityConnectionStateChangeCallback("lever_small01_1", "Lever");
SetEntityPlayerInteractCallback("HealthAndMind", "HealthAndMind", true);
AddUseItemCallback("", "lever_small01_item_1", "lever_small_mount_1", "Active", true);
}
void HealthAndMind(string &in entity)
{
AutoSave();
AddPlayerHealth(0.25);
AddPlayerSanity(0.25);
SetLampLit("torch_static01_20", true, true);
SetLampLit("torch_static01_21", true, true);
SetPropActiveAndFade("slime_3way_8", false, 2.5f);
SetPropActiveAndFade("slime_3way_7", false, 2.5f);
SetPropActiveAndFade("slime_3way_12", false, 2.5f);
SetPropActiveAndFade("slime_anim_wall_7", false, 2.5f);
SetPropActiveAndFade("slime_anim_wall_6", false, 2.5f);
SetPropActiveAndFade("slime_anim_wall_3", false, 2.5f);
SetPropActiveAndFade("slime_anim_wall_5", false, 2.5f);
SetPropActiveAndFade("slime_anim_wall_4", false, 2.5f);
SetEntityActive("SignArea_1", false);
SetEntityActive("HealthAndMind", false);
SetEntityActive("GruntAndDoor", true);
SetEntityActive("slime_pile_large_2", false);
SetEntityActive("slime_pile_large_3", false);
SetEntityActive("slime_pile_large_4", false);
SetEntityActive("slime_pile_large_5", false);
SetEntityActive("slime_pile_large_6", false);
SetEntityActive("slime_pile_large_7", false);
SetEntityActive("slime_6way_13", false);
SetEntityActive("slime_6way_14", false);
SetEntityActive("slime_6way_15", false);
SetEntityActive("SlimeDamageArea_1", false);
SetEntityActive("slime_pile_large_8", true);
SetEntityActive("slime_pile_large_9", true);    
SetSwingDoorLocked("prison_8", true, true);
}
void Locked(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked("castle_4", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false); 
PlaySoundAtEntity("", "react_scare", "Player", 0, false);  
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);  
GiveSanityDamage(5.0f, true);
PlayGuiSound("rnd3.ogg", 0.4f);
}
void Active(string &in asItem, string &in asEntity)
{
PlaySoundAtEntity("", "13_rod_in.snt", "Player", 0, false);
SetEntityActive("lever_small01_1", true);
SetEntityActive("lever_small_mount_1", false);
RemoveItem("lever_small01_item_1");
}
void Broken_Castle(string &in asEntity)
{
SetPropHealth("castle_1", 0.0f); 
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);  
PlaySoundAtEntity("", "react_scare", "Player", 0, false); 
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false); 
GiveSanityDamage(5.0f, true);
}
void Locked_Door(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked("prison_7", true, true);
PlayGuiSound("rnd1.ogg", 0.1f);
PlaySoundAtEntity("", "door_prison_close.snt", "Player", 0, false);  
GiveSanityDamage(3.0f, true);
}
void Locked_Door2(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked("prison_section_4", true, true);
PlaySoundAtEntity("", "door_bar_close.snt", "Player", 0, false);  
GiveSanityDamage(2.0f, true);
PlayGuiSound("rnd1.ogg", 0.1f);
}
void OpenDoors(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("prison_section_4", false);
SetEntityActive("prison_section_5", true);
PlaySoundAtEntity("", "door_bar_open.snt", "Player", 0, false);  
SetEntityActive("prison_7", false);
SetEntityActive("prison_9", true);
PlaySoundAtEntity("", "door_prison_open.snt", "Player", 0, false); 
SetEntityActive("castle_2", false);
SetEntityActive("castle_3", true);
PlaySoundAtEntity("", "open_door.snt", "Player", 0, false);  
SetEntityActive("Grunt2", true);
}
void Grunt(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
PreloadSound("rnd2");
SetEntityActive("servant_grunt_ragdoll_1", true);
StartPlayerLookAt("LOOKGRUNT", 1, 1, "");
AddTimer("", 4.0f, "stoplooking2");
}
void stoplooking2(string &in asTimer)
{
AddPropImpulse("grunt1", -1.20, 0, 0, "world");
AddTimer("", 4.0f, "stoplooking3");
}
void stoplooking3(string &in asTimer)
{
GiveSanityDamage(5.0f, true);
AddPropForce("servant_grunt_ragdoll_1", 5000.0f, 0.0f, 0.0f, "world");
StopPlayerLookAt();
SetPlayerActive(true);
SetEntityActive("servant_grunt_ragdoll_1", false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false); 
}
void Grunt2(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "open_door.snt", "Player", 0, false); 
SetEntityActive("servant_grunt_ragdoll_2", true);
SetPlayerActive(false);
AddTimer("", 4.0f, "Grunt3");
}
void Grunt3(string &in asTimer)
{
SetEntityActive("servant_grunt_ragdoll_2", false);
SetEntityActive("servant_grunt_ragdoll_3", true);
PreloadSound("rnd1");
GiveSanityDamage(10.0f, true);
AddTimer("", 4.0f, "Grunt4");
}
void Grunt4(string &in asTimer)
{
SetEntityActive("servant_grunt_ragdoll_3", false);
GiveSanityDamage(2.0f, true);
SetPlayerActive(true);
}
void GruntAndDoor(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_ragdoll_4", true);
StartPlayerLookAt("LOOKGRUNT2", 1, 1, "");
SetPlayerActive(false);
SetEntityActive("prison_11", true);
SetEntityActive("prison_9", false);
PlaySoundAtEntity("", "door_prison_locked.snt", "Player", 0, false); 
AddTimer("", 4.0f, "GruntAndDoor2");
}
void GruntAndDoor2(string &in asTimer)
{
CreateParticleSystemAtEntity("", "ps_break_cavein_blood.ps", "Boom", false);
SetEntityActive("servant_grunt_ragdoll_4", false);
SetPropActiveAndFade("slime_6way_16", true, 1.5f);
StopPlayerLookAt();
SetPlayerActive(true);
SetEntityActive("prison_8", false);
SetEntityActive("prison_12", true);
}
void AGRIPPA(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked("castle_2", true, true);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);  
GiveSanityDamage(2.0f, true); 
SetPlayerActive(false);
SetEntityActive("agrippa_head_obj_1", true);
StartPlayerLookAt("LOOKAGRIPPA", 1, 1, "");
AddTimer("", 4.0f, "AGRIPPA2");
}
void AGRIPPA2(string &in asTimer)
{
GiveSanityDamage(3.0f, true);
StopPlayerLookAt();
SetPlayerActive(true);
SetEntityActive("agrippa_head_obj_1", false);
PlaySoundAtEntity("", "open_door.snt", "Player", 0, false); 
SetEntityActive("castle_2", false);
SetEntityActive("castle_3", true);
}
void Broken(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("sledge_2", false);
SetEntityActive("stool_wood_5", false);
SetEntityActive("torture_wheel_1", false);
SetEntityActive("brown_cave_in_28", true);
SetEntityActive("brown_cave_in_29", true);
SetEntityActive("drag_brown_rock_34", true);
SetEntityActive("drag_brown_rock_35", true);
SetEntityActive("drag_brown_rock_36", true);
SetEntityActive("drag_brown_rock_37", true);
SetEntityActive("drag_brown_rock_38", true);
SetEntityActive("drag_brown_rock_39", true);
SetEntityActive("drag_brown_rock_40", true);
PlayMusic("explosion_rock_large.ogg", false, 1, 1, 2, false);
CreateParticleSystemAtEntity("", "ps_break_cavein.ps", "Stone1", false);
CreateParticleSystemAtEntity("", "ps_break_cavein.ps", "Stone2", false);
CreateParticleSystemAtEntity("", "ps_break_cavein.ps", "Stone3", false);
CreateParticleSystemAtEntity("", "ps_break_cavein.ps", "Stone4", false);
CreateParticleSystemAtEntity("", "ps_break_mansionbase_wall.ps", "Stone5", false);
CreateParticleSystemAtEntity("", "ps_break_mansionbase_wall.ps", "Stone6", false);
CreateParticleSystemAtEntity("", "ps_break_mansionbase_wall.ps", "Stone7", false);
SetEntityActive("END1", true);
SetEntityActive("AreaDamage_1", true);
}
void BeginCavein(string &in asParent, string &in asChild, int alState)
{
StartScreenShake(0.08f, 5.0, 1.0, 1.0);
SetEntityActive("block_box_3", true);
SetEntityActive("block_box_4", true);
SetEntityActive("block_box_5", true);
SetEntityActive("block_box_6", true);
SetEntityActive("block_box_7", true);
SetEntityActive("block_box_8", true);
SetEntityActive("block_box_9", true);
SetEntityActive("block_box_10", true); 
SetEntityActive("block_box_11", true);
SetEntityActive("block_box_12", true);
SetEntityActive("block_box_13", true);
SetEntityActive("block_box_14", true);
SetEntityActive("block_box_15", true);
SetEntityActive("block_box_16", true);
SetEntityActive("block_box_17", true);
SetEntityActive("block_box_18", true);
AddTimer("cavein", 3.0, "CaveIn");
AddTimer("", 02.0f, "warning");
SetMessage("Set message", "warning", 15.0f);
}
void CaveIn(string &in asTimer)
{
  if(
GetLocalVarInt("GiveDamage") == 1) {
  
GivePlayerDamage(25.0f, "BloodSplat", true, false);  //Hurt player if stands too close to cavein
  
  
AddDebugMessage("Hurt Player", false);
  }


GiveSanityDamage(10.0, true);

SetEntityActive("brown_cave_in_30", true);
SetEntityActive("brown_cave_in_31", true);
SetEntityActive("brown_cave_in_32", true);
CreateParticleSystemAtEntity("", "ps_break_mansionbase_wall.ps", "AreaExplosion_1", false);
CreateParticleSystemAtEntity("", "ps_break_mansionbase_wall.ps", "AreaExplosion_2", false);
CreateParticleSystemAtEntity("", "ps_break_mansionbase_wall.ps", "AreaExplosion_3", false);
CreateParticleSystemAtEntity("", "ps_break_mansionbase_wall.ps", "AreaExplosion_4", false);
PlaySoundAtEntity("", "explosion_rock_large.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_breath.snt", "door_frame_5", 0.4f, false);
}

void CaveDamage(string &in asParent, string &in asChild, int alState)
{
   if(
alState == 1) {
   
SetLocalVarInt("GiveDamage", 1);
   
   
AddDebugMessage("Added Damage", false);
   }
   
   else if(
alState == -1) {
   
SetLocalVarInt("GiveDamage", 0);
   
   
AddDebugMessage("Removed Damage", false);
   }
  
   
   
}
void Lamps(string &in asParent, string &in asChild, int alState)
{
SetLampLit("candlestick_floor_red_1", true, true);
SetLampLit("candlestick_floor_red_2", true, true);
SetLampLit("candlestick_floor_red_3", true, true);
SetLampLit("candlestick_floor_red_4", true, true);
SetLampLit("candle_floor_new_1", true, true);
SetLampLit("candle_floor_new_2", true, true);
SetLampLit("candle_floor_new_3", true, true);
SetLampLit("candle_floor_new_4", true, true);
SetLampLit("candle_floor_new_5", true, true);
SetLampLit("candle_floor_new_6", true, true);
SetLampLit("candle_floor_new_7", true, true);
SetLampLit("candle_floor_new_8", true, true);
SetLampLit("candle_floor_new_9", true, true);
SetLampLit("candle_floor_new_10", true, true);
SetLampLit("candle_floor_new_11", true, true);
SetLampLit("candle_floor_new_12", true, true);
SetLampLit("candle_floor_new_13", true, true);
SetLampLit("candle_floor_new_14", true, true);
SetLampLit("candle_floor_new_15", true, true);
SetLampLit("candle_floor_new_16", true, true);
SetLampLit("candle_floor_new_17", true, true);
SetLampLit("candle_floor_new_18", true, true);
SetLampLit("candle_floor_new_19", true, true);
SetLampLit("candle_floor_new_20", true, true);
PlaySoundAtEntity("", "ui_emotion_stone", "torture_wheel_1", 0, false);  
PlaySoundAtEntity("", "sanity_heartbeat", "Player", 0, false);  
SetEntityActive("AreaEmotionEventWheel", true);
SetEntityActive("collapse", true);
AddTimer("", 2.0f, "Lamps2");
}
void Lamps2(string &in asTimer)
{
SetEntityActive("Lamps", false);
}
void OnEnter()
{
PlayMusic("23_amb.ogg", true, 1.0f, 4.0f, 0, true);
AutoSave();
AddEntityCollideCallback("Player", "Scream6", "suitor2", true, 1);
}
void Playerfalls(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("crawler2_dead_1", true);
float mult = 155.0f;
AddPlayerBodyForce(mult * 210, 7, mult * 20, false);
AddTimer("", 4.0f, "Teleport");
FadePlayerRollTo(40.0f, 10.0f, 100.0f);
SetPlayerActive(false);
PlaySoundAtEntity("","player_bodyfall.snt", "Player", 0, false);
SetPlayerCrouching(true);
GivePlayerDamage(0, "BloodSplat", false, false);
} 
void Teleport(string &in asTimer)
{
FadeOut(0);
TeleportPlayer("PlayerStartArea_2");
AddTimer("", 1.0f,"PlayerStandsUpAgain");
}
void PlayerStandsUpAgain(string &in asTimer)
{
FadeIn(0);
SetPlayerSanity(30);
SetPlayerCrouching(false);
StartPlayerLookAt("Look1", 1, 1, "");
AddTimer("Look2", 3.0f, "Look2");
PlaySoundAtEntity("", "player_climb", "Player", 0, false);
}

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

void Look3(string&in asTimer)
{
StartPlayerLookAt("Look3", 3, 5, "");
MovePlayerHeadPos(0, -0.5, -0.3, 1, 0.0f);
AddTimer("Look4", 0.5f, "Look4");
PlaySoundAtEntity("", "player_climb", "Player", 0, false);
}
void Look4(string&in asTimer)
{
StartPlayerLookAt("Look4", 1, 1, "");
AddTimer("stoplooking", 1.5f, "stoplooking");
PlaySoundAtEntity("", "player_climb", "Player", 0, false);
FadePlayerRollTo(0.0f, 60.0f, 60.0f);
AutoSave();
}
void stoplooking(string&in asTimer)
{
     
StopPlayerLookAt();
     
SetPlayerActive(true);
}
void ColideHealth1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("new_wine_1", true);
SetEntityActive("new_wine_2", true);
SetEntityActive("new_wine_3", true);
SetEntityActive("new_wine_4", true);
SetEntityActive("new_wine_5", true);
SetEntityActive("new_wine_6", true);

}
void ColideHealth2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("new_wine_7", true);
SetEntityActive("new_wine_8", true);
SetEntityActive("new_wine_9", true);
SetEntityActive("new_wine_10", true);
SetEntityActive("new_wine_11", true);
}
void BreakArea(string &in asParent, string &in asChild, int alState)
{
    
SetPropActiveAndFade("mining_room_wall_new_"+StringSub(asChild, 10, 2), true, 2);
    
SetPropStaticPhysics("mining_room_wall_new_"+StringSub(asChild, 10, 2), true);
    
RemoveEntityCollideCallback("Skull_Brick_*", asChild);
    
SetSanityDrainDisabled(true);
}
void suitor2(string &in asParent, string &in asChild, int alState)
{
for (
int i = 1; i <3; i++)
            {
SetEntityActive("enemy_suitor_slime_2", true);              
AddEnemyPatrolNode("enemy_suitor_slime_2", "enemy_suitor_slime_path_"+i, 0, "");}
}
void CollideTerrorArea(string &in asParent, string &in asChild, int alState)
{
    
AddDebugMessage("Terror area: "+asChild+" State: "+alState, false);
    
    
////////////////////////
    // Enter
    
if(alState == 1)
    {
        
PlaySoundAtEntity(asChild+"terror", "ui_torture.ent", asChild, 10, true);
        
FadeImageTrailTo(1.0f, 0.5f);
        
AddTimer(asChild+"terror", 2, "TimerTerrorDrain");
    }
    
////////////////////////
    // Leave
    
else
    {
        
FadeImageTrailTo(0.0f, 0.5f);
        
StopSound(asChild+"terror", 2);
        
RemoveTimer(asChild+"terror");
    }
    
}
void TimerTerrorDrain(string & asTimer)
{
    if(
GetPlayerSanity() < 35)
        
GiveSanityDamage(0.05f*0.15f, false);
    else
        
GiveSanityDamage(0.05f*0.5f, false);
        
    
AddTimer(asTimer, 0.05f, "TimerTerrorDrain");
}

void InteractEmotionEffectCradle(string &in asArea)
{
    
StartEffectEmotionFlash("Ch02Level23", "TortureText_Cradle", "ui_insanity_touch.snt");
}
void CollideCradleSoundEvent(string &in asParent, string &in asChild, int alState)
{
    
//The captive (heard in visions) is still alive, pants silently and is dragged away.
    //PlaySoundAtEntity("sawvictim", "23_saw_victim_pant_and_drag", "AreaCradleSoundSource", 0, false);
    
    
AddDebugMessage("Captive pants and is dragged off.", false);
    }
void CollideSawSounds(string &in asParent, string &in asChild, int alState)
{
    
string sLoopingSound = "";
    
string sEventSound = "";
    
float fFadeOutTime = 2.0f;
    
    
//Low muffled cries + silent looping sawing starts
    
if(asChild == "AreaSawSounds_1")
    {
        
sEventSound = "23_saw_voice1";
        
sLoopingSound = "23_saw1";    
    }
    
//A little bit  muffled cries + a bit louder looping sawing starts
    
if(asChild == "AreaSawSounds_2")
    {
        
sEventSound = "23_saw_voice2";
        
sLoopingSound = "23_saw2";            
    }
    
//A louder (but still muffled) screams and intense sawing.
    
if(asChild == "AreaSawSounds_3")
    {
        
sEventSound = "23_saw_voice3";
        
sLoopingSound = "23_saw3";
    }
    
//Just fade out sawing.
    
if(asChild == "AreaSawSounds_4")
    {
        
fFadeOutTime = 2.0;
    }
        
    
//////////////////////////////////////
    //Stop current sound and play a new one
    
StopSound("saw_script_loop",fFadeOutTime); 
    
StopSound("saw_script_event",fFadeOutTime); 
    if(
sLoopingSound != "")    PlaySoundAtEntity("saw_script_loop",sLoopingSound, "AreaSawSoundSource", 1, true);
    if(
sEventSound != "")    PlaySoundAtEntity("saw_script_event",sEventSound, "AreaSawSoundSource", 0, false);
    
    
AddDebugMessage("saw area: "+asChild+" loopsound: "+sLoopingSound + " event sound: "+sEventSound, false);
    
}
void CollideStrappadoShackles(string &in asParent, string &in asChild, int alState)
{
    
string sSound = "";
    
    
//Sound of stretch and pain
    
if(asParent == "AreaStrappadoEvent_1")
    {
        
sSound = "23_strap1";    
        
SetRadialBlurStartDist(0.3f);
        
FadeRadialBlurTo(0.3f, 0.1f);
    }
    
//More stretch, panting, the vicitim is now in air and kicks chair
    
else if(asParent == "AreaStrappadoEvent_2")
    {
        
sSound = "23_strap2";    
        
SetPropActiveAndFade("stool_wood_2", false, 0.3f);
        
SetPropActiveAndFade("stool_wood_1", true, 0.3f);
        
SetRadialBlurStartDist(0.3f);
        
FadeRadialBlurTo(0.3f, 0.1f);
    }
    
//Higher up, even more pain.
    
else if(asParent == "AreaStrappadoEvent_3")
    {
        
sSound = "23_strap3";    
        
SetRadialBlurStartDist(0.3f);
        
FadeRadialBlurTo(0.3f, 0.1f);
    }
    
    
AddTimer("stopradial", 1.0f, "TimerStopRadial");
    
AddDebugMessage("Strappado area: "+asParent+" sound: "+sSound, false);
    
PlaySoundAtEntity("strappado",sSound, asParent, 0, false);
}
void TimerStopRadial(string &in asTimer)
{
    
FadeRadialBlurTo(0.0f, 0.05f);
}
void InteractEmotionEffectSaw(string &in asArea)
{
    
StartEffectEmotionFlash("Ch02Level23", "TortureText_Saw", "ui_insanity_touch.snt");
}
void CradleFlashbackOver()
{
    
SetEntityActive("AreaEmotionEffectCradle", true);    
    
PlaySoundAtEntity("AreaEmotionEffectCradle", "23_pyramid", "AreaEmotionEffectCradle", 0.0f, false);
}
void pipe(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "13_whomp.snt", "Player", 0, false);
DestroyParticleSystem("Particle1");
DestroyParticleSystem("Particle2");
AddTimer("", 1.0f,"Pipe2");
}
void Pipe2(string &in asParent, string &in asChild, int alState)
{
RotatePropToSpeed("button_simple_1", 0.3f, 2, 0, 1, 0,false,"");
RotatePropToSpeed("button_simple_2", 0.3f, 2, 0, 1, 0,false,"");
SetEntityActive("button1", true);  
SetEntityActive("button2", true);  
}
void wooden_slide_door(string &in entity)
{
SetMoveObjectStateExt("wooden_slide_door_1" , 1, 2, 2, 0.1, true);
}
void wooden_slide_door2(string &in entity)
{
SetMoveObjectStateExt("wooden_slide_door_2" , 1, 2, 2, 0.1, true);
}
void ladder(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("LadderArea_2", true);
}
void FadeLadder1(string&in asTimer)
{
SetPropActiveAndFade("ladder_grab_1", false, 2.5f);
SetPropActiveAndFade("ladder_mount_1", false, 2.5f);
SetPropActiveAndFade("ladder_static_1", false, 2.5f);
}
void Ladder1(string &in asStickyArea, string &in asBodyName)
{
SetEntityActive("LadderArea_2", true);
SetPropStaticPhysics("ladder_grab_1", true);
SetPropStaticPhysics("ladder_mount_1", true);
SetPropStaticPhysics("ladder_static_1", true);
}
void Break(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("wooden_boards_block_1", false);
SetEntityActive("wooden_boards_block_2", false);
SetEntityActive("wooden_boards_block_broken_1", true);
SetEntityActive("wooden_boards_block_broken_2", true);
CreateParticleSystemAtEntity("", "ps_break_wood_small.ps", "Break1", false);
CreateParticleSystemAtEntity("", "ps_break_wood_small.ps", "Break2", false);
CreateParticleSystemAtEntity("", "ps_break_wood_small.ps", "Break3", false);
GiveSanityBoost();
SetPropHealth("boards_1", 0.0);
PlaySoundAtEntity("", "break_wood.snt", "wooden_boards_block_broken_1", 0.0, false);
}
void Open(string &in asEntity)
{
SetEntityActive("castle_4", false);
SetEntityActive("castle_5", true);
SetSwingDoorClosed("castle_5", true, true);
PlaySoundAtEntity("", "open_door.snt", "Player", 0, false);  
}
void Lever(string &in asEntity, int alState)
{
     if (
alState == 1)
     {

     
SetMoveObjectState("wooden_slide_door_3",2.0f);
     
AddTimer("", 2.0f, "Ladder_grab");
     
PlaySoundAtEntity("", "quest_completed.snt", "Player", 0, false);
          return;
     }
}
void Ladder_grab(string &in asTimer)
{
SetEntityActive("ladder_grab_1", true);
}
void Lamps2(string &in asTimer)
{
void OpenIronMaiden(string &in asParent, string &in asChild, int alState)
{
    
AddDebugMessage("Scary iron maiden opening", false);
    
    
SetSwingDoorDisableAutoClose("iron_maiden_2", true);
    
SetSwingDoorClosed("iron_maiden_2", false, false);
    
    
/////////////////////////////////////////////
    // Open iron maiden doors
    
AddBodyImpulse("iron_maiden_2_leftDoor", -0.7, 0 , -0.7, "world");
    
AddBodyImpulse("iron_maiden_2_rightDoor", -0.7, 0 , 0.7, "world");
    
    
AddTimer("TimerExtraMaidenImpulse", 0.1, "TimerExtraMaidenImpulse");
    
    
PlaySoundAtEntity("AreaIronMaidenEffect", "24_iron_maiden", "AreaIronMaidenEffect", 0.0f, false);
    
    
CreateParticleSystemAtEntity("maidensmoke","ps_iron_maiden_event_smoke.ps", "AreaIronMaidenEffect", false);
    
StartScreenShake(0.1f, 0.1f, 0.0f, 0.1f);
    
    
// Disable trigger area and activate room sanity drain
    
SetEntityActive("AreaIronMaidenOpen", false);
    
SetEntityActive("AreaInsanityEffect_1", true);
    
    
GiveSanityDamage(10.0f, true);
    
SetRadialBlurStartDist(0.4f);
    
FadeRadialBlurTo(0.2f, 0.4f);
    
    
AddTimer("TimerActiveMaidenEmotion",1.5f,"TimerActiveMaidenEmotion");
}

void TimerExtraMaidenImpulse(string &asTimer)
{
    
AddBodyImpulse("iron_maiden_2_leftDoor", -0.7, 0 , -0.7, "world");
    
AddBodyImpulse("iron_maiden_2_rightDoor", -0.7, 0 , 0.7, "world");
}

//Activate an emotion event area.
void TimerActiveMaidenEmotion(string &asTimer)
{
    
SetEntityActive("AreaEmotionEffectIronMaiden", true);
    
FadeRadialBlurTo(0.0f, 0.4f);
}
void CollideAreaInMaiden(string &in asParent, string &in asChild, int alState)
{
    if(
alState == 1)
        
SetEntityPlayerLookAtCallback("AreaLookMaiden", "LookAtAreaLookMaiden", true);
    else
        
SetEntityPlayerLookAtCallback("AreaLookMaiden", "", true);
}
void LookAtAreaLookMaiden(string &in asEntity, int alState)
{
    if(
GetLocalVarInt("MaidenEvent") == 1) return;
    
    
AddBodyImpulse("iron_maiden_2_rightDoor", 10, 0 , -10, "world");
    
    
GivePlayerDamage(10.0f, "Slash", false, false);
    
GiveSanityDamage(10.0f, true);
    
    
PlayGuiSound("attack_claw_hit02.ogg", 0.8f);
    
    
SetSwingDoorClosed("iron_maiden_2", true, true);
    
    
SetLocalVarInt("MaidenEvent", 1);
}
void InteractEmotionEffectWheel(string &in asArea)
{
StartEffectEmotionFlash("", "", "ui_insanity_touch.snt");
PlaySoundAtEntity("", "21_meat_squeaz", "torture_wheel_1", 0, false);      
PlayGuiSound("21_scream9.ogg", 0.2f);
} 
Huh
07-10-2013, 08:09 AM
Find


Messages In This Thread
Error - by Icaab2608 - 07-10-2013, 08:09 AM
RE: Error - by PutraenusAlivius - 07-10-2013, 09:46 AM
RE: Ошибка - by Icaab2608 - 07-10-2013, 07:23 PM
RE: Error - by plutomaniac - 07-12-2013, 02:13 PM
RE: Error - by Fatalist - 07-10-2013, 04:28 PM
RE: Ошибка - by Icaab2608 - 07-12-2013, 11:28 AM
RE: Error - by Artyom - 07-10-2013, 04:30 PM
RE: Error - by Daemian - 07-10-2013, 08:31 PM



Users browsing this thread: 1 Guest(s)