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 Parentheses issue
DRedshot Offline
Senior Member

Posts: 374
Threads: 23
Joined: Jun 2011
Reputation: 11
#11
RE: Parentheses issue

"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)

(This post was last modified: 12-23-2011, 03:27 AM by DRedshot.)
12-23-2011, 01:18 AM
Find
Grimm101 Offline
Junior Member

Posts: 12
Threads: 3
Joined: Dec 2011
Reputation: 0
#12
RE: Parentheses issue

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: (Select All)
////////////////////////////////
// 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()
{


(This post was last modified: 12-23-2011, 03:03 AM by Grimm101.)
12-23-2011, 01:30 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#13
RE: Parentheses issue

(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.

Tutorials: From Noob to Pro
(This post was last modified: 12-23-2011, 03:31 AM by Your Computer.)
12-23-2011, 03:30 AM
Website Find




Users browsing this thread: 1 Guest(s)