Choose Your Language

Saturday, 23 January 2010

Please Take A Seat

I was back at designing some "simple" ambient background this week and thought I would have a few NPCs sit around the tavern. So, knowing the ActionSit function that I have used before, I thought it would be a simple task to implement. Wrong! If you are a builder, then the chances are you already knew this, but I did not and am not always up to date with some of the hangover functions from NWN1 that do not work with NWN2. Animations had a overhaul in NWN2 and so I should not have been surprised when it failed to work. I suppose I just hoped it would be one of those functions that would somehow still tie into the code and do the job.

In the end, I searched the Vault and found a couple of entries that covered seating characters in NWN2. One was KEMO Custom Chairs, which is an outstanding piece of code, but I believe too complicated to use unless you want "sitting" to be quite a high priority in your module. However, Patcha's more basic piece of code, To sit on objects (v1.76), came with only one basic script that handles the sitting, which was far more easy to incorporate into my own module. There were one or two anomalies that I would have preferred to have working with the script, such as NPCs getting up if knocked into, but I am not sure if it is possible because of the way NWN now handles animations. I am continuing to investigate this, but you can see the results already in this shot:

Misery Stone

I have also just downloaded Misery Stone by jclef. I probably don't need to promote the quality and high standards we already know of jclef and BouncyRock Entertainment, so let's just say I am convinced you will enjoy it, even though I have not yet had the chance to start it myself. I have that privilege in the next few days hopefully. :)

Freedom Poll

The poll with respect to "How Much Freedom Do You Really Want" has come to an end and it looks to me that the majority of players (29/38) are still prepared to be responsible for their own actions in the game, even if it means they might "blow it" through miscalculated play. That serves as a comfort to a degree, because it supports my own style of play and, by default, design. I was still surprised, however, that of the 29, there were 15 who were what I would consider "ultra" responsible and ready to take the blame for any "mistake" they made even if it meant ending the game for them. This was even more die hard than I like to play.

At the other end of the spectrum for style of play, came the remaining 9 voters who prefer a style similar to the official campaign, or, for 1 voter, would like the game to guide them even more so. For those players, I hope my own design preference (minimal help) does not exclude them, because of the design parameters I have implemented that allows a player to finish a quest even if they make mistakes - unless, of course, they really bodge things up by ignoring all the warnings and indications of what may happen if they continued along their current path. That said, I have also made the decision that the main quest cannot be broken, even if a player does make it "difficult" for themselves.


dgraf said...

Lance - like you, I have been disappointed with the situation with sitting animations. I have tried quiet a few and always run into the problem of NPC's getting up when bumped into (or piviting into silly positions). If you figure it out, please drop me a line. My solution for Winter Promises is going to be to seat them against a wall where no one can bump into them!

Lance Botelle (Bard of Althéa) said...

Hi dgraf,

The two problems you mention are the exact same two I have: getting up when bumped into and swivelling "through" the seating when speaking.

At the moment, I have the NPCs take a seat again on a heartbeat if they get up. But the swivelling bit I was still looking into. (I am consdering having the seat swivel with the NPC as they turn). However, I am not sure it is worth the time trying to sort the problem out when there is so much else to do. I guess you know what I mean. :)

That said, I still have the "problems" listed in my notes to keep in mind and I am still keeping an eye open for potential solutions. I will let you know )and update the blog) if I find anything. Let me know if you do too. :)

I also thought about placing the seats against a wall, but I could not get a good feel about it. :(

Let's hope we find a solution. :)


Eguintir Eligard said...

Oh my god I can't believe everyone is having these problems and I solved this like 1 week into learning the toolset lol. Hopefully if I put it here you will all get this.

These are air TIGHT techniques.
So yes, manually place the NPC, and the chairs, set them to environment objects etc.

Now, set a local int for each direction, 1,2,3,4, and use setfacing to adjust their direction on each heartbeat.

Now to stop the speaking interruption: create a blank script and place it on their on conversation. The NPC will now ignore you and sit continously, never to walk again.

If you want you can script them to speak a one liner using float text, but dont use speak functions or they will turn again.

If anyone needs specific scripts and the "sitter" npc blur prints, email me on this account.

Eguintir Eligard said...

PS of course using the sit animation repeatedly on each HB as a just in case. Shouldn't matter though once you've done it once since nothing can interrupt them.

Lance Botelle (Bard of Althéa) said...

Hi Eguintir Eligard,

Nice idea for non-conversation NPCs, but, unfortunately, some of the "sitters", I wanted to have a conversation too.

That said, I suppose, I could simply make all the conversation NPCs remain standing and keep the sitters to a single random line randomised in a script (rather than from a conversation), like you suggest.

What happens if an object bumps into your seated NPCS? Surely they still stand up?

Your comments are greatly appreciated. :) It is funny how what one builder will have solved a while ago does not appear on another builder's list until later on. ;) As I say, this was my first time at looking at seated NPCs in all the while I have had NWN2. I suppose I had not considered it would be a problem having used ActionSit in NWN1 before.



Eguintir Eligard said...

It has been a wh ile since I used my sitters, but no, bumping does not make them stand up.

I hesitate to say this because it sounds over simple, but when using my scripts, I am pretty sure simply checking "bump state=unbumpable" stops you from bumping them to standing.

If you really want them to be conversable and not look at you, its just a bunch of work but its your option. Place a IP speaker in front of them and make sure every line they speak is toward that Ip speaker.

I always try to balance effort on my part vs visible/tangible benefit for the player and that does seem like a net loss to do all that.

What is really nice is to have fixed sitters who speak one of 10 random lines on the odd heartbeat. I have a library of wise sages making discoveries out loud and it its really ambient.

Shaughn said...


For sitting NPC I have a on spawn script that gets the animation string as a local string on the NPC. I set them a unbumbable so the PC can't push them. And I set their dialog orientation to false so they don't turn to face for conversations, The animation is played as a loop

sAnimation = GetLocalString(oTarget,"animation");

Lance Botelle (Bard of Althéa) said...

Hi Eguintir and Shaughn,

I had absolutely no idea that "bump state" referred to this. I always thought it was something to do with some special graphics setting. LOL!

And Shaughn, I did not know about the SetOrientOnDialog function either! (BTW, I was reading about your rock throwing giant again only the other day.)

It's amazing that after all this time of coding that two relatively simple functions existed that can resolve so many other things I have often thought about when considering conversations.

Thank you so much for sharing these two bits of scripting info. I know I won't be the only one who appreciates this. I know dgraf will also be interested.

And I agree about having the odd ambient line being spoken, although I want to make it the correct time and place.

Many thanks again.


dgraf said...

I will give this a "go" - thanks guys