(07-30-2012, 02:12 PM)andyrockin123 Wrote: Alternatively, if you'd like the player to not move but still have control of the camera, you can use this:
SetPlayerMoveSpeedMul(0.0f);
SetPlayerRunSpeedMul(0.0f);void LightsOut_2(string &in asTimer)
AddEntityCollideCallback("Player", "KillTheLights", "LightsOut", true, 1);
AddEntityCollideCallback("Player", "KillTheLights_2", "LightsOut_2", true, 1);
StartPlayerLookAt("wall_door_frame_6", 10, 10, "");
AddTimer("StopLook_1", 6, "KillTheLights_2");
SetPlayerActive(false);
}
void LightsOut(string &in asParent, string &in asChild, int alState)
{
SetLampLit("candle_floor_1", false, true);
AddTimer("", 0.5, "Out2");
}
void Out2(string &in asTimer)
{
SetLampLit("candle_floor_2", false, true);
AddTimer("", 0.5, "Out3");
}
void Out3(string &in asTimer)
{
SetLampLit("candle_floor_3", false, true);
AddTimer("", 0.5, "Out4");
}
void Out4(string &in asTimer)
{
SetLampLit("candle_floor_4", false, true);
AddTimer("", 0.5, "Out5");
}
void Out5(string &in asTimer)
{
SetLampLit("candle_floor_5", false, true);
AddTimer("", 0.5, "Out6");
}
void Out6(string &in asTimer)
{
SetLampLit("candle_floor_6", false, true);
AddTimer("", 0.5, "Out7");
}
void Out7(string &in asTimer)
{
SetLampLit("candle_floor_7", false, true);
AddTimer("", 0.5, "Out8");
}
void Out8(string &in asTimer)
{
SetLampLit("candle_floor_8", false, true);
AddTimer("", 0.5, "Out9");
}
void Out9(string &in asTimer)
{
SetLampLit("candle_floor_9", false, true);
AddTimer("", 0.5, "Out10");
}
void Out10(string &in asTimer)
{
SetLampLit("candle_floor_10", false, true);
AddTimer("", 0.5, "Out11");
}
void Out11(string &in asTimer)
{
SetLampLit("candle_floor_11", false, true);
AddTimer("", 0.5, "Out12");
}
void Out12(string &in asTimer)
{
SetLampLit("candle_floor_12", false, true);
SetPlayerActive(true);
}
(07-30-2012, 02:23 PM)ZereboO Wrote: okay, try post your script
void OnStart()
{
AddUseItemCallback("", "key_1", "mansion_1", "KeyOnDoor", true);
AddUseItemCallback("", "key_2", "mansion_2", "KeyOnDoor_2", true);
AddUseItemCallback("", "key_3", "mansion_5", "KeyOnDoor_5", true);
SetEntityPlayerInteractCallback("key_3", "ActivateMonster", true);
SetEntityCallbackFunc("key_3", "OnPickup");
AddTimer("StopLook", 2, "LookAtDoor");
AddEntityCollideCallback("Player","Music", "StartMusic", true, 1);
AddEntityCollideCallback("Player", "KillTheLights", "LightsOut", true, 1);
AddEntityCollideCallback("Player", "KillTheLights_2", "LightsOut_2", true, 1);
AddTimer("StopLook_1", 6, "KillTheLights_2");
}
void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0.0f, true);
RemoveItem("key_1");
}
void KeyOnDoor_2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_2", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_2", 0.0f, true);
RemoveItem("key_2");
}
void KeyOnDoor_5(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_5", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_5", 0.0f, true);
RemoveItem("key_3");
}
void StartMusic(string &in asParent, string &in asChild, int alState)
{
PlayMusic("03_paper_daniel02.ogg", true, 0.8, 2, 0, true);
}
void OnPickup(string &in asEntity, string &in type)
{
SetSwingDoorClosed("mansion_3", true, true);
AddPropImpulse("mansion_3", 0, 0, 10, "World");
AddTimer("StopLook", 1, "LookAtDoor");
PlaySoundAtEntity("", "unlock_door.snt", "mansion_5", 0.0f, true);
StartPlayerLookAt("mansion_3", 10, 10, "");
}
void LightsOut_2(string &in asTimer)
{
StartPlayerLookAt("wall_door_frame_6", 10, 10, "");
AddTimer("StopLook_1", 6, "KillTheLights_2");
SetPlayerActive(false);
}
void LightsOut(string &in asParent, string &in asChild, int alState)
{
SetLampLit("candle_floor_1", false, true);
AddTimer("", 0.5, "Out2");
}
void Out2(string &in asTimer)
{
SetLampLit("candle_floor_2", false, true);
AddTimer("", 0.5, "Out3");
}
void Out3(string &in asTimer)
{
SetLampLit("candle_floor_3", false, true);
AddTimer("", 0.5, "Out4");
}
void Out4(string &in asTimer)
{
SetLampLit("candle_floor_4", false, true);
AddTimer("", 0.5, "Out5");
}
void Out5(string &in asTimer)
{
SetLampLit("candle_floor_5", false, true);
AddTimer("", 0.5, "Out6");
}
void Out6(string &in asTimer)
{
SetLampLit("candle_floor_6", false, true);
AddTimer("", 0.5, "Out7");
}
void Out7(string &in asTimer)
{
SetLampLit("candle_floor_7", false, true);
AddTimer("", 0.5, "Out8");
}
void Out8(string &in asTimer)
{
SetLampLit("candle_floor_8", false, true);
AddTimer("", 0.5, "Out9");
}
void Out9(string &in asTimer)
{
SetLampLit("candle_floor_9", false, true);
AddTimer("", 0.5, "Out10");
}
void Out10(string &in asTimer)
{
SetLampLit("candle_floor_10", false, true);
AddTimer("", 0.5, "Out11");
}
void Out11(string &in asTimer)
{
SetLampLit("candle_floor_11", false, true);
AddTimer("", 0.5, "Out12");
}
void Out12(string &in asTimer)
{
SetLampLit("candle_floor_12", false, true);
SetPlayerActive(true);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
StopMusic(1,0);
}
void ActivateMonster(string &in item)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 3, "Idle");
}
void LookAtDoor(string &in asTimer)
{
StopPlayerLookAt();
}
void Lightsout_2(string &in asTimer)
{
StopPlayerLookAt();
}