NPC Portrait
4BOLTMAIN
Member Posts: 90
In the toolset there is a portrait setting for npc's in the creature properties basic tab but when using "ActionSpeakString" to have a npc say something in chat the selected portrait is not used in the chat window, it defaults to the po_hu_m_99 portrait.
Is there any way to change this?
Is there any way to change this?
0
Comments
Normally, the correct portrait is used, but, in some circumstances, the Unknown Speaker portrait appears. The same is true of conversations.
One case I've investigated is when the PC enters an area. For some reason, the engine treats the player location as (0, 0) until the OnEnter event is finished, and maybe a bit longer than that. I find that if you delay the remark by 2 seconds, all is well.
More generally, I suspect that portrait failure occurs when the PC can hear the NPC but can't see them, owing to no line of sight, fog distance, invisibility or whatever. The NPC may not speak at all if out of conversation range.
If it is really important for the PC to see and hear the speaker, you can either jump the NPC to the PC first, or create an invisible object with the correct portait at the PC location to do the talking. The latter doesn't work well for one-liners, though, as the text floats in the wrong place.
Maybe TALKVOLUME_SHOUT makes a difference? Worth trying.
All messages are TALKVOLUME_SHOUT and yes you are correct, the NPC is in an inaccessible area of the module. I just noticed that If I am (as DM) in the same area, the portrait displays as intended.
This particular NPC is used quite a bit for server messages like boss kills, boss spawns, rare spawns etc. so There are some cases where I would rather not use a 2 second delay. FYI I have never had this NPC fail to send a message to chat... it gets used a lot on my server.
I will try messing with some delays later today after I get some rest and reply with my findings.
The 2 second delay is strictly for area OnEnter events - it won't help after that.
I wrote some debug code and here is what I discovered... If the NPC's are walking waypoints or stationed with a post waypoint you must use
AssignCommand (oTalker, ClearAllActions(TRUE));
before
AssignCommand (oTalker, ActionSpeakString("Testing, Testing 1,2,3!",TALKVOLUME_SHOUT));
otherwise the message will never be displayed in chat.
Something else I discovered and was able to verify, as mentioned above, is that if you are not in line of sight to oTalker then the portrait will default to the generic one.
I wonder if this has been reported. Its not breaking the game but I am sure there are others like myself who would like to see this fixed.