Best way to detect if the player is sitting in a specific ch

Post » Wed Jun 20, 2012 8:08 am

I have a scene where the player and 4 NPC's all sit together at a table. Though I've been pondering how to do this. How should I check to ensure that the player is seated in a specific chair at the table? (Or could I easily make it 'any' chair and just have the other 4 NPC's fill in the other chairs?) The easiest way, though not exactly best, would be too have the scene not start until the player activated the chair to sit down. But this would mean the player waits while all the NPC's find their way to the room. Is there like a condition for 'IsSittingDown' or something I could use as a EndPhase condition on the first phase? That way all the NPC's would sit down, but nothing else would happen until the player was also seated in the chair.

Thanks for any ideas,
Alexander J. Velicky
User avatar
Tamara Dost
 
Posts: 3445
Joined: Mon Mar 12, 2007 12:20 pm

Post » Wed Jun 20, 2012 8:32 am

https://www.youtube.com/watch?v=Qfcet5hf5bs&list=PLACD7BBE7BB81BDC1&index=1&feature=plcp may be what you are looking for. Check about 13 minutes in.
User avatar
Spencey!
 
Posts: 3221
Joined: Thu Aug 17, 2006 12:18 am

Post » Wed Jun 20, 2012 9:40 am

Unfortunately, there is no "IsChair" keyword. You will probably have to add a keyword, or just set up the quest alias as a specific reference to the chair you want the player to sit in.

One way to handle it is to have all the other actors in the scene do a "SitTarget" on the chairs other than the one you want the player to sit in first, then have one of them ask the player to join them, and leave only one available seat.
User avatar
Barbequtie
 
Posts: 3410
Joined: Mon Jun 19, 2006 11:34 pm

Post » Wed Jun 20, 2012 4:15 am

https://www.youtube.com/watch?v=Qfcet5hf5bs&list=PLACD7BBE7BB81BDC1&index=1&feature=plcp may be what you are looking for. Check about 13 minutes in.
The video wont load for me. :/
Unfortunately, there is no "IsChair" keyword. You will probably have to add a keyword, or just set up the quest alias as a specific reference to the chair you want the player to sit in.

One way to handle it is to have all the other actors in the scene do a "SitTarget" on the chairs other than the one you want the player to sit in first, then have one of them ask the player to join them, and leave only one available seat.
I have a specific alias pointing towards it. The issue isn't telling the player which chair to sit in, it's knowing when the player is sitting in it. Then I can disable their controls and start the scene.
User avatar
Jake Easom
 
Posts: 3424
Joined: Sun Jul 29, 2007 4:33 am

Post » Wed Jun 20, 2012 5:23 pm

Well you can catch if they sit anywhere with Game.GetPlayer().GetSitState() == 2

Give each NPC a Primary chair and a secondary chair, and have the secondary chair be the only chair that is NOT any of their primary chairs. If the player is sitting in an NPC's primary chair, by default, the secondary chair will necessarily be empty.
User avatar
amhain
 
Posts: 3506
Joined: Sun Jan 07, 2007 12:31 pm

Post » Wed Jun 20, 2012 10:37 am

Well you can catch if they sit anywhere with Game.GetPlayer().GetSitState() == 2

Give each NPC a Primary chair and a secondary chair, and have the secondary chair be the only chair that is NOT any of their primary chairs. If the player is sitting in an NPC's primary chair, by default, the secondary chair will necessarily be empty.
Okay, and somewhat silly question; how should I control them going to a primary and secondary chair? Can I do it purely with conditions or would I have to set up some kind of complex variable system to know where the player is sitting?
User avatar
Annick Charron
 
Posts: 3367
Joined: Fri Dec 29, 2006 3:03 pm

Post » Wed Jun 20, 2012 6:40 am

I'm just going to start the script as the player sits in the chair. Not only does this ensure that the player is seated at the start of the scene, but it ensures that the player is sitting in one chair. That solves all the problems, and the only downside is that the player waits like 10 seconds for the NPC's to gather at the table. Thanks guys.
User avatar
Mel E
 
Posts: 3354
Joined: Mon Apr 09, 2007 11:23 pm

Post » Wed Jun 20, 2012 4:35 am

Okay, and somewhat silly question; how should I control them going to a primary and secondary chair? Can I do it purely with conditions or would I have to set up some kind of complex variable system to know where the player is sitting?

Simple enough. Put a script on each chair that has properties that point BACK to the ReferenceAlias for which NPC it is a primary chair for, and to the secondary chair. Then have it catch the "OnActivate" event (which the player activates when he sits in the chair) - in that OnActivate event, have it Force the Sit Target Alias Reference for the NPC whose primary chair it is to the secondary chair.
User avatar
Ricky Meehan
 
Posts: 3364
Joined: Wed Jun 27, 2007 5:42 pm


Return to V - Skyrim