Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Lever Opening a Bookcase [SOLVED]
Thor Offline
Junior Member

Posts: 12
Threads: 1
Joined: Oct 2011
Reputation: 0
#1
Lever Opening a Bookcase [SOLVED]

My apologies if this is a stupid question but I've followed this tutorial: ( http://wiki.frictionalgames.com/hpl2/tut...cretshelfs ) 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:
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?

(This post was last modified: 11-01-2011, 08:37 PM by Thor.)
10-30-2011, 03:53 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#2
RE: Lever Opening a Bookcase

Have you got the right lever? Lever_simple?

What exactly does the error say when loading the map?

(This post was last modified: 10-30-2011, 04:13 AM by flamez3.)
10-30-2011, 04:11 AM
Find
Thor Offline
Junior Member

Posts: 12
Threads: 1
Joined: Oct 2011
Reputation: 0
#3
RE: Lever Opening a Bookcase

(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?
10-30-2011, 04:18 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#4
RE: Lever Opening a Bookcase

(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.

(This post was last modified: 10-30-2011, 04:23 AM by flamez3.)
10-30-2011, 04:23 AM
Find
Thor Offline
Junior Member

Posts: 12
Threads: 1
Joined: Oct 2011
Reputation: 0
#5
RE: Lever Opening a Bookcase

(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 :/

10-30-2011, 04:43 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#6
RE: Lever Opening a Bookcase

(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?

10-30-2011, 04:50 AM
Find
Thor Offline
Junior Member

Posts: 12
Threads: 1
Joined: Oct 2011
Reputation: 0
#7
RE: Lever Opening a Bookcase

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.
10-30-2011, 05:02 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#8
RE: Lever Opening a Bookcase

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

10-30-2011, 05:15 AM
Find
Thor Offline
Junior Member

Posts: 12
Threads: 1
Joined: Oct 2011
Reputation: 0
#9
RE: Lever Opening a Bookcase

(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?
10-30-2011, 05:33 AM
Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#10
RE: Lever Opening a Bookcase

(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.

10-30-2011, 07:08 AM
Find




Users browsing this thread: 4 Guest(s)