Loveridge
Junior Member
Posts: 21
Threads: 8
Joined: Nov 2011
Reputation:
0
|
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
|
|
02-04-2012, 04:06 PM |
|
S4n1tyM0rs0
Junior Member
Posts: 14
Threads: 2
Joined: Feb 2012
Reputation:
0
|
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 Particle system file is ps_dust_impact.ps
|
|
02-04-2012, 04:08 PM |
|
Loveridge
Junior Member
Posts: 21
Threads: 8
Joined: Nov 2011
Reputation:
0
|
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
|
|
02-04-2012, 04:45 PM |
|
S4n1tyM0rs0
Junior Member
Posts: 14
Threads: 2
Joined: Feb 2012
Reputation:
0
|
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 |
|
Loveridge
Junior Member
Posts: 21
Threads: 8
Joined: Nov 2011
Reputation:
0
|
RE: Piano Script - Errors
No Still string problems
|
|
02-04-2012, 06:17 PM |
|
palistov
Posting Freak
Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation:
57
|
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 |
|
Loveridge
Junior Member
Posts: 21
Threads: 8
Joined: Nov 2011
Reputation:
0
|
RE: Piano Script - Errors
I fixed it thank you all for your Help
|
|
02-04-2012, 06:27 PM |
|
|