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.
xdeath Offline
Member

Posts: 70
Threads: 2
Joined: Aug 2011
Reputation: 1
#1
Script Help.

This script is that the player steps into an area and hears footsteps running where he can't see.
The sounds are to happen at PosNodes that get farther away.So that the sound gets farther away.
Unfortunately I can't get any sound to play.

Spoiler below!


// School hall and celler map script.

void OnStart(){
AddEntityCollideCallback("Player", "footsteps", "FootStepsFunc", true, 1);
//if (ScriptDebugOn()) { // Checks if debugs is on.
//GiveItemFromFile("lantern", "lantern.ent"); // Gives player the lantern.
//SetPlayerLampOil(100.0f); // Fills the players oil reserve.

//for(int i = 0;i < 10; i++) { // Gives player tinder boxes until int i equals ten.
//GiveItemFromFile("tinderbox", "tinderbox.ent"); //Gives tinderbox to player
//}
//}
}
void FootStepsFunc(string &in asParent, string &in asChild, int alState){
//SetEntityActive("servant_grunt_1", true);//This was here to test if the Function was called. It worked.
//PlaySoundAtEntity("enemy\grunt\","notice.snt", "player", 0, false);//This was to test whether or not a sound would play, It did not work.
for (int x=1; x < 8;x++){
PlaySoundAtEntity("step","step_run_wood.snt", "PosNodeArea_"+x, 0, false);
AddTimer("", 0.5f, "");//Waits to call a non-existent function to add time between each step.
}

}
void OnEnter(){
}
void OnLeave(){}

(This post was last modified: 09-12-2011, 04:29 AM by xdeath.)
09-11-2011, 09:52 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: Script Help.

I don't think PosNodes are considered an entity by the game (at least for that function). It should work if you use areas of type Script.

Tutorials: From Noob to Pro
(This post was last modified: 09-11-2011, 10:02 PM by Your Computer.)
09-11-2011, 10:01 PM
Website Find
GreyFox Offline
Member

Posts: 162
Threads: 23
Joined: Jul 2011
Reputation: 2
#3
RE: Script Help.

as YourComputer said I don't think you can use PosNodes for sound

Use Script Area's and then for several footsteps, Make Several Script areas and add Timers so right after the first Footsteps noise finishes it playes a little farther a way and so on.

-Grey Fox

Current Project
Forgotten
09-12-2011, 01:45 AM
Find
xdeath Offline
Member

Posts: 70
Threads: 2
Joined: Aug 2011
Reputation: 1
#4
RE: Script Help.

Right'o about the posnodes, but uh, I tried other things and I can't get the sounds to play.
09-12-2011, 03:39 AM
Find
GreyFox Offline
Member

Posts: 162
Threads: 23
Joined: Jul 2011
Reputation: 2
#5
RE: Script Help.

Did you try in your script File PlaySoundAtEntity(
string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);

That's How I Do most of my sounds (Apart from music and Ambient Sounds.)

-Grey Fox

Current Project
Forgotten
09-12-2011, 03:51 AM
Find
xdeath Offline
Member

Posts: 70
Threads: 2
Joined: Aug 2011
Reputation: 1
#6
RE: Script Help.

did a few touch ups and sounds play now.
09-12-2011, 03:54 AM
Find
GreyFox Offline
Member

Posts: 162
Threads: 23
Joined: Jul 2011
Reputation: 2
#7
RE: Script Help.

Okay good luck with the rest of your custom story

-Grey Fox

Current Project
Forgotten
09-12-2011, 04:03 AM
Find
xdeath Offline
Member

Posts: 70
Threads: 2
Joined: Aug 2011
Reputation: 1
#8
RE: Script Help.

Woohoo, it works now. Its pretty creepy sounding too.
09-12-2011, 04:28 AM
Find




Users browsing this thread: 1 Guest(s)