Frictional Games Forum (read-only)
Piano Script - Errors - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Piano Script - Errors (/thread-13093.html)



Piano Script - Errors - Loveridge - 02-04-2012


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


RE: Piano Script - Errors - S4n1tyM0rs0 - 02-04-2012

(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



RE: Piano Script - Errors - Loveridge - 02-04-2012

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

but it says that for about 3 things Sad


RE: Piano Script - Errors - S4n1tyM0rs0 - 02-04-2012

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()

{

}


RE: Piano Script - Errors - Loveridge - 02-04-2012

No Sad Still string problems Sad



RE: Piano Script - Errors - palistov - 02-04-2012

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.


RE: Piano Script - Errors - Loveridge - 02-04-2012

I fixed it thank you all for your Help Smile