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
How do you make a monster spawn and then he leaves and you can hear a door opened.
narutohokager Offline
Member

Posts: 149
Threads: 28
Joined: Jan 2011
Reputation: 0
#24
RE: How do you make a monster spawn and then he leaves and you can hear a door opened.

This should probably help you Wink

void OnStart()
{
     AddEntityCollideCallback("Player", "[NAME AREA]", "[FUNCTION RUN]", true, 1);
}

void [FUNCTION RUN](string &in asParent, string &in asChild, int alState)
{
     StartPlayerLookAt("[AREA LOOK]", 3.0f, 3.5f, "");
     AddTimer("StopLook", 4.5f, "StopLook");
     SetLightVisible("[NAME OF THE LAMP]", false);
     GiveSanityDamage(10, true);
     PlaySoundAtEntity("scare", "react_pant.snt", "Player", 0.5f, false);
}
void StopLook(string &in asTimer)
{
     StopPlayerLookAt();
}

Explain :

AddEntityCollideCallback = Add Collide for Object/player, replace Name Area, Function Run
StartPlayerLookAt = Automatically look at object, replace Area Look
AddTimer = Timer for stop look, nothing to replace
SetLightVisible = Set light visible or not, replace Name of the lamp and test if working, i never use this, if you have many other lamp, added another SetLightVisible.
GiveSanityDamage = Give sanity damage to the player, 10 is the number damage
PlaySoundAtEntity = Play a sound, i already put react_pant
StopPlayerLookAt = Stop the automatically look.

Thats all.

Sorry for my bad english
Amnesia The Revenge - Chapter 1
(This post was last modified: 08-24-2011, 05:28 PM by narutohokager.)
08-24-2011, 05:21 PM
Website Find


Messages In This Thread
RE: How do you make a monster spawn and then he leaves and you can hear a door opened. - by narutohokager - 08-24-2011, 05:21 PM



Users browsing this thread: 1 Guest(s)