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
still having script problem and a simple question
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#5
RE: still having script problem and a simple question

Removing function headers doesn't solve the problem but adds to it. If you remove the function header simply because you have a duplicate function declaration, you're left with the body dangling, attached to nothing.

PHP Code: (Select All)
void OnStart()
{
    
AddEntityCollideCallback("Player""explode_scare""Explode"true1);
    
AddUseItemCallback("""key_1""mansion_3""FUNCTION"true);

    
FadeOut(0);
    
FadeIn(5);
    
SetPlayerActive(false);
    
SetPlayerCrouching(true);
    
SetInventoryDisabled(true);
    
MovePlayerHeadPos(0, -202, -2);
    
StartPlayerLookAt("ScriptArea_1"1010"");
    
AddTimer("T1"5.5"TimerFunc");
    
AddTimer("T2"10"TimerFunc");
    
AddTimer("T3"13.5"TimerFunc");
    
AddTimer("T4"16"TimerFunc");
}

void FUNCTION(string &in asItemstring &in asEntity)
{
    
SetSwingDoorLocked(asEntityfalsetrue);
    
PlaySoundAtEntity("""unlock_door"asEntity0false);
    
RemoveItem(asItem);
}

void Explode(string &in asParentstring &in asChildint alState)
{
    
SetPropHealth("pot_explode"0);
}

void TimerFunc(string &in asTimer)
{
    
string x asTimer;
    
    if (
== "T1")
    {
        
FadeOut(4);
        
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false);
    }
    
    else if (
== "T2")
    {
        
FadeIn(3);
    }
    
    else if (
== "T3")
    {
        
FadeOut(2);
        
StopPlayerLookAt();
        
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false);
        
MovePlayerHeadPos(02022);
    }
    
    else if (
== "T4")
    {
        
FadeIn(2);
        
SetPlayerActive(true);
        
SetPlayerCrouching(false);
        
SetInventoryDisabled(false);
        
PlaySoundAtEntity("""react_breath.snt""Player"0false);
    }
}

void OnEnter()
{
    
AddEntityCollideCallback("Player""bang""func_slam"true1);
}

void OnLeave()
{
}

void func_slam(string &in asParentstring &in asChildint alState)
{
    
SetSwingDoorClosed("mansion_2"truetrue);
    
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false);
    
PlaySoundAtEntity("""react_scare""Player"0false);
    
PlaySoundAtEntity("""close_door.snt""Player"0false);
    
GiveSanityDamage(5.0ftrue);


Tutorials: From Noob to Pro
07-24-2012, 11:57 PM
Website Find


Messages In This Thread
RE: still having script problem and a simple question - by Your Computer - 07-24-2012, 11:57 PM



Users browsing this thread: 1 Guest(s)