Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cant have PlaySoundAtEntity with SetSwingDoorClosed?
Ge15t Offline
Junior Member

Posts: 48
Threads: 8
Joined: Feb 2011
Reputation: 0
#11
RE: Cant have PlaySoundAtEntity with SetSwingDoorClosed?

(05-05-2011, 09:21 AM)ricky horror Wrote:
void UsedKeyOnDoor2(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("StartDoor2", false, true);
    PlaySoundAtEntity("", "unlock_door", "StartDoor2", 0, false);

this is actual scripting from the conversion i'm working on
works fine for me

make sure that the third thing typed in (the one next to "unlock_door") is the actual name of the door

other than that, i have no idea why it's not working :/

Yeah see that works for the door unlock noise, thats no problem, its just the door slam noise thats supposed to accompany it.

I even made a separate area with a different sound:

void CollideRoomTwoWind(string &in asParent, string &in asChild, int alState)
{

    PlaySoundAtEntity("", "general_wind_whirl.snt", "mansion_1", 0, false);
    
}

And this STILL doesnt work. Is there any config file that points to where the sound files are supposed to be located so I can check if thats the problem?

EDIT: Yeah i tried that one as well, thats what the code originally looked like
(This post was last modified: 05-05-2011, 09:30 AM by Ge15t.)
05-05-2011, 09:28 AM
Find
ricky horror Offline
Member

Posts: 54
Threads: 8
Joined: Apr 2011
Reputation: 0
#12
RE: Cant have PlaySoundAtEntity with SetSwingDoorClosed?

(05-05-2011, 09:28 AM)Ge15t Wrote:
(05-05-2011, 09:21 AM)ricky horror Wrote:
void UsedKeyOnDoor2(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("StartDoor2", false, true);
    PlaySoundAtEntity("", "unlock_door", "StartDoor2", 0, false);

this is actual scripting from the conversion i'm working on
works fine for me

make sure that the third thing typed in (the one next to "unlock_door") is the actual name of the door

other than that, i have no idea why it's not working :/

Yeah see that works for the door unlock noise, thats no problem, its just the door slam noise thats supposed to accompany it.

I even made a separate area with a different sound:

void CollideRoomTwoWind(string &in asParent, string &in asChild, int alState)
{

    PlaySoundAtEntity("", "general_wind_whirl.snt", "mansion_1", 0, false);
    
}

And this STILL doesnt work. Is there any config file that points to where the sound files are supposed to be located so I can check if thats the problem?

EDIT: Yeah i tried that one as well, thats what the code originally looked like

are you sure the sounds you're trying to use have a .snt file? if not, make one

Amnesia: Ricky's Horror - Full Conversion
05-05-2011, 09:46 AM
Find
Ge15t Offline
Junior Member

Posts: 48
Threads: 8
Joined: Feb 2011
Reputation: 0
#13
RE: Cant have PlaySoundAtEntity with SetSwingDoorClosed?

Aha! Figured out what the problem was, my 'reload map' debug menu option was reloading an old version of the map since i transfered it over to the custom_story folder to make it a custom story rather than a map. ALl working now except for extra_english.lang stuff.. but ill get it working. Thanks guys for the help!
05-05-2011, 10:01 AM
Find
Ge15t Offline
Junior Member

Posts: 48
Threads: 8
Joined: Feb 2011
Reputation: 0
#14
RE: Cant have PlaySoundAtEntity with SetSwingDoorClosed?

Ok this is my new problem:

void OnStart()
{
AddEntityCollideCallback("Player", "CandleArea", "BlowOutCandles", true, 1);

}

void BlowOutCandles(string &in entity)
{

    SetLampLit("blowout_1", false, false);
    SetLampLit("blowout_2", false, false);

}

Ok so im trying to get candles to 'blowout' when i collide with the CandleArea script. The game loads but nothing happens when I enter the area.. not too sure whats going on here
(This post was last modified: 05-05-2011, 11:37 AM by Ge15t.)
05-05-2011, 11:35 AM
Find
cook Offline
Member

Posts: 103
Threads: 6
Joined: Apr 2011
Reputation: 0
#15
RE: Cant have PlaySoundAtEntity with SetSwingDoorClosed?

void chasesequence2(string &in asParent, string &in asChild, int alState)
{
CreateParticleSystemAtEntity("", "ps_break_wood.ps", "scaretriggerchasesound_1", false);
CreateParticleSystemAtEntity("", "ps_door_damage_wood.ps", "scaretriggerchasesound_1", false);
PlaySoundAtEntity("", "break_wood.snt", "scaretriggerchasesound_1", 0.0f, false);
SetEntityActive("scaredoor3", false);
SetEntityActive("scarestatue13", true);
SetLampLit("scarelantern1", false, true);
PlaySoundAtEntity("scrapesound8", "scrape_rock.ogg", "statuetriggerchase_1", 0.0f, false);
AddTimer("", 1, "stopscrape8");
}

There's one of mine, works. Your problem is you are using the entity interact callback syntax and not the trigger callback syntax, shown in my script.

(string &in asParent, string &in asChild, int alState)
(This post was last modified: 05-05-2011, 12:01 PM by cook.)
05-05-2011, 12:00 PM
Find
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#16
RE: Cant have PlaySoundAtEntity with SetSwingDoorClosed?

(05-05-2011, 11:35 AM)Ge15t Wrote: Ok this is my new problem:

void OnStart()
{
AddEntityCollideCallback("Player", "CandleArea", "BlowOutCandles", true, 1);

}

void BlowOutCandles(string &in entity)
{

    SetLampLit("blowout_1", false, false);
    SetLampLit("blowout_2", false, false);

}

Ok so im trying to get candles to 'blowout' when i collide with the CandleArea script. The game loads but nothing happens when I enter the area.. not too sure whats going on here

The function is not getting called because the syntax (the part after BlowOutCandles in parantheses) is wrong. Since the callback is AddEntityCollideCallback, the syntax should be "(string &in asParent, string &in asChild, int alState)"

That should fix it Smile
05-05-2011, 12:02 PM
Find




Users browsing this thread: 1 Guest(s)