Frictional Games Forum (read-only)

Full Version: Parentheses issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
"DoorCloseBang" is fine for the function name, is the door also called DoorCloseBang?

I get a sneaky suspicion that PlaySoundAtEntity("", "24_Bang.snt", "DoorCloseBang", 0, false);
should say
PlaySoundAtEntity("", "24_Bang.snt", "Bedroom_Key_Door", 0, false);

Remember that the third parameter is the name of the entity which you want the sound to come from - (in this case that would be the door name)
I don't understand how that worked, but it did! I'm going to look into this more, thanks a lot mate your a scholar!


EDIT: Ok so sorry for being a pain again. I've got this door to make sounds that I want but i also wanted my character to face the door and be frightened. I have managed to do that but i dont know how to make the character's aspectMulto and FOVMulto go back to normal. If you could tell me that would be great thanks. Code below again

PHP Code:
////////////////////////////////
// Run when starting the map
void OnStart()
////////////////////////////////
// Entities
{
    
AddUseItemCallback("""Bedroom_Key""Bedroom_Key_Door""UsedKeyOnDoor"true); //Assigns the key to the door and sets the action of this as UsedKeyOnDoor
    
AddEntityCollideCallback("Player""DoorCloseArea1""DoorCloseBang"true1); //Declaring when a player walks into an area called "Name" Deletes the possibility of it happening again so it can only happen once: Number = 1 for player enters. -1 for when player leaves. 0 for both
}

void UsedKeyOnDoor(string &in asItemstring &in asEntity//Declaring the Key as a string 
{
        
SetSwingDoorLocked("Bedroom_Key_Door"falsetrue); //Sets what door the key works on and it can only be used once
            
PlaySoundAtEntity("""unlock_door.snt""Bedroom_Key_Door"0false); //Plays sound when the key is used on the door
            
RemoveItem("Bedroom_Key"); //Removes the key after it has been used
}

void DoorCloseBang(string &in asParentstring &in asChildint alState
{
    
SetSwingDoorClosed("Bedroom_Key_Door"truetrue); //Closes a swing door: Effects indicate true to see the door close
        
PlaySoundAtEntity("""24_bang.snt""Bedroom_Key_Door"0false); //Create banging on the door sound when the door shuts
        
PlaySoundAtEntity("""react_breath.snt""Bedroom_Key_Door"0false); //Create banging on the door sound when the door shuts
        
PlaySoundAtEntity("""15_the_big_scream.snt""Bedroom_Key_Door"0false); //Create banging on the door sound when the door shuts
            
FadePlayerFOVMulTo(0.6f5.0f); //Zooms the screen adding to the wobble effect
            
FadePlayerAspectMulTo(0.6f1.0f); //Stretches the screen giving wobble effect
            
FadeImageTrailTo(0.5f1.0f); //Adds blur making the wobble effect better
            
StartPlayerLookAt("Bedroom_Key_Door"10.0f10.0f""); //Makes the player look at the bedroom door
                
AddTimer(""2.0f"StopLooking"); //timer to stop looking at the door after 2 seconds
}

void StopLooking(string &in asTimer)
{
StopPlayerLookAt(); //Stop looking at the door
}

////////////////////////////////
// Run when entering the map
void OnEnter()
{
}

////////////////////////////////
// Run when leaving the map
void OnLeave()
{


(12-23-2011, 01:30 AM)Grimm101 Wrote: [ -> ]EDIT: Ok so sorry for being a pain again. I've got this door to make sounds that I want but i also wanted my character to face the door and be frightened. I have managed to do that but i dont know how to make the character's aspectMulto and FOVMulto go back to normal. If you could tell me that would be great thanks.

http://wiki.frictionalgames.com/hpl2/amn..._functions

The description for each of those functions provide the default values. Use the defaults to bring things back to normal.
Pages: 1 2