Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not sure if this is possible, but I want to ask anyways
Ermu Offline
Member

Posts: 86
Threads: 13
Joined: Jan 2012
Reputation: 2
#8
RE: Not sure if this is possible, but I want to ask anyways

(06-10-2012, 10:07 PM)Ananaias Wrote: Okay. I named the Area "bedscare". Also moved it to activate deadbodyb when I look at the area as well.

Is this what the code should look like now? Sorry, still very new to this ><

PHP Code: (Select All)
void OnStart()
{
    
SetEntityConnectionStateChangeCallback("lever""func_shelf");
    
AddUseItemCallback("""MasterRoomKey""MasterRoomDoor""unlock_door"true);
}

void func_shelf(string &in asEntityint alState)
{
    if (
alState == 1)
{
AddTimer(""3"Forcelook");
    
SetSwingDoorClosed("MasterRoomDoor"truetrue);
    
SetLampLit("light1room2"falsetrue);
    
SetLampLit("light2room2"falsetrue);
    
SetLampLit("light3room2"falsetrue);
    
SetLampLit("light4room2"falsetrue);
    
SetLampLit("light5room2"falsetrue);
    
SetLampLit("light6room2"falsetrue);
    
SetLampLit("light7room2"falsetrue);
    
SetLampLit("light8room2"falsetrue);
    
SetLampLit("light9room2"falsetrue);
    
SetLampLit("light1hall1"falsetrue);
    
SetLampLit("light2hall1"falsetrue);
    
SetLampLit("light3hall1"falsetrue);
    
SetLampLit("light4hall1"falsetrue);
    
SetLampLit("light5hall1"falsetrue);
    
SetLampLit("light6hall1"falsetrue);
    
SetLampLit("light7hall1"falsetrue);
    
SetLampLit("light8hall1"falsetrue);
    
SetLampLit("light1room1"falsetrue);
    
SetLampLit("light2room1"falsetrue);
    
SetLampLit("light3room1"falsetrue);
    
SetLampLit("light4room1"falsetrue);
    
SetLampLit("light5room1"falsetrue);
    
SetLampLit("light6room1"falsetrue);
    
SetLampLit("light7room1"falsetrue);
    
SetLampLit("light8room1"falsetrue);
    
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"0false);
        return;
    }
}
void Forcelook(string &in asTimer){StartPlayerLookAt("bedscare"1010"");      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); 
      
AddTimer(""2"ScareOver");}
void ScareOver(string &in asTimer){////Leave this empty!!StopPlayerLookAt();} 

EDIT: I got this error, so I'm guessing I did something wrong >:

[Image: A4QH]

EDIT2: Lol, I forgot to delete "////Leave this empty!!"

It loaded, testing it now.

EDIT3: Alright, cool. I That got everything to show up (But the two lamps I have, but I think I can manage to make them show up myself.

Now, how do I make them disappear after a few seconds? Furthermore, is there a way to add kind of a panicked noise in the players character? Almost as if the player sees it, then the main character (David, in this case), pants or something? Also, I would like for the player to lose a little sanity, too.

Sorry if I'm asking 200,000,000 questions. I'm taking the time to ask as many questions as I can now, so I can learn all that I really want to ><


ADD THESE INSIDE "void ScareOver"
SetEntityActive("deadbodyb", false);
SetEntityActive("deadbodyc", false);
SetLightVisible("redlighta", false);
SetLightVisible("redlightb", false);
SetLightVisible("redlight", false);

You can also change the time when the scare ends, by changing the number value of AddTimer("", 2, "ScareOver"); located inside of "void ActivateScare"


Also you can do the paniced voice by browsing the Amnesia sounds folder, and once you have selected the one you want, add this inside "void ActivateScare", note you have to add the .snt file of the same name as the .ogg.
PlaySoundAtEntity("", "YourSelectedSoundFile.snt", "Player", 0, false);

Quote:Almost as if the player sees it, then the main character (David, in this case), pants or something?
Didn't understand what you're trying to say here.

Quote:Also, I would like for the player to lose a little sanity, too.
GiveSanityDamage(float afAmount, bool abUseEffect);


afAmount - amount of sanity damage done (in Numbers, replace the "float afAmount" with the number value you want to deal damage to sanity, without quotes)
abUseEffect - determines whether an effect is played when the sanity damage is dealt (= if you want to use some kind of effect. Replace the "bool abUseEffect" with either "true" or "false", without quotes aswell. )
(This post was last modified: 06-10-2012, 11:58 PM by Ermu.)
06-10-2012, 11:49 PM
Find


Messages In This Thread
RE: Not sure if this is possible, but I want to ask anyways - by Ermu - 06-10-2012, 11:49 PM



Users browsing this thread: 1 Guest(s)