Making a Bard sing a specific song

Is there a way one can script it so that when the bard uses his song it can reference a specific song you choose from say a menu?


A conversation pops up and you get to pick a custom song from three options:

  1. 2)…

Also, instead of singing a song…instead play an instrument as another option where you actually hear that instrument in game play that tune




flute, piano, cello, pan flute, bongo, drums, tambourine, etc

Is it possible to do this? If so how?

So maybe it would look like this:


What would you like to do?

Play an instrument

Sing (submenu in conversation)

Play an instrument (submenu in conversation)

Violin (3 options)
Piano (3 options)
Lute (3 options)

I found animations for some of these on the vault, but Proleric said they do not work in NWN:EE because SetPhenoType() was bugged in EE.

It would be fun to sing some real great inspiring songs during battle or even funny songs

Would be great to match a musical pheno too with those songs or instrument.

Perhaps if an instrument is used to play (hard to fight while playing an instrument) he forfeits fighting so that the bard gains an extra benefit using the instrument in hand (use unique item) to gain a bonus to the bard song.

I did something like this in my recently released module for NWN2. I had a conversation where you could choose the instrument (if you were a bard that is, otherwise you’ll never get this), then I ran the stock script ga_music_set (maybe that’s available for NWN1 as well?) on the node, and a simple script where I jumped the PC to a waypoint and ran the animation for the instrument of your choice. As usual I have no idea if this would work on NWN1, but…well, the script for jumping the PC and playing the animation was something like this:

void JumpPC(object oPC)
	object oWP = GetObjectByTag("bardperform");

	AssignCommand(oPC, ClearAllActions());
	AssignCommand(oPC, ActionJumpToObject(oWP));


void PlayCustomAnimationVoid(object oObject, string sAnimation, int iLoop = 0, float fSpeed = 1.f)
	PlayCustomAnimation(oObject, sAnimation, iLoop, fSpeed);

void main()

object oPC = GetFirstPC();









The stock script in NWN2 (ga_music_set) for playing the music of your choice looks like this:

// ga_music_set
   Set background music in current area to track nTrack
   nTime will have the following effects:
   nTime = 0: Change both Day and Night tracks
   nTime = 1: Change Day track only
   nTime = 2: Change Night track only
   As of 8/23/06, this was the track indexing.  The latest can be found in ambientmusic.2da.
   0. NO MUSIC
   From NWN1:					
   1.  rural day
   2.  rural day 2
   3.  rural night
   4.  forest day
   5.  forest day 2
   6.  forest night
   7.  generic dungeon 1
   8.  sewer
   9.  mines 1
   10. mines 2
   11. crypt 1
   12. crypt 2
   13. evil dungeon 1
   14. evil dungeon 2
   15. slums day
   16. slums night
   17. docks day
   18. docks night
   19. city wealthy
   20. city market
   21. city night
   22. tavern 1
   23. tavern 2
   24. tavern 3
   25. rich house
   26. store
   27. good temple
   28. temple evil
   29. nwn1 theme
   30. nwn chapter 1 theme
   31. nwn chapter 2 theme
   32. nwn chapter 3 theme
   33. nwn chapter 4 theme
   34. rural battle 1
   35. forest battle 1
   36. forest battle 2
   37. dungeon battle 1
   38. dungeon battle 2
   39. dungeon battle 3 (stinger)
   40. city battle 1
   41. city battle 2
   42. city battle 3
   43. city boss battle
   44. forest boss battle
   45. lizard boss battle
   46. dragon boss battle
   47. aribeth boss battle
   48. end boss battle
   49. good temple 2
   50. castle
   51. aribeth good theme
   52. aribeth evil theme
   53. arren gend theme
   54. maugrim theme
   55. morag theme
   56. tavern 4
   From NWN1 Expansion 1
   57. desert battle
   58. desert day
   59. winter day
   60. winter battle
   61. desert night
   From NWN1 Expansion 2
   62. x2 Theme
   63. waterdeep theme
   64. undermountain theme
   65. rebel camp 
   66. fire plane
   67. queen (?) theme
   68. frozen hell
   69. dracolich
   70. small battle
   71. medium battle
   72. large battle
   73. hell battle
   74. boss battle 1
   75. boss battle 2
   From NWN2
   95.  west harbor theme
   96.  githyanki theme
   97.  githyanki battle 
   98.  west harbor blown up
   99.  swamp
   100. docks battle
   101. docks battle looped
   102. dungeon
   103. neverwinter theme
   104. neverwinter interior
   105. west harbor attack
   106. back alley
   107. king of shadows combat
   108. king of shadows theme
   109. village
   110. sunken flagon
   111. crossroad keep theme
   112. illefarn ruins theme
   113. murder
   114. ammon jerro theme
   115. back alley battle
