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


Thread Rating:
  • 2 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Piano Scare script
Bors Offline
Junior Member

Posts: 6
Threads: 2
Joined: Feb 2012
Reputation: 0
#1
Piano Scare script

So, i have a problem with a script. (im not getting errors). Dodgy

the script should do like this, the piano plays a song in a loop, but when you enter an a script area it will stop play and it will slam with dust comming.

The music loop works but not the slam and the dust particels. (sorry for bad english) Tongue

So here is the Script=

void OnStart()
{
AddTimer("pianotimer", 0, "pianotimer");
AddEntityCollideCallback("player", "pianostop", "pianostop", true, 1);
}

void pianotimer(string &in asTimer)
{
PlaySoundAtEntity("piano", "general_piano03", "piano", 0, false);
AddTimer("pianotimer", 18, "pianotimer");
}

void pianostop(string &in asParent, string &in asChild, int alState)
{
StopSound("piano", 0);
RemoveTimer("pianotimer");
SetLeverStuckState("piano", 0, true);
AddPropImpulse("piano", 0, 0, 100, "world");
PlaySoundAtEntity("piano", "break_wood", "piano", 0, false);
CreateParticleSystemAtEntity("", "st_impact.ps", "impact", false);
}

(This post was last modified: 02-04-2012, 05:41 PM by Bors.)
02-04-2012, 05:29 PM
Find
S4n1tyM0rs0 Offline
Junior Member

Posts: 14
Threads: 2
Joined: Feb 2012
Reputation: 0
#2
RE: Piano Scare script problem.

void OnStart()
{
AddTimer("pianotimer", 0, "pianotimer");
AddEntityCollideCallback("player", "pianostop", "pianostop", true, 1);
}

void pianotimer(string &in asTimer)
{
PlaySoundAtEntity("piano", "general_piano03", "piano", 0, false);
AddTimer("pianotimer", 18, "pianotimer");
}

void pianostop(string &in asParent, string &in asChild, int alState)
{
StopSound("piano", 0);
RemoveTimer("pianotimer");
SetLeverStuckState("piano", -1, true);
AddPropImpulse("piano", 0, 0, 100, "world");
PlaySoundAtEntity("piano", "break_wood", "piano", 0, false);
CreateParticleSystemAtEntity("", "ps_dust_impact.ps", "impact", false);
}
02-04-2012, 05:41 PM
Find
Bors Offline
Junior Member

Posts: 6
Threads: 2
Joined: Feb 2012
Reputation: 0
#3
RE: Piano Scare script problem.

(02-04-2012, 05:41 PM)S4n1tyM0rs0 Wrote: void OnStart()
{
AddTimer("pianotimer", 0, "pianotimer");
AddEntityCollideCallback("player", "pianostop", "pianostop", true, 1);
}

void pianotimer(string &in asTimer)
{
PlaySoundAtEntity("piano", "general_piano03", "piano", 0, false);
AddTimer("pianotimer", 18, "pianotimer");
}

void pianostop(string &in asParent, string &in asChild, int alState)
{
StopSound("piano", 0);
RemoveTimer("pianotimer");
SetLeverStuckState("piano", -1, true);
AddPropImpulse("piano", 0, 0, 100, "world");
PlaySoundAtEntity("piano", "break_wood", "piano", 0, false);
CreateParticleSystemAtEntity("", "ps_dust_impact.ps", "impact", false);
}
yes you have right i think, i did test but it still didnt work :/

thanks for the help tho.


02-04-2012, 05:46 PM
Find
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#4
RE: Piano Scare script

player has to be with capital letter Player, I think Smile

The Interrogation
Chapter 1

My tutorials
02-04-2012, 09:45 PM
Find
Ninami Offline
Member

Posts: 59
Threads: 6
Joined: Feb 2012
Reputation: 2
#5
RE: Piano Scare script

PHP Code: (Select All)
void OnStart()
{
AddTimer("pianotimer"0"pianotimer");
AddEntityCollideCallback("player""pianostop""pianostop"true1);


is the name for the Area that stops the music "pianostop"?

If it is then you should try changing the name since you have 1 function and 1 area with the same name.
(This post was last modified: 02-04-2012, 09:53 PM by Ninami.)
02-04-2012, 09:52 PM
Find
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#6
RE: Piano Scare script

That cant be problem Smile. Function and area name can be same. I use that method a lot, since I am lazy to think new names Tongue.

The Interrogation
Chapter 1

My tutorials
02-04-2012, 10:03 PM
Find
Ninami Offline
Member

Posts: 59
Threads: 6
Joined: Feb 2012
Reputation: 2
#7
RE: Piano Scare script

Oh didn't know that Tongue Sorry for misleading hah
02-05-2012, 01:20 PM
Find
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#8
RE: Piano Scare script

NP, we all study one or two things Smile

The Interrogation
Chapter 1

My tutorials
02-05-2012, 02:07 PM
Find
Bors Offline
Junior Member

Posts: 6
Threads: 2
Joined: Feb 2012
Reputation: 0
#9
RE: Piano Scare script

Its now fixed! Big Grin thanks for everything tho Big Grin
02-05-2012, 10:22 PM
Find




Users browsing this thread: 3 Guest(s)