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
Script Help Crowbars!!
Zjurc Offline
Junior Member

Posts: 43
Threads: 8
Joined: Jan 2012
Reputation: 0
#11
RE: Crowbars!!

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


PHP Code: (Select All)
void OnStart() 
{ 
    
AddEntityCollideCallback("Player", "statueappear", "MonsterFunction", true, 1); 
    
AddEntityCollideCallback("Player", "statueappear_1", "deadbodies", true, 1); 
    
AddEntityCollideCallback("Player", "alldark", "CollideTeleportToDarkSide", true, 1); 
    
AddEntityCollideCallback("Player", "script_slam", "func_slam", true, 1);
    
AddEntityCollideCallback("Player", "metalheads", "metalheads", true, 1); 
    
AddEntityCollideCallback("Player", "metalheads2", "metalheads2", true, 1); 
    
SetEntityPlayerInteractCallback("machineroomkey", "spawn_func", true);
    
AddUseItemCallback("", "crowbar", "crowbardoor", "CrowbarOnDoor", true);
    
AddEntityCollideCallback("crowbar_joint_1", "door_script_1", "crowbarfunc", true, 1);
} 

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


void crowbarfunc(string &in asParent, string &in asChild, int 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 asParent, string &in asChild, int 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", 0, false);
    
PlaySoundAtEntity("darkamb","07_amb_breath","Player", 5, true);
    
PlaySoundAtEntity("howl","guardian_activated.snt","Player", 0, false);
    
    
FadePlayerFOVMulTo(4.0f, 4.0f);
    
SetRadialBlurStartDist(0.1f);
    
FadeRadialBlurTo(1.0f, 5.0f);
    
    
StartEffectFlash(0.2, 0.1,0.3);
    
    
StopMusic(0.3f, 0);
    
StartScreenShake(0.1, 4.7, 0.05, 0.5);
    
    
FadePlayerFOVMulTo(0.5, 3);
    
FadeGlobalSoundVolume(1,2);
    
SetPlayerActive(true);
    
FadePlayerFOVMulTo(1.0f, 0.5f);
    
FadeRadialBlurTo(0.0f, 1.0f);
    
FadeIn(3);
    
ChangePlayerStateToNormal();
    
    
}

void MonsterFunction(string &in asParent, string &in asChild, int 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 asParent, string &in asChild, int alState)
{
SetEntityActive("armour_rusty_complete_5", true); 
SetEntityActive("armour_rusty_complete_6", true); 
SetEntityActive("armour_rusty_complete_7", true); 
}
void metalheads2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("armour_rusty_complete_8", false); 
SetEntityActive("armour_rusty_complete_9", false); 
SetEntityActive("armour_rusty_complete_10", false); 
}
void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door2", 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);

} 
01-26-2012, 05:23 PM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#12
RE: Crowbars!!

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 ^^
(This post was last modified: 01-27-2012, 11:30 PM by i3670.)
01-27-2012, 11:16 PM
Find
Zjurc Offline
Junior Member

Posts: 43
Threads: 8
Joined: Jan 2012
Reputation: 0
#13
RE: Crowbars!!

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!
(This post was last modified: 01-28-2012, 12:29 PM by Zjurc.)
01-28-2012, 12:15 PM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#14
RE: Crowbars!!

Hey, we're all human. And humans make mistakes.
01-28-2012, 01:18 PM
Find




Users browsing this thread: 1 Guest(s)