// EPF 8/23/06

const int TIME_BOTH = 0;
const int TIME_DAY = 1;
const int TIME_NIGHT = 2;

#include "ginc_sound"

void main(int nTrack, int nTime)
	object oPC = GetPCSpeaker();
	object oArea = GetArea(oPC);
	if(nTime == TIME_BOTH || nTime == TIME_DAY)
	if(nTime == TIME_BOTH || nTime == TIME_NIGHT)
		MusicBackgroundChangeNight(oArea, nTrack);

OBS! You need to set the local int through the dialogue and the stock script ga_local_int first. I would guess you have that stock script for NWN1?

1 Like

As a starting point take a look at my - AllTalk - and run the demo to see if it roughly does what you want. As it stands, no scripting is required.


1 Like

Hey thanks guys…I will look into this.

andgalf…I was thinking more of playing custom music rather than the music found in the game. Then I would need to know how to make custom music files to reference.

Boy…both of your scripting is amazing.

andgalf…I might use your script for my tavern jukebox to choose songs. But when you “jump to”…what do you mean?

EDIT: when you mean jump to a way point…the PC gets teleported to a waypoint where there are instruments to play in a certain phenotype? I wouldn’t want that because I’d want my PC to play his/her instrument where he/she is. To go into combat playing it or singing it.

Don’t even know what that is :frowning:

Is it possible to get a conversation like I suggest above on the instrument (cast spell: unique item property) to activate the conversation that would allow you to play the instrument and go into the phenotype of the above vault entry I put a link to?

And in the script have it use the bard song…activate bard song like this? So you get the effects of bard song?

Eh… now it gets overly complicated again. Don’t know if I can help with this.

Don’t know exactly what you mean with “that would allow you to play the instrument”? So this is all part of combat, you mean? If it is, then it gets a lot more complicated than just performing a song of your choice (use music that you have available for your module and make adjustments to ambientmusic.2da).

You don’t have the stock script ga_local_int in NWN1?

Not sure how it works in NWN2

But in NWN:EE one can “use item” property to activate a script to run. I know one can activate a conversation from a placeable, but not sure if this can be done on an item.

If it can…then the conversation I can handle. I just need the script to say:

Play instrument - get this result from options

Sing - choose which songs

I would thn just need to know how to create (convert a custom song or music) into a file to play

In NWN2 you can place a script on a particular node in a conversation. You can’t do that in NWN1?

EDIT: It’s one thing to run a script through the activation of an item. We have that in NWN2 too, but what I mean is just use a script inside a conversation on a node.

nope…I could not find a script by that name in the game. I just checked

Not sure to be honest. I just know about on activate item :frowning:

If you open up a conversation, you have something called Actions Taken, and under there Script. My guess is that would be the equivalent of NWN2s system of doing things, where we have a slot called Actions and Conditions.

Maybe there’s a tutorial you can check about how you do things like this. Sounds way easier than doing it by activating an item. Then you can have a script firing an animation without needing to (I think) use a different phenotype (or whatever you called it).

But It would require equiping the instrument I would think. I can do a conversation from there.

Is this what you mean? From the conversation menu

Yes, I have the NWN1 toolset up now, looking at this confusing stuff. I’m just guessing since I’ve never worked in NWN1. I only own the original discs and have the old Deluxe Edition of the game installed on one of my oldest harddrives. So I can open the toolset, but I don’t understand a thing since it looks so different from the NWN2 toolset and there seem to be so many great things missing that I’m used to.

Ah bummer :frowning:

Ah, looking at your screenshot you seem to have in EE something that’s not available in the original game, where you have name and value. I guess (really guessing now) that you could maybe put an integer there into a script?

But I think I can do the conversation from the item…I think. All I need is the scripting to allow me to chose the music…then I need to learn how to get custom music/songs into the game.

But I think I can do the conversation from the item…I think. All I need is the scripting to allow me to chose the music…then I need to learn how to get custom music/songs into the game.

I guess (really guessing now) that you could maybe put an integer there into a script?

Don’t know