Frictional Games Forum (read-only)
why wont this work :< - 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: why wont this work :< (/thread-12507.html)



why wont this work :< - Quotentote - 01-10-2012

PHP Code:
void OnStart()
{
AddEntityCollideCallback("Player""area1""func_slam"true1);
}

void func_slam(string &in asParentstring &in asChildint alState)
{
SetPropHealth("door1"0.0f);
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false);
PlaySoundAtEntity("""react_scare""Player"0false);


i want that the player enters an area wich makes the door explode (not interacting with any entetie)



RE: why wont this work :< - flamez3 - 01-10-2012

Is it giving you an error?


RE: why wont this work :< - Quotentote - 01-10-2012

no^^ i can hear the sound files but the door doesnt explode
(01-10-2012, 10:16 AM)flamez3 Wrote: Is it giving you an error?




RE: why wont this work :< - flamez3 - 01-10-2012

What door is this?


RE: why wont this work :< - Quotentote - 01-10-2012

a prison section (im on that part you already know^^)
the grunt cant smash the door so i created an area that gets activated after the first script. i want the player to get chased after entering the second script area so that he has a little chance

if its not 'smashable' could i do something like unlocking the door with that script?



RE: why wont this work :< - flamez3 - 01-10-2012

I'm not sure if that door can be broken. If the sounds are playing it means that the function is being called; but the door isn't been destroyed. Yeh; sounds like it can't be broken. :/ I guess you would just have to make the door open instead of it breaking apart.


RE: why wont this work :< - Quotentote - 01-10-2012

PHP Code:
    SetSwingDoorLocked("door1"falsetrue); 

?

PHP Code:
void func_slam(string &in asParentstring &in asChildint alState)
{
SetSwingDoorLocked("door1"falsetrue);
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false);
PlaySoundAtEntity("""react_scare""Player"0false);


tried this but it didnt work T_T



RE: why wont this work :< - flamez3 - 01-10-2012

(01-10-2012, 10:33 AM)Quotentote Wrote:
PHP Code:
    SetSwingDoorLocked("door1"falsetrue); 

?

PHP Code:
void func_slam(string &in asParentstring &in asChildint alState)
{
SetSwingDoorLocked("door1"falsetrue);
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false);
PlaySoundAtEntity("""react_scare""Player"0false);


tried this but it didnt work T_T
That only unlocks the door, doesn't make it swing open.

AddPropImpulse("door1", float afX, float afY, float afZ, "world");
The floats are X, Y and Z. Look into the map and check what axis the door moves on to open. Then add like a 2 or 4 on that float, leave all the others to 0.

Or you could just

SetEntityActive("door1", false);
SetEntityActive("door2", true);

Click on the door1 and hit Ctrl + D and make door2 unactive, also make the OpenAmount to 1.




RE: why wont this work :< - Quotentote - 01-10-2012

okay thanks im going to use the active/inactive thing cause im not pretty goot in these propimpulse things...a few more tips and i have to write 'made by flamez3' o.o Big Grin



RE: why wont this work :< - flamez3 - 01-10-2012

Hahaha ^^