Frictional Games Forum (read-only)
Door PropForce? - 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: Door PropForce? (/thread-19313.html)



Door PropForce? - giacomo9 - 11-22-2012

I know there's a script to self opening doors, but I want to do this:
1)The player enters the area - the door closes behind him (not be able to open them)
2)When a player raises something, doors open by themselves.


That's PropForce, right? But how to make the door shut on their own, then blocked? And After that unlocked and opened?


RE: Door PropForce? - The chaser - 11-22-2012

(11-22-2012, 03:07 PM)giacomo9 Wrote: I know there's a script to self opening doors, but I want to do this:
1)The player enters the area - the door closes behind him (not be able to open them)
2)When a player raises something, doors open by themselves.


That's PropForce, right? But how to make the door shut on their own, then blocked? And After that unlocked and opened?
1:

AddEntityCollideCallback("Player", "Area_close", "Close", true, 1);

void Close (string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("Nameofdoor", true);
AddTimer("", 0.1, "Lock");
}

void Lock (string &in asTimer)
{
SetSwingDoorLocked("Nameofdoor", true);
}


RE: Door PropForce? - Tomato Cat - 11-22-2012

*edit* Yeah, like what chaser said. ^

If by close you mean slammed, then yeah, addpropforce and setswingdoorlocked would work for the first one.

I'm assuming by "raise" you mean like a lever? For that, I would play around with switch/if statements, local variables, and the setswingdoorclosed function.

To unlock and reopen the doors, you would have to call another function. Or use variables and switch/if statements.


RE: Door PropForce? - giacomo9 - 11-26-2012

The Chaser, I've got problem with your script (1):

main (280,1): ERR: No matching signatures to
'SetSwingDoorClosed(string@&, const bool)'
main (286,1): ERR: No matching signatures to
'SetSwingDoorLocked(string@&, const bool)'

What should I do? Smile


RE: Door PropForce? - FlawlessHappiness - 11-26-2012

Show us the lines Smile

string = Some letters inside these: ""
bool = true or false, not inside these ""


RE: Door PropForce? - The chaser - 11-26-2012

AddEntityCollideCallback("Player", "Area_close", "Close", true, 1);



void Close (string &in asParent, string &in asChild, int alState)

{

SetSwingDoorClosed("Nameofdoor", true, bool abEffects); ///I don't know what is bool abEffects, but setting false (it's a bool) should work.

AddTimer("", 0.1, "Lock");

}



void Lock (string &in asTimer)

{

SetSwingDoorLocked("Nameofdoor", true, bool abEffects);

}

Ok, fixed it Wink


RE: Door PropForce? - giacomo9 - 11-26-2012

The chaser, you are my God Big Grin It works, thank you! Wink


RE: Door PropForce? - The chaser - 11-26-2012

(11-26-2012, 06:05 PM)giacomo9 Wrote: The chaser, you are my God Big Grin It works, thank you! Wink
I'm not a god, I'm Dolan, and I think I'm more interesting this way ^^

I just help people, so if you need help I'll try to be there Wink

If for 2 you mean grabbing an entity (like a box) you can:

void SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);



Calls a function when the player interacts with a certain entity.


Callback syntax: void MyFunc(string &in asEntity)




asName - internal name


asCallback - function to call


abRemoveOnInteraction - determines whether the callback should be removed when the player interacts with the entity

Directly extracted from the wiki Wink