Ermu
Member
Posts: 86
Threads: 13
Joined: Jan 2012
Reputation:
2
|
RE: Not sure if this is possible, but I want to ask anyways
(06-10-2012, 09:49 AM)Ananaias Wrote: I probably did it wrong. I got rid of the bed thing, don't worry about that. I'm using the bed already on the map.
I have the following in my game:
http://puu.sh/zXzB
That's 3 bodies, 2 lamps, and a pin light.
Because of my lack of understanding, and not really knowing what to do, I ended up making it so that "deadbodyb" is set active when the lever is pulled.
I tried making it so that when looking at "deadbodyb", "deadbodya," "deadbodyc", and the lamps and light would show up, but it's not working.
All together, I want me turning around to spawn all 3 bodies, the two lamps, and the pinlight I have, but I am having difficulties doing it. Here's my code if anyone can help. I really appreciate it.
void OnStart() { SetEntityPlayerLookAtCallback("deadbodyb", "lookedatbed", true); SetEntityConnectionStateChangeCallback("lever", "func_shelf"); AddUseItemCallback("", "MasterRoomKey", "MasterRoomDoor", "unlock_door", true); }
void func_shelf(string &in asEntity, int alState) { if (alState == 1) { 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("deadbodyb", true); 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 lookedatbed(string &in asParent, string &in asChild, int alState) { SetEntityActive("deadbodya", true); SetEntityActive("deadbodyc", true); SetEntityActive("redlighta", true); SetEntityActive("redlightb", true); SetLightVisible("redlight", true); }
EDIT: I couldn't get the code to work at all with "SetEntityPlayerLookAtCallback("bed_scare", lookedatbed, true);". The game wouldn't even start. I did some googling and found "void lookedatbed(string &in asParent, string &in asChild, int alState)"
I'm sure it CAN work with "SetEntityPlayerLookAtCallback("bed_scare", lookedatbed, true);", and I just screwed something up. If someone can help me with that, too, that'd be awesome. If the SetEntityPlayerLookAtCallback doesn't work, you could also force the player to look at the bed, and then activate all of those.
ie. When you pull the lever, it starts a Timer, (done with AddTimer), then after the timer has ended, the player is forced to look at the bed, and then the body and lights activate.
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("deadbodyb", true); 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){ ////Make an AreaScript inside your bed in LevelEditor and insert name here StartPlayerLookAt("AreaScriptName", 10, 10, ""); AddTimer("", 1, "ActivateScare");} void ActivateScare(string &in asTimer){ SetEntityActive("deadbodya", true); SetEntityActive("deadbodyc", true); SetLightVisible("redlighta", true); SetLightVisible("redlightb", true); SetLightVisible("redlight", true); AddTimer("", 2, "ScareOver");} void ScareOver(string &in asTimer){////Leave this empty!!StopPlayerLookAt();}
REMEMBER TO DELETE ALL LINES WITH ////, THEY WERE COMMENTS FOR YOU!!!
PS. LoL rules
(This post was last modified: 06-10-2012, 12:29 PM by Ermu.)
|
|