+- 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: [SCRIPT] Hi, its me again ;d (/thread-30136.html)
This function needs a string argument. So for example GetSwingDoorClosed("MyDoor") or GetSwingDoorClosed(asParent).
You should also stop doing the (bool) and (float) conversions. There are much better ways to input one of those values, like just writing it straight forward.
SetSwingDoorLocked also uses arguments of String, Bool, Bool. Not String, Bool, String like how you've written it.
Quote:SetSwingDoorClosed(string& asName, bool abClosed, bool abEffects);
has to be like this :
SetSwingDoorClosed("""Name of your door", true or false, true or false);
So choose OR true OR false,like :
PHP Code:
SetSwingDoorClosed("""Name of your door", true,false);
For your script as it is now no need to write bool AND true.
Bool = true or false.
void Bathroomdoor(string &in asEntity) { if(GetSwingDoorLocked(asEntity) == true) { //DO SOMETHING HERE/ Put your script here. Only when touching the door and have (Bathroomdoor) set in your leveleditor as PlayerInteractCallBack. } }
Okey, I fixed that, I dont get the error messages anymore, now there's another problem.. When I enter the defined area (e.g script area) it doesn't run anything.. I checked the names, and everything was correct..
(06-20-2015, 05:01 PM)FlawlessHappiness Wrote: Could you have run into the area when the door was closed first?
Because then the function will delete itself and not call anymore unless you reload the map.
No, I intentionally leave it open.. But that gives me the idea, that I can add another "if" function, that will directly move to the scare part if the door is closed..
But you know, mostly people let the doors open, unless they see a monster..
(06-21-2015, 01:28 AM)FlawlessHappiness Wrote: Show how you've set up the script right now.
Spoiler below!
PHP Code:
//Everything with "//" at the start of the text and at the end is just a comment.// //Everything starting with "//" only, may not be needed in the script.//
//When game starts for first time (e.g. mostly used in full conversion modes)// //void OnGameStart() //{ // //;}
You don't need to check if the door is open or closed. SetSwingDoorClosed() will work whether or not the door is closed or not.
However:
PHP Code:
AddTimer("Lock", float (2.0), "LockDoor");
Here is your problem. You don't need to define the time is a float with that keyword. Any floats are written just as the decimal, followed by the letter f.
So like this:
PHP Code:
AddTimer("Lock", 2.0f, "LockDoor");
Furthermore, recheck your floats in your code. They follow the same format as your first timer; so you need to rewrite those particular parts.