Twitchez
Member
Posts: 67
Threads: 17
Joined: Mar 2012
Reputation:
1
|
Elevator problems
Hey Forum people!
Earlier today, I was trying out my elevator. It's only supposed to start going upwards before the screen fades out, so as far as controlling the elevator it should be easy.
I have used the default elevator room from Amnesia, and put a piston underneath it. The piston should be triggered when I push down my elevator lever (which works!).
Here is a sample of my code:
void OnStart()
{
SetEntityInteractionDisabled("Entity_Elevator", true);
SetPropStaticPhysics("Entity_Elevator", false);
SetEntityConnectionStateChangeCallback("elevator_lever_1", "func_drop");
}
void func_drop(string &in asEntity, int alState)
{
SetEntityInteractionDisabled("elevator_lever_1", true);
SetPropStaticPhysics("elevator_lever_1", true);
AddDebugMessage("func_drop is running for relz.", true);
GiveSanityBoost();
AddTimer("", 2.0f, "Play_Sound");
PlaySoundAtEntity("", "quest_completed.snt", "elevator_lever_1", 0, false);
}
void Play_Sound(string &in asTimer)
{
PlaySoundAtEntity("", "crank_old_move.snt", "elevator_lever_1", 0, false);
SetMoveObjectStateExt("control_room_piston_piston_1", 0.6, 0.6, 8, 0, false);
}
Anyone have any suggestions? I already tried to understand Elvens elevator tutorial, but my piston is going right through my elevator room!
All the best,
//Twitchez
|
|
05-18-2012, 01:38 PM |
|
Putmalk
Senior Member
Posts: 290
Threads: 13
Joined: Apr 2012
Reputation:
15
|
RE: Elevator problems
I'm confused at the question here.
What is your goal? The piston is going through the elevator floor? What would you like to happen with it?
Maybe a screenshot of the scene would help.
|
|
05-18-2012, 02:02 PM |
|
Twitchez
Member
Posts: 67
Threads: 17
Joined: Mar 2012
Reputation:
1
|
RE: Elevator problems
(05-18-2012, 02:02 PM)Putmalk Wrote: I'm confused at the question here.
What is your goal? The piston is going through the elevator floor? What would you like to happen with it?
Maybe a screenshot of the scene would help. I'm sorry for being unclear. I have put a piston underneath the default elevator room used in the Main story in Amnesia. I want the piston to push the elevator room upwards, alternativly just making the elevator room go upwards as I use a FadeIn(x); function.
|
|
05-18-2012, 02:22 PM |
|
Rapture
Posting Freak
Posts: 1,078
Threads: 79
Joined: May 2011
Reputation:
30
|
RE: Elevator problems
Gah, why is my Tutorial under Elvens... I hate the HPL2 wiki, it does not do the stuff I want it to.
@Twitchez - You need to change the Elevator from a static Object to a Entity. I'll edit my tutorial about that.
|
|
05-18-2012, 02:53 PM |
|
Putmalk
Senior Member
Posts: 290
Threads: 13
Joined: Apr 2012
Reputation:
15
|
RE: Elevator problems
Oh, I see.
@Rapture, didn't they make the elevator shaft the thing that moves in the main game? O_O
|
|
05-18-2012, 02:57 PM |
|
Rapture
Posting Freak
Posts: 1,078
Threads: 79
Joined: May 2011
Reputation:
30
|
RE: Elevator problems
(05-18-2012, 02:57 PM)Putmalk Wrote: Oh, I see.
@Rapture, didn't they make the elevator shaft the thing that moves in the main game? O_O The elevator does not move, another entity does that to give the illusion that it does. Their is even one of those yellow microphones that talks about it.
|
|
05-18-2012, 03:00 PM |
|
Putmalk
Senior Member
Posts: 290
Threads: 13
Joined: Apr 2012
Reputation:
15
|
RE: Elevator problems
(05-18-2012, 03:00 PM)Rapture Wrote: (05-18-2012, 02:57 PM)Putmalk Wrote: Oh, I see.
@Rapture, didn't they make the elevator shaft the thing that moves in the main game? O_O The elevator does not move, another entity does that to give the illusion that it does. Their is even one of those yellow microphones that talks about it. Yeah that was what I was referring to, the shaft moves, not the room.
|
|
05-18-2012, 03:23 PM |
|
Rapture
Posting Freak
Posts: 1,078
Threads: 79
Joined: May 2011
Reputation:
30
|
RE: Elevator problems
(05-18-2012, 03:23 PM)Putmalk Wrote: (05-18-2012, 03:00 PM)Rapture Wrote: (05-18-2012, 02:57 PM)Putmalk Wrote: Oh, I see.
@Rapture, didn't they make the elevator shaft the thing that moves in the main game? O_O The elevator does not move, another entity does that to give the illusion that it does. Their is even one of those yellow microphones that talks about it. Yeah that was what I was referring to, the shaft moves, not the room. I'm getting a little confused xo
He wants the Static Objects > Machine > Elevator to move right? I know that special entity they have moves, but thats not what hes talking about, right?
(This post was last modified: 05-18-2012, 03:31 PM by Rapture.)
|
|
05-18-2012, 03:31 PM |
|
Twitchez
Member
Posts: 67
Threads: 17
Joined: Mar 2012
Reputation:
1
|
RE: Elevator problems
Static Objects > Machine > Elevator is exactly the one I'm trying to use!
How do I change it to get entity properties then, and what do I do afterwards?
|
|
05-18-2012, 05:05 PM |
|
Rapture
Posting Freak
Posts: 1,078
Threads: 79
Joined: May 2011
Reputation:
30
|
RE: Elevator problems
(05-18-2012, 05:05 PM)Twitchez Wrote: Static Objects > Machine > Elevator is exactly the one I'm trying to use!
How do I change it to get entity properties then, and what do I do afterwards? I'm updating the Elevator Tutorial as I speak, so if your reading this now. I have supplied up to the point where I'm starting to convert it into a Entity. I'll add in a link so you can download the finished Elevator entity when I'm done.
(This post was last modified: 05-18-2012, 05:30 PM by Rapture.)
|
|
05-18-2012, 05:30 PM |
|
|