Hi all, I could just ask if anyone has a script for this, but I was hoping to ask something a bit more broader so I have more of an understanding of how these things work.
I would like to have the music change when the player walks down a path. I am assuming that the best option is to do it from a generic ground trigger to change the music playing when I step on it? I managed to make a trigger that stops the current song. That was easy. I made the ground trigger and then in the "On Enter Script" I just used the "ga_music_stop" script from the drop down.
But now I want to set the music, and I found the "ga_music_set" script, but I would somehow need to specify which song that script uses. Now this is where my question is a bit broader. I have used this exact script in a conversation, and it worked easily because as an action script in a conversation, it adds the string and integer boxes for me so that's easy. But for me to have the script fire from a ground trigger, how would I specify the song?
But I am still hoping to know if I even need to use a custom script like that. Is there a way to fire one of the scripts that come with the toolset and specify an string/integer without modifying it? For example could I just use the "ga_music_set" in the "On Enter Script" of a generic trigger and then type something after it to specify the string/integer? Or does it not work like that?
Make sure you also save before setting and restore your music, otherwise, the music you set will continue to play in this area, replacing your default theme forevar. Not sure how you do it from regular scripts, but the sequence of the ga_ actions in a convo is:
ga_music_save (save current track) ga_music_stop (stops current theme) ga_music_set (changes the music) ga_music_start (kicks music off) ga_music_stop (stops the music) ga_music_restore (restores the default value of music) _________________ Bishop's Romance and Other NWN2 Mods Companions for IWD2
Saving the default music should be another local int.
On the trigger's varialbes enter "music" and the the line number for the new music. Then using some conditional checks in the script to change it back and forth between the default and new music. The below checks just switches between the two based on what one is playing.
Thank you both of you, very kind I got it working and it's great I especially like the "ga_music_save" feature so I can get back to the original song after I play the new one briefly.
As I was trying to explain above, it's a shame that these things can't be done without making custom scripts. Because if you are in a conversation, it is sooooo easy to do things like this. Not just music, but everything. When you run a script in a conversation, it generates string and int boxes for you to type in whatever you want, and then it makes the script for you.
But if you want to do the exact same thing, but not in a conversation, then it requires writing your own script. Maybe that is no big deal for most people though, but if you don't know scripting it is a problem. What would make life so much easier, is if adding a script to things like onLoad, onDeath, onOpen, onClick etc..etc.. you could do it the same as in a conversation. Because currently you can select a script to run, but it won't work because none of the int's and strings are specified.
Does that make sense?
In a way it is good because I am going to learn how to make simple scripts like these, but it is something I was a bit surprised by.
There are a few global scripts similar to the conversation scripts.
gp_ are for placables gtr_ are for triggers
There are a very limited selection. But learning how to do these small scripts is part of the learning process that will give you the skills, knowledge and confidence to try the more complicated scripts to bring your game to life.
Thanks again, and yes you're right. I really need to learn the scripting. It actually isn't scaring me any more. At first I was terrified of it but now that I've looked at about a hundred scripts, I think I am starting to get a feel for it
Something I only recently realised is that you can open an existing script and then modify it. That is a big help to me too. I'll spend some time learning scripting better eventually, but for now I have just been focusing on getting all the basics built.