Frictional Games Forum (read-only)
How do you make a monster spawn and then he leaves and you can hear a door opened. - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: How do you make a monster spawn and then he leaves and you can hear a door opened. (/thread-9923.html)

Pages: 1 2 3


RE: How do you make a monster spawn and then he leaves and you can hear a door opened. - BubbleTroll - 08-23-2011

so btool is always after any entity that can chanced by true or false.
thats what i found out x3
also im trying to get three lanterns to slowly turn off
anyone knows a better function for that?


RE: How do you make a monster spawn and then he leaves and you can hear a door opened. - narutohokager - 08-23-2011

Mhh I do not think there is an order for its...

Maybe this command :

Code:
void FadeLightTo(string& asLightName, float afR, float afG, float afB, float afA, float afRadius, float afTime);

Changes the properties of a light.

asLightName - internal name
afR - red value
afG - green value
afB - blue value
afA - alpha value
afRadius - radius of the light. -1 means keeping the radius
afTime - time in seconds until change is done

If the three lamp are in a dark room, you can change the colors for the changes to black. But I do not think it will work ...


RE: How do you make a monster spawn and then he leaves and you can hear a door opened. - BubbleTroll - 08-24-2011

well i kinda make the function more smoother.
like when the player collides into an area a function is going to start.
the function makes the player look up for 4-5 sec and also the lamps turns off to lit false.
and used sanity damage and it plays a react_pan to play.


RE: How do you make a monster spawn and then he leaves and you can hear a door opened. - narutohokager - 08-24-2011

This should probably help you Wink

Code:
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.


RE: How do you make a monster spawn and then he leaves and you can hear a door opened. - BubbleTroll - 08-25-2011

setlightvisible didnt really work :/


RE: How do you make a monster spawn and then he leaves and you can hear a door opened. - Acies - 08-25-2011

SetLampLit(string& asName, bool abLit, bool abEffects);


RE: How do you make a monster spawn and then he leaves and you can hear a door opened. - narutohokager - 08-26-2011

I just tested, it is true setlightvisible didnt work Undecided

Acies Can you give an example with the command setlamplit ?


RE: How do you make a monster spawn and then he leaves and you can hear a door opened. - narutohokager - 08-26-2011

SetLampLit works perfectly well Big Grin

Here a example :

Code:
SetLampLit("candlestick_wall_2", false, false);




RE: How do you make a monster spawn and then he leaves and you can hear a door opened. - BubbleTroll - 08-28-2011

thats what im using.
also what kind of effects can i add to the function?