Frictional Games Forum (read-only)
Scripting n00b in need of help. - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Scripting n00b in need of help. (/thread-5425.html)

Pages: 1 2 3


RE: Scripting n00b in need of help. - Cellrage - 11-14-2010

I'm going to assume that you have it set so that when you pick up the lantern, it runs "lanterndooractivate".

First thing that you should probably get in the habit of is to add debug messages to whatever functions you're having trouble with so you can visually see if they are being called or not.

On to your script, I can see a few potential problems. One is that the disable auto close should be probably called at the same time as the prop force, as I'm pretty sure the disable auto close isn't permanent.

The second is your actual prop force. The three number inputs stand for x, y, and z, in that order I think. You don't need an impulse in every axis to open the door, only in either the z or the x axis. Check in your level editor to see which direction you should push it, or just experiment with slightly larger values.

Also, I tend to find AddPropImpulse works better for me.


RE: Scripting n00b in need of help. - Akumasama - 11-14-2010

I've tried all that.
The door should be pushed through the X-axis.
Also tried moving the auto close command, without success.


RE: Scripting n00b in need of help. - Chilton - 11-14-2010

Bumping doors isnt simple - Try using about 300 X axis force, and failing that, post the script in here and i (or some ninja :p) will post a "repaired" version if they can


RE: Scripting n00b in need of help. - Akumasama - 11-14-2010

(11-14-2010, 03:33 AM)Chilton Wrote: Bumping doors isnt simple - Try using about 300 X axis force, and failing that, post the script in here and i (or some ninja :p) will post a "repaired" version if they can

300? O.o

I'll try that first thing in the morning.


RE: Scripting n00b in need of help. - Cellrage - 11-14-2010

Also, add a debug message in the lanterndooractivate function.
Check to see if it's actually calling the function when you pick up that lantern.

If all else fails, post the script like Chilton said, or upload your map so someone can look over it.


RE: Scripting n00b in need of help. - Akumasama - 11-15-2010

Well, I can't get it to work.
The function doesn't get activated it seems, but the door does unlock for some reason.

http://www.mediafire.com/?cb89o48ssez97o9

This is the custom story folder...

Please point out all the stuff I did wrong while your at it, if you please ;D


RE: Scripting n00b in need of help. - Akumasama - 11-15-2010

So I've just checked the maps from the official story.
They showed me this code.

Code:
SetSwingDoorLocked("Door_3", false, false);
    SetSwingDoorClosed("Door_3", false, false);
    SetSwingDoorDisableAutoClose("Door_3", true);

Nothing interesting below or above it.
It was triggered with a timer.

So then I just copy paste the code and modified it so it uses the names I use.
No luck.

Then I entered a debug message, saying "Message".
The message showed up, so it does trigger the actual code, but nothing happens with the door :/


RE: Scripting n00b in need of help. - Akumasama - 11-16-2010

Sorry for the triple post everyone.

My problem has been resolved.
I think I made a typo somewhere in the AddPropImpulse code...

Oh well, I shall post here again should I need more help.


RE: Scripting n00b in need of help. - Frontcannon - 11-16-2010

(11-16-2010, 11:23 PM)Akumasama Wrote: I think I made a typo somewhere in the AddPropImpulse code...

Unlikely, wouldn't that screw up the syntax 90% of the time?


RE: Scripting n00b in need of help. - Akumasama - 11-18-2010

Yeah, I geuss it would screw it up...

But I'm not entirely sure what I did wrong then xP
Oh well, it's going pretty good at the moment.
I've added a timer without problems, and playing sounds.
So yeah... I'll post again should I have more problems.