Aller au contenu

Photo

How to keep a good drunk down.


  • Veuillez vous connecter pour répondre
22 réponses à ce sujet

#1
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
I've got some drunk NPC's that keep getting up when the PC tries to talk to them.  I am trying to script them to stay down even if the PC Left-clicks them. 

I've tried the sleep effect, paralyze effect, the CustsceneParalyze effect and all fail.  They allow the NPC to pop right up when the PC tries to talk to them. 

Thoughts?

#2
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
You could place an i-point near their head, and then have a trigger around the NPC that starts the convo with the i-point. Alternatively, you could do a custom on-conversation script that starts a convo between the i-point and the PC rather than with the NPC.

#3
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
Thanks for the response. I was not clear about what I want to do. I don't want to have a conversation with the drunk while it is on the ground, I just want to make it where the PC cannot talk to the drunk. I just want the drunk to lay there and be drunk. The problem is, if the PC clicks on the drunk, it stands up.

#4
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
I figured it out. I applied a sleep effect then the visual effect VFX_DUR_FREEZE_ANIMATION. I made them bother permanent and it seems to work.

#5
Dann-J

Dann-J
  • Members
  • 3 161 messages
There is a flag you can set on creatures that prevents them turning towards the PC when you try to initiate dialogue. I can't remember it off-hand, but it was used in the scripts for turning creatures into statues that were posted at one NWN2 forum or another (which narrows it down slightly!). I'm using it in a script of my own, so I can check what it is when I get home this evening (unless someone else replies in the mean time).

#6
Orion7486

Orion7486
  • Members
  • 161 messages
If you put this script in the onconvo event, the npc will do nothing when left clicked on:

void main()

{



}


#7
MasterChanger

MasterChanger
  • Members
  • 686 messages

Orion7486 wrote...

If you put this script in the onconvo event, the npc will do nothing when left clicked on:
void main()
{

}


Yeah, I think you pretty much want to strip as many of their events as you can. I'm pretty that's actually what the statue script DannJ is referring to does.

#8
Dann-J

Dann-J
  • Members
  • 3 161 messages
