PlaySound Intermittent

Hi Everyone,

I hope this is the right place. It was the closest I saw to an Enhanced Edition Scripting forum.

This is my first post, although I’ve been reading the site for a while. I played WNW from launch years ago, did a few modules for myself and friends, but drifted away after a number of years. Picked it up again when I saw EE on Steam. I’m working on an adaptation of B2, and I’m having a problem triggering a sound from a conversation. Actually, it seems to be intermittent, which confuses the hell out of me.

So I have a gong with a trigger around it. When a player enters the trigger, it starts a conversation. On the second last line of the conversation, I have this script under “actions taken”

void main()
string sGong = “as_sw_x2gong1”;

SetLocalInt(OBJECT_SELF, "gong_hit", 1);


Except the gong sound doesn’t play when it should. So I checked the script was ok by putting it on the “OnUsed” slot of the gong, and when I use the gong, the sound plays.

Even stranger, the trigger worked for a few times, and then stopped working when I made a minor adjustment to the script (setting up the sGong variable), but didn’t work again when I reversed the change. The Lexicon doesn’t say anything about the function being buggy. Does this have something to do with PlaySound being treated as an action?

Sorry, NWN, not WNW. Bloody fingers.

1 Like

It sounds like you are making something for NWN:EE and not NWN2, or am I mistaken?

If you are working with NWN2 nonetheless, check out this thread. Even if you’re in NWN:EE this might help:

EDIT: If you don’t want to read you could try something like this:

object oPC = GetPCSpeaker();

object oPlaceable = GetNearestObjectToLocation(OBJECT_TYPE_PLACEABLE, GetLocation(oPC));

AssignCommand(oPlaceable, PlaySound("gong_hit", TRUE));

You need a placeable nearby then (which you have with the gong already) so I think it should work.

Thank you, that worked perfectly. Better yet, it seems to be consistent. I think putting it in the action queue made the difference.

While I have you, I noticed that in EE there’s no TRUE/FALSE flag on the PlaySound function, which reminds me of the question, where do I go for EE scripting on this site? Unless I somehow missed it, there’s no EE section, only NWN1 and NWN2. Is one closer to EE? Also, how does hakpak and module compatability work? I know that a few modules I’ve downloaded haven’t worked, would be nice to know which version module will reliably work with EE.

Thanks again for your help with the script. Relived a few days of frustration trying to make that work.

I have never dealt with EE. I only own NWN1 Deluxe Edition and NWN2. NWN:EE is a new version of NWN1. Sadly (IMHO) you can’t buy NWN1 original version anymore. Thankfully I still have my old discs. I played NWN1 a lot before (back in around 2004-2010 or so) but I don’t play it anymore. Still, even though I haven’t installed NWN1 on my Win10, I have it on an old hard drive and I can still play it from there oddly enough.

So NWN:EE is just NWN1 with lots of new features, but I’ve heard it has come with quite a few bugs as well. At the moment I’m only creating modules for NWN2, I don’t play it. There are so few new modules being created for NWN2 nowadays anyway.

If you post and check here with questions for NWN1 stuff it mostly involves EE, I think. And there IS an EE section so…It’s called Neverwinter Nights Enhanced Edition. Clear as day to me if you want to create a thread, at least to me. Don’t know why you can’t see it. Bottom line, NWN2 has nothing to do with EE, and there is no EE for NWN2, but since there are tons of new stuff to download for NWN2 to make it shine it doesn’t matter. I found NWN2 quite ugly when it came out in 2006 and I bought it on release day. NWN1 looked way better than NWN2 back then. Now there’s so much stuff to download graphic-wise that has improved the look of NWN2 that I personally feel it quite superior to NWN1, but that’s just me. I just like the more cinematic feel and look of NWN2. The cutscene mode, for example, with people talking and moving their mouths is a huge deal for me, and now I have the amazing 4760 doing animations for me so…

Edit: I have looked at screenshots of EE and thought of buying it but…from the screenshots it looks roughly the same as the old NWN1 game, so I don’t feel the need to buy this game again. If I had been creating stuff for NWN1 then that would perhaps been another matter since they have lots of new (I think) scripts and stuff, so maybe you can do more things with the game nowadays.

FWIW Look here for a list of all the changes in the EE version of NwN.


Got it, thanks for the breakdown and the link(TR). I did find the EE forum, under the main NWN1 forum. I was looking for it at top level with NWN1 and NWN2, but after your explanation it makes sense where it is. I assumed EE was an update of NWN2, which I thought was just an update of NWN1. I didn’t realize NWN2 was so different.

Yes, NWN and NWN2 are two different games altogether. However, when it comes to scripting a lot is similar. You can see the difference quite clearly in the graphics for example here:

The main campaign in NWN2 continues the story that was told in the NWN main campaign (if I remember correctly, since I haven’t played the NWN2 OC since 2006).

1 Like