Frictional Games Forum (read-only)
[SCRIPT] Crowbars!! - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Crowbars!! (/thread-12863.html)

Pages: 1 2


RE: Crowbars!! - Zjurc - 01-26-2012

That is really odd. Maybe winrar messed something up. Here, ill copy paste everything:


PHP Code:
void OnStart() 

    
AddEntityCollideCallback("Player""statueappear""MonsterFunction"true1); 
    
AddEntityCollideCallback("Player""statueappear_1""deadbodies"true1); 
    
AddEntityCollideCallback("Player""alldark""CollideTeleportToDarkSide"true1); 
    
AddEntityCollideCallback("Player""script_slam""func_slam"true1);
    
AddEntityCollideCallback("Player""metalheads""metalheads"true1); 
    
AddEntityCollideCallback("Player""metalheads2""metalheads2"true1); 
    
SetEntityPlayerInteractCallback("machineroomkey""spawn_func"true);
    
AddUseItemCallback("""crowbar""crowbardoor""CrowbarOnDoor"true);
    
AddEntityCollideCallback("crowbar_joint_1""door_script_1""crowbarfunc"true1);


void CrowbarOnDoor(string &in asItemstring &in asEntity)
{
SetEntityActive("crowbar_joint_1"true);
}


void crowbarfunc(string &in asParentstring &in asChildint alState)
{
SetPropHealth("crowbardoor"0.0f);
SetEntityActive("crowbar_joint_1"false);
SetEntityActive("crowbar_dyn_1"true);
}

void spawn_func(string &in item)
{
SetEntityActive("armour_rusty_complete_4"false);
SetEntityActive("armour_rusty_complete_3"false);
SetEntityActive("armour_rusty_complete_2"false);
SetEntityActive("armour_rusty_complete_1"false);
SetEntityActive("armour_rusty_complete_11"true);
SetEntityActive("armour_rusty_complete_12"true);
SetEntityActive("armour_rusty_complete_13"true);
SetEntityActive("armour_rusty_complete_14"true);
SetEntityActive("armour_rusty_complete_15"true);
}

void CollideTeleportToDarkSide(string &in asParentstring &in asChildint alState)
{
    
FadeOut(0.3);
    
    
AddTimer("scare"0.3f"TimerPlayerReact");    
    
AddTimer("breath"2.0f"TimerPlayerReact");    
    
AddTimer("breathl"4.0f"TimerPlayerReact");
    
AddTimer("breathl"6.0f"TimerPlayerReact");
    
    
AddTimer("TeleportHowl"0.5f"TimerTeleportHowl");    
    
AddTimer("TeleportDone"3.5f"TimerTelportDone");
    
    
PlaySoundAtEntity("stomp","scare_wall_stomp","Player"0false);
    
PlaySoundAtEntity("darkamb","07_amb_breath","Player"5true);
    
PlaySoundAtEntity("howl","guardian_activated.snt","Player"0false);
    
    
FadePlayerFOVMulTo(4.0f4.0f);
    
SetRadialBlurStartDist(0.1f);
    
FadeRadialBlurTo(1.0f5.0f);
    
    
StartEffectFlash(0.20.1,0.3);
    
    
StopMusic(0.3f0);
    
StartScreenShake(0.14.70.050.5);
    
    
FadePlayerFOVMulTo(0.53);
    
FadeGlobalSoundVolume(1,2);
    
SetPlayerActive(true);
    
FadePlayerFOVMulTo(1.0f0.5f);
    
FadeRadialBlurTo(0.0f1.0f);
    
FadeIn(3);
    
ChangePlayerStateToNormal();
    
    
}

void MonsterFunction(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("chained_prisoner_1"true); 
    
SetEntityActive("chained_prisoner_2"true); 
    
SetEntityActive("armour_rusty_complete_1"true); 
    
SetEntityActive("armour_rusty_complete_2"true); 
    
SetEntityActive("armour_rusty_complete_3"true); 
    
SetEntityActive("armour_rusty_complete_4"true); 
    
SetEntityActive("torch_static01_nosound_5"true); 
    
SetEntityActive("torch_static01_nosound_6"true); 
    
SetEntityActive("torch_static_green_1"true); 
    
SetEntityActive("torch_static_green_2"true); 
    
SetEntityActive("torch_static_green_3"true); 
    
SetEntityActive("torch_static_green_4"true); 
    
SetEntityActive("torch_static01_nosound_7"false); 
    
SetEntityActive("torch_static01_nosound_2"false); 
    
SetEntityActive("torch_static01_nosound_3"false); 
    
SetEntityActive("torch_static01_nosound_4"false); 
}

void metalheads(string &in asParentstring &in asChildint alState)
{
SetEntityActive("armour_rusty_complete_5"true); 
SetEntityActive("armour_rusty_complete_6"true); 
SetEntityActive("armour_rusty_complete_7"true); 
}
void metalheads2(string &in asParentstring &in asChildint alState)
{
SetEntityActive("armour_rusty_complete_8"false); 
SetEntityActive("armour_rusty_complete_9"false); 
SetEntityActive("armour_rusty_complete_10"false); 
}
void func_slam(string &in asParentstring &in asChildint alState)
{
SetSwingDoorClosed("door2"truetrue);
 
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false); 
 
PlaySoundAtEntity("""react_scare""Player"0false);  PlaySoundAtEntity("""close_door.snt""Player"0false); 
 
GiveSanityDamage(5.0ftrue);





RE: Crowbars!! - i3670 - 01-27-2012

You've forgot to check the "ItemInteraction" box.


Edit: I mean the "door_script_1" area in the level editor. If that wasn't clear ^^



RE: Crowbars!! - Zjurc - 01-28-2012

Well I guess I'm f**king retarded Big Grin I will go do that now and post results
Yeah It works now! Thanks for all your help!


RE: Crowbars!! - i3670 - 01-28-2012

Hey, we're all human. And humans make mistakes.