Leaderboard


Popular Content

Showing content with the highest reputation on 11/29/2018 in Posts

  1. 1 point
    That is declaring a variable for substitution in the main body of the script. It is perfectly valid. It's not strictly necessary in such a short script, but it's very handy in longer, more complex scripts, thus a useful habit to get into. It also tends to make things much more user-friendly when reading through a script, as it reduces the amount of nesting.
  2. 1 point
    There are script commands to stop current sounds and music and play something else. One approach you could try would be defining your custom track in a UTS (see one of the vanilla modules for an example, under Blueprint, Sound in KTool). Then in your encounter you'd need to fire the script through dialogue or a trigger perhaps. Something like: void main() { object oEbMusic = GetObjectByTag("UTS_TAG_HERE", 0); MusicBackgroundStop(GetArea(GetFirstPC())); AmbientSoundStop(GetArea(GetFirstPC())); // This is optional, depending on the area. DelayCommand(0.5, SoundObjectPlay(oEbMusic)); } Then you'd need a second script at the end to restart the original music/sound. If it's a cutscene, you could fire that script through dialogue again. If it's just a straight combat encounter, perhaps through the OnDeath script of the creature (someone more experienced with such things would need to chime in about that). void main() { object oEbMusic = GetObjectByTag("UTS_TAG_HERE", 0); SoundObjectStop(oEbMusic); DelayCommand(0.5, AmbientSoundPlay(GetArea(GetFirstPC()))); //Only if you stopped it in the first script DelayCommand(0.5, MusicBackgroundPlay(GetArea(GetFirstPC()))); }
  3. 1 point