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
PlaySound
nerdboyxxx Offline
Junior Member

Posts: 11
Threads: 5
Joined: Sep 2010
Reputation: 0
#5
RE: PlaySound

(12-14-2010, 11:34 PM)Frontcannon Wrote: Add this in Collide_Area and activate 'Show Debug Messages' in the debug menu (F1):

AddDebugMessage("this should be a sound", false);

Hmmm, no debug messages appeared when I collided with the Area... I'm stumped.
Just in case it will help, I've posted my entire script below (don't worry, it isn't that long Tongue).

//=========================================
     void OnStart()
     {
     AddEntityCollideCallback("player", "Child_Cry_1", "Collide_Area", true, 1);
     AddEntityCollideCallback("player", "slamdoorpianoplay", "Hallway_Collide", true, 1);
    
    
      if(ScriptDebugOn())
     {
        GiveItemFromFile("lantern", "lantern.ent");

        for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");
     }
    
     }
    
     void Collide_Area(string &in asParent, string &in asChild, int alState)
      
     {
         AddDebugMessage("this should be a sound", false);
         PlaySoundAtEntity("BabyCry", "scare_baby_cry5.ogg", "Child_Cry_Scare", 1.0f, false);
         AddTimer("BabyCryStop", 4.0f, "BabyCry")
     }
    
     void BabyCry(string &in asTimer)
    
     {
     StopSound("BabyCry", 1.5f);
     }
    
     void Hallway_Collide(string &in asParent, string &in asChild, int alState)
    
     {
         AddDebugMessage("Door should start to close here, player looks at door", false);
          StartPlayerLookAt("mansion_door_swing_close", 1.0f, 3.5f, "");
         AddTimer("MansionDoorClose", 0.6f, "LookAtDoor");
     }
    
     void LookAtDoor(string &in asTimer)
    
     {
         AddDebugMessage("Door should close and lock, player should be shocked", false);
         SetSwingDoorClosed("mansion_door_swing_close", true, true);
         PlaySoundAtEntity("ShockBreathe", "react_breath1.ogg", "Player", 0.5f, false);
         StopPlayerLookAt();
         StopSound("ShockBreathe", 1.0f);
         SetSwingDoorLocked("mansion_door_swing_close", true, false);
         AddTimer("PianoPlay", 5.0f, "Ghost_Piano");    
     }
        
     void Ghost_Piano(string &in asTimer)
    
     {
         AddDebugMessage("Play piano here, sanity damage", false);
         PlaySoundAtEntity("PianoPlay1", "general_piano02.ogg", "Piano_Play_1", 2.0f, false);
         GiveSanityDamage(20.0f, true);
         StopSound("PianoPlay1", 4.0f);
     }    
    

     //===========================================
    
    
     void OnEnter()
     {
    
     }

     //===========================================
     void OnLeave()
     {
    
     }

Hopefully there is a problem with my formatting so I can fix it quickly Tongue.
(This post was last modified: 12-15-2010, 12:31 AM by nerdboyxxx.)
12-15-2010, 12:11 AM
Find


Messages In This Thread
PlaySound - by nerdboyxxx - 12-14-2010, 05:22 AM
RE: PlaySound - by Frontcannon - 12-14-2010, 05:42 PM
RE: PlaySound - by nerdboyxxx - 12-14-2010, 10:59 PM
RE: PlaySound - by Frontcannon - 12-14-2010, 11:34 PM
RE: PlaySound - by nerdboyxxx - 12-15-2010, 12:11 AM
RE: PlaySound - by nerdboyxxx - 12-15-2010, 03:09 AM



Users browsing this thread: 1 Guest(s)