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
Piano Script - Errors
Loveridge Offline
Junior Member

Posts: 21
Threads: 8
Joined: Nov 2011
Reputation: 0
#1
Piano Script - Errors


void OnStart()
{
AddEntityCollideCallback("Player", "roomevent", "room1", true, 1);
AddEntityCollideCallback("Player", "pianoevent", "pianoscare", true, 1);
}

void room1(string &in asParent, string &in asChild, int alState)
{
SetLampLit("candle1", false, false);
SetLampLit("candle2", false, false);
SetLampLit("candle3", false, false);
SetSwingDoorClosed("doorslam2", true, true);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
}

void pianoscare(string &in asParent, string &in asChild, int alState)
{
SetLeverStuckState("piano", 0, true);
AddPropImpulse("piano", 0, 0, "world");
PlaySoundAtEntity("piano", "break_wood", "piano", false);
CreateParticleSystem("", "pa_dust_impact.pa", "impact", false);
}



void OnLeave()
{

}

Hey This is a script i made which will make the piano slam. But it isn't working it says cannot load script and has a fair few script errors all to do with the strings? Any help would be useful thank you Smile
02-04-2012, 04:06 PM
Find
S4n1tyM0rs0 Offline
Junior Member

Posts: 14
Threads: 2
Joined: Feb 2012
Reputation: 0
#2
RE: Piano Script - Errors

(02-04-2012, 04:06 PM)Loveridge Wrote: void OnStart()
{
AddEntityCollideCallback("Player", "roomevent", "room1", true, 1);
AddEntityCollideCallback("Player", "pianoevent", "pianoscare", true, 1);
}

void room1(string &in asParent, string &in asChild, int alState)
{
SetLampLit("candle1", false, false);
SetLampLit("candle2", false, false);
SetLampLit("candle3", false, false);
SetSwingDoorClosed("doorslam2", true, true);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
}

void pianoscare(string &in asParent, string &in asChild, int alState)
{
SetLeverStuckState("piano", 0, true);
AddPropImpulse("piano", 0, 0, "world");
PlaySoundAtEntity("piano", "break_wood", "piano", false);
CreateParticleSystem("", "pa_dust_impact.pa", "impact", false);
}



void OnLeave()
{

}

Hey This is a script i made which will make the piano slam. But it isn't working it says cannot load script and has a fair few script errors all to do with the strings? Any help would be useful thank you Smile
Particle system file is ps_dust_impact.ps
02-04-2012, 04:08 PM
Find
Loveridge Offline
Junior Member

Posts: 21
Threads: 8
Joined: Nov 2011
Reputation: 0
#3
RE: Piano Script - Errors

Its saying no matching signatures to
AddPropImpulse(string@&, const uint, const uin, string @&)'

but it says that for about 3 things Sad
02-04-2012, 04:45 PM
Find
S4n1tyM0rs0 Offline
Junior Member

Posts: 14
Threads: 2
Joined: Feb 2012
Reputation: 0
#4
RE: Piano Script - Errors

This should work:

void OnStart()

{
AddEntityCollideCallback("Player", "roomevent", "room1", true, 1);
AddEntityCollideCallback("Player", "pianoevent", "pianoscare", true, 1);
}

void room1(string &in asParent, string &in asChild, int alState)
{
SetLampLit("candle1", false, false);
SetLampLit("candle2", false, false);
SetLampLit("candle3", false, false);
SetSwingDoorClosed("doorslam2", true, true);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
}

void pianoscare(string &in asParent, string &in asChild, int alState)
{
SetLeverStuckState("piano", -1, true);
AddPropImpulse("piano", 0, 0, 100, "world");
PlaySoundAtEntity("piano", "break_wood", "piano", false);
CreateParticleSystem("", "ps_dust_impact.ps", "impact", false);
}


void OnLeave()

{

}
(This post was last modified: 02-04-2012, 06:04 PM by S4n1tyM0rs0.)
02-04-2012, 06:04 PM
Find
Loveridge Offline
Junior Member

Posts: 21
Threads: 8
Joined: Nov 2011
Reputation: 0
#5
RE: Piano Script - Errors

No Sad Still string problems Sad
02-04-2012, 06:17 PM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#6
RE: Piano Script - Errors

1) Delete map cache file. Close Amnesia before doing this.
2) Check the name of the area -- capitalization, spelling errors, etc
3) Add debug messages to make sure the collision is actually happening.

02-04-2012, 06:21 PM
Find
Loveridge Offline
Junior Member

Posts: 21
Threads: 8
Joined: Nov 2011
Reputation: 0
#7
RE: Piano Script - Errors

I fixed it thank you all for your Help Smile
02-04-2012, 06:27 PM
Find




Users browsing this thread: 1 Guest(s)