Frictional Games Forum (read-only)
Lever Opening a Bookcase [SOLVED] - 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: Lever Opening a Bookcase [SOLVED] (/thread-11057.html)

Pages: 1 2 3


Lever Opening a Bookcase [SOLVED] - Thor - 10-30-2011

My apologies if this is a stupid question but I've followed this tutorial: ( http://wiki.frictionalgames.com/hpl2/tutorials/script/levers_and_secretshelfs ) to the letter and I've had no luck in getting the lever to actually do anything. I've double and triple checked all of the entity names in both the level editor and the script. I've made sure that the script is in the same folder as the level file and still nothing.

Here's the script file I'm using:
Code:
void OnStart()
{
SetEntityConnectionStateChangeCallback("lever","func_shelf");
}


void func_shelf(string &in asEntity, int alState)
{
    if (alState == 1)
    {
    SetMoveObjectState("shelf",1.0f);
    PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
          return;
    }
}

do I need to insert the function names into one of the callback fields on the entity tab for the lever or case?




RE: Lever Opening a Bookcase - flamez3 - 10-30-2011

Have you got the right lever? Lever_simple?

What exactly does the error say when loading the map?


RE: Lever Opening a Bookcase - Thor - 10-30-2011

(10-30-2011, 04:11 AM)flamez3 Wrote: Have you got the right lever? Lever_simple?

What exactly does the error say when loading the map?
I believe I have the right lever: "lever_simple01"

I'm not getting an error, or at least I don't think I am. Where would I go looking for such a thing?



RE: Lever Opening a Bookcase - flamez3 - 10-30-2011

(10-30-2011, 04:18 AM)Thor Wrote:
(10-30-2011, 04:11 AM)flamez3 Wrote: Have you got the right lever? Lever_simple?

What exactly does the error say when loading the map?
I believe I have the right lever: "lever_simple01"

I'm not getting an error, or at least I don't think I am. Where would I go looking for such a thing?
Hmmm... If your not getting a fatal error when you start the CS, then it means everything's right, but the names are not.... I know you already said you had, but have renamed lever_simple01 to "lever"? and the bookshelf to "shelf". And make sure it is the shelf that moves, and not a normal bookshelf.


RE: Lever Opening a Bookcase - Thor - 10-30-2011

(10-30-2011, 04:23 AM)flamez3 Wrote:
(10-30-2011, 04:18 AM)Thor Wrote:
(10-30-2011, 04:11 AM)flamez3 Wrote: Have you got the right lever? Lever_simple?

What exactly does the error say when loading the map?
I believe I have the right lever: "lever_simple01"

I'm not getting an error, or at least I don't think I am. Where would I go looking for such a thing?
Hmmm... If your not getting a fatal error when you start the CS, then it means everything's right, but the names are not.... I know you already said you had, but have renamed lever_simple01 to "lever"? and the bookshelf to "shelf". And make sure it is the shelf that moves, and not a normal bookshelf.
Yes. I have the entity "lever_simple01.ent" named "lever" and "shelf_secret_door_rot.ent" named "shelf"
Still nothing :/




RE: Lever Opening a Bookcase - flamez3 - 10-30-2011

(10-30-2011, 04:43 AM)Thor Wrote:
(10-30-2011, 04:23 AM)flamez3 Wrote:
(10-30-2011, 04:18 AM)Thor Wrote:
(10-30-2011, 04:11 AM)flamez3 Wrote: Have you got the right lever? Lever_simple?

What exactly does the error say when loading the map?
I believe I have the right lever: "lever_simple01"

I'm not getting an error, or at least I don't think I am. Where would I go looking for such a thing?
Hmmm... If your not getting a fatal error when you start the CS, then it means everything's right, but the names are not.... I know you already said you had, but have renamed lever_simple01 to "lever"? and the bookshelf to "shelf". And make sure it is the shelf that moves, and not a normal bookshelf.
Yes. I have the entity "lever_simple01.ent" named "lever" and "shelf_secret_door_rot.ent" named "shelf"
Still nothing :/
Not sure I can help you without the map file. Ummmmm, try shelf_secret_door...not the shelf_secret_door_rot?


RE: Lever Opening a Bookcase - Thor - 10-30-2011

I tried that as well.

Thank you very much for helping me as much as you have.
I'll update this thread if I manage to figure it out.



RE: Lever Opening a Bookcase - flamez3 - 10-30-2011

One more suggestion, have you made a scriptarea for where the bookcase is supposed to follow?


RE: Lever Opening a Bookcase - Thor - 10-30-2011

(10-30-2011, 05:15 AM)flamez3 Wrote: One more suggestion, have you made a scriptarea for where the bookcase is supposed to follow?
I made the area the tutorial indicated I should and set it as the angular offset area for the shelf.
Is there another area I need for this script to work?



RE: Lever Opening a Bookcase - flamez3 - 10-30-2011

(10-30-2011, 05:33 AM)Thor Wrote:
(10-30-2011, 05:15 AM)flamez3 Wrote: One more suggestion, have you made a scriptarea for where the bookcase is supposed to follow?
I made the area the tutorial indicated I should and set it as the angular offset area for the shelf.
Is there another area I need for this script to work?
Uh.....no, I don't think so, maybe you should restart and do the tutorial again.