No - there is a flag that can be set to TRUE/FALSE that enables or disables a creature turning when a PC tries to initiate conversation (even if they don't actually have a conversation).



If you set this flag to FALSE, you could trigger some random bark string conversations from the drunks, while not forcing them to stand up and face you. You could have a series of Zs (if they are asleep), something completely incoherant, or perhaps play a belching sound effect.

#9
M. Rieder

M. Rieder
  • Members
  • 2 530 messages

DannJ wrote...

No - there is a flag that can be set to TRUE/FALSE that enables or disables a creature turning when a PC tries to initiate conversation (even if they don't actually have a conversation).

If you set this flag to FALSE, you could trigger some random bark string conversations from the drunks, while not forcing them to stand up and face you. You could have a series of Zs (if they are asleep), something completely incoherant, or perhaps play a belching sound effect.


Can I make them fart?


Great to know that works.  I looked at that flag and ignored it, thinking that it only affected the turning.  So it will keep them from standing up too? *AND* I can make them fart and snore?  Now if I can just make them give each other wedgies and draw lewd pictures on the forehead of their unconscious friends in magic marker, then I'll be headed for the hall of fame for sure!

Modifié par M. Rieder, 11 janvier 2011 - 01:11 .


#10
M. Rieder

M. Rieder
  • Members
  • 2 530 messages

MasterChanger wrote...

Orion7486 wrote...

If you put this script in the onconvo event, the npc will do nothing when left clicked on:
void main()
{

}


Yeah, I think you pretty much want to strip as many of their events as you can. I'm pretty that's actually what the statue script DannJ is referring to does.



I tried simply deleting the script for "on conversation" and it didn't work.  I never tried substituting a blank script.

#11
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
I believe SetOrientOnDialogue() is the function you were referring to.

#12
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
This is odd. I re-wrote my script and now simply applying a sleep effect worked. Now that I think of it, before I had deleted the script in the "on conversation" line. I guess with that gone, sleep didn't keep the NPC from talking, but now that the script is back, it does. That's my best guess.

#13
Dann-J

Dann-J
  • Members
  • 3 161 messages

M. Rieder wrote...

I believe SetOrientOnDialogue() is the function you were referring to.


Yes! That's the one.

It's a pity they took the farting sound effect out for NWN2. I believe it existing in NWN1 (called something like 'flatus.wav' I think). At least NWN2 has a nice long burp though... :)

#14
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
NWN2 has a burp? I'm there. I'm sure one of our many voice actors could supply a good fart. But that's not really "voice" acting, is it?

#15
Shallina

Shallina
  • Members
  • 1 011 messages
ok here the deals.



The default conversation clean all the effect on the 2 objects in conversation before the conversation to be sure that the conversation can start.



You have 2 possibility for keeping your drunk in a drunk state.



1 loop the animation in the drunk heartbat

2 change the default conversation script so they won't clean the effect on him.

#16
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
Thank you Shallina, that is very helpful. I didn't know the convo script did that. Good to know.

#17
Dann-J

Dann-J
  • Members
  • 3 161 messages

Shallina wrote...
The default conversation clean all the effect on the 2 objects in conversation before the conversation to be sure that the conversation can start.


In the module I'm working on, it's possible to talk to a 'statue' creature (animations frozen, SetOrientOnDialogue=FALSE, stoneskin effect) without it changing posture. This is the guts of the OnSpawn script, from one created originally by Brendan Bellina:

#include "NW_I0_GENERIC"
void main()
{
object oTarget = OBJECT_SELF;
effect eFreeze = SupernaturalEffect( EffectVisualEffect( VFX_DUR_FREEZE_ANIMATION ) );
ApplyEffectToObject( DURATION_TYPE_PERMANENT, eFreeze, OBJECT_SELF );
SetOrientOnDialog(oTarget, FALSE);
SetBumpState(oTarget, BUMPSTATE_UNBUMPABLE);
}

You'd have to apply a looping prone animation to oTarget first, then delay applying the freeze effect by a fraction of a second, so that the drunk was frozen while lying down. You should then be able to talk to him or her without them even flinching.

#18
Shaughn78

Shaughn78
  • Members
  • 637 messages
I have used this script (it is part of a larger script, only posted the velevant part) to set animation on NPCs. It applies a looping animation, prevents the turn with dialog and makes them unbumpable (so the player can't push them around).
Generally I use it on a client enter and loop through all the NPCs and apply the different animations. If modified it can be used on a trigger or as a custom spawn script.

object oTarget = GetFirstObjectInArea(OBJECT_SELF);
object oArea = OBJECT_SELF;
string sAnimation;

while (GetIsObjectValid(oTarget))
{
sAnimation = GetLocalString(oTarget,"animation");

if (sAnimation != "")
{
PlayCustomAnimation(oTarget,sAnimation,1,1.0);
SetOrientOnDialog(oTarget,FALSE);
SetBumpState(oTarget,BUMPSTATE_UNBUMPABLE);
}
oTarget = GetNextObjectInArea(oArea);
}


Another thing you can do is create a simple ssf for the drunk. Burps, farts or snoring. So when players click on them they get those noise effects while the drunk lays on the ground. I did that with the injured people in Risen Hero.

Modifié par Shaughn78, 14 janvier 2011 - 12:10 .


#19
Dann-J

Dann-J
  • Members
  • 3 161 messages
That's even better than freezing them - provided the looping animation you use has some movement in it (breathing, etc). Otherwise the outcome would be much the same.

Modifié par DannJ, 14 janvier 2011 - 03:05 .


#20
M. Rieder

M. Rieder
  • Members
  • 2 530 messages

Shaughn78 wrote...

I have used this script (it is part of a larger script, only posted the velevant part) to set animation on NPCs. It applies a looping animation, prevents the turn with dialog and makes them unbumpable (so the player can't push them around).
Generally I use it on a client enter and loop through all the NPCs and apply the different animations. If modified it can be used on a trigger or as a custom spawn script.

object oTarget = GetFirstObjectInArea(OBJECT_SELF);
object oArea = OBJECT_SELF;
string sAnimation;

while (GetIsObjectValid(oTarget))
{
sAnimation = GetLocalString(oTarget,"animation");

if (sAnimation != "")
{
PlayCustomAnimation(oTarget,sAnimation,1,1.0);
SetOrientOnDialog(oTarget,FALSE);
SetBumpState(oTarget,BUMPSTATE_UNBUMPABLE);
}
oTarget = GetNextObjectInArea(oArea);
}


Another thing you can do is create a simple ssf for the drunk. Burps, farts or snoring. So when players click on them they get those noise effects while the drunk lays on the ground. I did that with the injured people in Risen Hero.


to make an ssf, do you have to make a hak or mess with any 2da's or is it more like making a blueprint?

#21
Shallina

Shallina
  • Members
  • 1 011 messages
you don't need a hak (you can drop it oin the mod or campaign directory) but you need to mess with a 2da to refer the ssf file at some point.

#22
Shaughn78

Shaughn78
  • Members
  • 637 messages
I used sqeeself's Soundset Editor. The editor has a number of sound options, most are for a playable soundset. For a simple soundset you just need battlecry1, Attack Grunt1, Pain Grunt 1, Death, Selected. So there are a few options of where to place the farts and burps.

The new soundset needs to be added to the soundset.2da. You may be able to get around actually editing the 2da. Looking at the soundset 2da there are a number of empty soundsets left over from NWN1 and it's expansions. The first one is "Archhound" you can create the ssf that it references "c_archhond". You will not have a properly labeled drunk soundset but it should prevent the need for a HAK.

Modifié par Shaughn78, 14 janvier 2011 - 02:39 .


#23
Dann-J

Dann-J
  • Members
  • 3 161 messages
Rather than mess about with sound sets, it would be easier to create a generic conversation full of one-line bark strings, using the 'GC_Rand_1of' check to randomly select a response:

http://nwn2stuff.blo...g-response.html

Every drunk could have the same conversation. With enough responses to randomly choose from, there shouldn't be too much repetition.

Modifié par DannJ, 18 janvier 2011 - 02:38 .