Ananaias
Junior Member
Posts: 20
Threads: 7
Joined: Jun 2012
Reputation:
0
|
RE: Not sure if this is possible, but I want to ask anyways
Alright, so I got this now:
Script:
void OnStart() { SetEntityConnectionStateChangeCallback("lever", "func_shelf"); AddUseItemCallback("", "MasterRoomKey", "MasterRoomDoor", "unlock_door", true); }
void func_shelf(string &in asEntity, int alState) { if (alState == 1) {AddTimer("", 3, "Forcelook"); SetSwingDoorClosed("MasterRoomDoor", true, true); SetLampLit("light1room2", false, true); SetLampLit("light2room2", false, true); SetLampLit("light3room2", false, true); SetLampLit("light4room2", false, true); SetLampLit("light5room2", false, true); SetLampLit("light6room2", false, true); SetLampLit("light7room2", false, true); SetLampLit("light8room2", false, true); SetLampLit("light9room2", false, true); SetLampLit("light1hall1", false, true); SetLampLit("light2hall1", false, true); SetLampLit("light3hall1", false, true); SetLampLit("light4hall1", false, true); SetLampLit("light5hall1", false, true); SetLampLit("light6hall1", false, true); SetLampLit("light7hall1", false, true); SetLampLit("light8hall1", false, true); SetLampLit("light1room1", false, true); SetLampLit("light2room1", false, true); SetLampLit("light3room1", false, true); SetLampLit("light4room1", false, true); SetLampLit("light5room1", false, true); SetLampLit("light6room1", false, true); SetLampLit("light7room1", false, true); SetLampLit("light8room1", false, true); SetLightVisible("point1room2", false); SetLightVisible("point2room2", false); SetLightVisible("point3room2", false); SetLightVisible("point4room2", false); SetLightVisible("point5room2", false); SetLightVisible("point6room2", false); SetLightVisible("point7room2", false); SetLightVisible("point8room2", false); SetLightVisible("point9room2", false); SetLightVisible("point1hall1", false); SetLightVisible("point2hall1", false); SetLightVisible("point3hall1", false); SetLightVisible("point4hall1", false); SetLightVisible("point5hall1", false); SetLightVisible("point6hall1", false); SetLightVisible("point7hall1", false); SetLightVisible("point8hall1", false); SetLightVisible("point1room1", false); SetLightVisible("point2room1", false); SetLightVisible("point3room1", false); SetLightVisible("point4room1", false); SetLightVisible("point5room1", false); SetLightVisible("point6room1", false); SetLightVisible("point6room1", false); SetLightVisible("point8room1", false); SetMoveObjectState("shelf", 1.0f); SetEntityActive("hallwaypoofer", true); AddEnemyPatrolNode("hallwaypoofer", "PathNodeArea_1", 2, ""); AddEnemyPatrolNode("hallwaypoofer", "PathNodeArea_2", 0, ""); AddEnemyPatrolNode("hallwaypoofer", "PathNodeArea_3", 0, ""); AddEnemyPatrolNode("hallwaypoofer", "PathNodeArea_4", 0, ""); AddEnemyPatrolNode("hallwaypoofer", "PathNodeArea_5", 0, ""); AddEnemyPatrolNode("hallwaypoofer", "PathNodeArea_6", 0, ""); AddEnemyPatrolNode("hallwaypoofer", "PathNodeArea_7", 0, ""); AddEnemyPatrolNode("hallwaypoofer", "PathNodeArea_8", 0, ""); AddEnemyPatrolNode("hallwaypoofer", "PathNodeArea_9", 2, ""); PlaySoundAtEntity("", "quest_completed.snt", "rotatearea", 0, false); return; } } void Forcelook(string &in asTimer){StartPlayerLookAt("bedscare", 10, 10, ""); AddTimer("", 1, "ActivateScare");} void ActivateScare(string &in asTimer){ SetEntityActive("deadbodya", true); SetEntityActive("deadbodyb", true); SetEntityActive("deadbodyc", true); SetLightVisible("redlighta", true); SetLightVisible("redlightb", true); SetLightVisible("redlight", true); GiveSanityDamage(40, bool true); SetSoundAtEntity("", "react_breath1.snt", "Player", 0, false); AddTimer("", 2, "ScareOver");} void ScareOver(string &in asTimer){StopPlayerLookAt();} SetEntityActive("deadbodya", false); SetEntityActive("deadbodyb", false); SetEntityActive("deadbodyc", false); SetLightVisible("redlight", false); SetLightvisible("redlightb", false);
Okay, so I got the above problem fixed, by removing "}" after " void ScareOver(string &in asTimer){StopPlayerLookAt();}", and by instead putting it at the end of " SetLightvisible("redlightb", false);"
So now the code looks like:
void Forcelook(string &in asTimer){StartPlayerLookAt("bedscare", 10, 10, ""); AddTimer("", 1, "ActivateScare");} void ActivateScare(string &in asTimer){ SetEntityActive("deadbodya", true); SetEntityActive("deadbodyb", true); SetEntityActive("deadbodyc", true); SetLightVisible("redlighta", true); SetLightVisible("redlightb", true); SetLightVisible("redlight", true); GiveSanityDamage(40, bool true); SetSoundAtEntity("", "react_breath1.snt", "Player", 0, false); AddTimer("", 2, "ScareOver");} void ScareOver(string &in asTimer){StopPlayerLookAt(); SetEntityActive("deadbodya", false); SetEntityActive("deadbodyb", false); SetEntityActive("deadbodyc", false); SetLightVisible("redlight", false); SetLightvisible("redlightb", false);}
However, now I'm getting THIS error, and I can't figure it out.
(This post was last modified: 06-11-2012, 01:57 AM by Ananaias.)
|
|