Frictional Games Forum (read-only)
scrip help please - 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)
+--- Thread: scrip help please (/thread-14466.html)

Pages: 1 2


scrip help please - abe.lloyd - 04-03-2012

this scrip wont work help please
////////////////////////////
// Run when the map starts
void OnStart()
{
AddUseItemCallback("", "crowbar_1", "sewer_arched_1", "UsedCrowbarOnDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_1", "CollideAreaBreakDoor", true, 1);
}
void UsedCrowbarOnDoor(string &in asItem, string &in asEntity)
{
AddTimer("", 0.2, "TimerSwitchShovel");
RemoveItem("crowbar_1");
}



void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.snt", "", 0, false);
SetEntityActive("crowbar_joint_1", true);
}


void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
AddPlayerSanity(25);
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("sewer_arched_1", false, true);
AddPropImpulse("sewer_arched_1", 0, 0, -50, "World");
SetSwingDoorDisableAutoClose("sewer_arched_1", true);
SetSwingDoorClosed("sewer_arched_1", false, false);
SetMoveObjectState("sewer_arched_1", 1);
PlaySoundAtEntity("","break_wood_metal", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);
SetEntityActive("crowbar_joint_1", false);
SetLocalVarInt("Door", 1);
////////////////////////////
// Run when entering map
void OnEnter()
{
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}



RE: scrip help please - stonecutter - 04-03-2012

you missed an " } " at the end of the "void CollideAreaBreakDoor" function !



RE: scrip help please - abe.lloyd - 04-03-2012

where
oh thanks

how should it look



RE: scrip help please - stonecutter - 04-03-2012

simply :

void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
AddPlayerSanity(25);
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("sewer_arched_1", false, true);
AddPropImpulse("sewer_arched_1", 0, 0, -50, "World");
SetSwingDoorDisableAutoClose("sewer_arched_1", true);
SetSwingDoorClosed("sewer_arched_1", false, false);
SetMoveObjectState("sewer_arched_1", 1);
PlaySoundAtEntity("","break_wood_metal", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);
SetEntityActive("crowbar_joint_1", false);
SetLocalVarInt("Door", 1);
}



RE: scrip help please - JetlinerX - 04-03-2012

More specifically, if you just want to copy and paste:

Everything will work with that script, but please know what you did wrong, instead of just copying the new script! Smile

Code:
////////////////////////////
// Run when the map starts
void OnStart()
{
AddUseItemCallback("", "crowbar_1", "sewer_arched_1", "UsedCrowbarOnDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_1", "CollideAreaBreakDoor", true, 1);
}
void UsedCrowbarOnDoor(string &in asItem, string &in asEntity)
{
AddTimer("", 0.2, "TimerSwitchShovel");
RemoveItem("crowbar_1");
}
void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.snt", "", 0, false);
SetEntityActive("crowbar_joint_1", true);
}
void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
AddPlayerSanity(25);
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("sewer_arched_1", false, true);
AddPropImpulse("sewer_arched_1", 0, 0, -50, "World");
SetSwingDoorDisableAutoClose("sewer_arched_1", true);
SetSwingDoorClosed("sewer_arched_1", false, false);
SetMoveObjectState("sewer_arched_1", 1);
PlaySoundAtEntity("","break_wood_metal", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);
SetEntityActive("crowbar_joint_1", false);
SetLocalVarInt("Door", 1);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}



RE: scrip help please - abe.lloyd - 04-03-2012

it says cannotuse item this way


RE: scrip help please - Musier - 04-03-2012

OK.I think I should help you ... After the turn of the script you have used?




RE: scrip help please - abe.lloyd - 04-03-2012

um ok



RE: scrip help please - JetlinerX - 04-03-2012

Are you sure all the names in the level editor are correct?



RE: scrip help please - abe.lloyd - 04-03-2012

no why