Aller au contenu

Photo

No turn when spoken to


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

#1
andysks

andysks
  • Members
  • 1 652 messages
How can I make a creature not turn when I talk to it? I have a script in my library that looks like that.

void main()
{
SetOrientOnDialog(OBJECT_SELF, 0);
}

Pretty straightforward. It will work on an NPC when he has a heartbeat assigned let's say, or walks some scripted waypoints, but if he has some barks he will not speak them. I put this on the OnConversation slot by the way. Do I need to add one more line to it so that he carries on his duties but also speak his line?

#2
Morbane

Morbane
  • Members
  • 1 883 messages
try to AssignCommand

#3
Dann-J

Dann-J
  • Members
  • 3 161 messages
That script would work better as an OnSpawn script. There is already a hook in the default OnSpawn script that creatures/NPCs have, that looks for a local string called SpawnScript on the creature. Set the string value to match the name of the script.

#4
kevL

kevL
  • Members
  • 4 070 messages
just above the custom spawn hook, in 'nw_c2_default9' there looks to already be a way to do this:

if (GetLocalInt(OBJECT_SELF, "NX2_NO_ORIENT_ON_DIALOG"))
SetOrientOnDialog(OBJECT_SELF, FALSE);


Set a local_int on the creature "NX2_NO_ORIENT_ON_DIALOG" to "1"


never tried it tho... not sure if it stops barks
It needs MotB+ installed.

Modifié par kevL, 03 février 2014 - 12:16 .


#5
Dann-J

Dann-J
  • Members
  • 3 161 messages
Thanks KevL, that's good to know. The fewer scripts we need to write the better.

Turning off orientation on dialogue will work for any conversation, even bark strings. It also works for non-hostile creatures that have no conversation at all, who would otherwise turn to face you. Perfect for those stoic guards.

#6
kevL

kevL
  • Members
  • 4 070 messages
hey good pt.

> Perfect for those stoic guards.


that always irks me:
*click*



...

(like no-turn should be Default! ) almost

Modifié par kevL, 03 février 2014 - 02:54 .


#7
andysks

andysks
  • Members
  • 1 652 messages
I guess some NPCs in the OC use this variable. Like the announcer for evacuating Neverwinter.

I will try it later and see how it goes.

Modifié par andysks, 03 février 2014 - 05:05 .


#8
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 598 messages
If you just have a one-liner conversation then use this on conversation script:
// bb_noturn_convo
// by Brendan Bellina

// based on f100_noturn_convo from SoZ

// Prevents NPC from turning toward speaker when conversing
// Use as on conversation script

void main()
{
ClearAllActions(TRUE);
if (GetDistanceBetween(GetLastSpeaker(),OBJECT_SELF)<3.0f)
SpeakOneLinerConversation();
}

#9
andysks

andysks
  • Members
  • 1 652 messages
Hi Kaldor,
The SpeakOneLinerConversation... what happens if the NPC has no convo at all and he is just carrying a hb?
In any way, to explain a bit better. I first encountered this problem on a bartender. He is not walking, but stands behind his bar. On every hb, he will do something else. When you try to talk to him, he has some barks. Even though he carries on his activities on every hb, when I talk to him he won't speak. Your script will cause exactly this right?

#10
Tchos

Tchos
  • Members
  • 5 072 messages
I tried the NX2_NO_ORIENT_ON_DIALOG a few times, and it didn't work for me, so I generally make the call with the normal function for specific characters.

#11
kevL

kevL
  • Members
  • 4 070 messages
strange, it worked for me on pre-placed horse.

3 horses, only 1 with the var set. The other two turned, the third didn't


it might be the spawnscript, or if the creature is spawned-on-enterArea there might be different behavior

[edit] Or if you're doing an actual conversation (horses don't talk much..) other scripts/behavior might be kicking in

Modifié par kevL, 04 février 2014 - 11:00 .


#12
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 598 messages

andysks wrote...

Hi Kaldor,
The SpeakOneLinerConversation... what happens if the NPC has no convo at all and he is just carrying a hb?
In any way, to explain a bit better. I first encountered this problem on a bartender. He is not walking, but stands behind his bar. On every hb, he will do something else. When you try to talk to him, he has some barks. Even though he carries on his activities on every hb, when I talk to him he won't speak. Your script will cause exactly this right?


If your bartender has a conversation with barkstrings then he should speak one but will not turn. If you don't want him to speak at all then give him no conversation.  If you want him to have a conversation that doesn't work except with your hb then I suppose you will have to have your hb set a variable on him and on your conversation lines check for that variable and then clear it.

Regards

#13
andysks

andysks
  • Members
  • 1 652 messages
I just tried this on the bartender and it worked. The variable I mean.

#14
Kaldor Silverwand

Kaldor Silverwand
  • Members
  • 1 598 messages
Good to hear.