Forums
Games
Cyberpunk 2077 Thronebreaker: The Witcher Tales GWENT®: The Witcher Card Game The Witcher 3: Wild Hunt The Witcher 2: Assassins of Kings The Witcher The Witcher Adventure Game
Jobs Store Support Log in Register
Forums - CD PROJEKT RED
Menu
Forums - CD PROJEKT RED
  • Hot Topics
  • NEWS
  • GENERAL
    THE WITCHER ADVENTURE GAME
  • STORY
    THE WITCHER THE WITCHER 2 THE WITCHER 3 THE WITCHER TALES
  • GAMEPLAY
    THE WITCHER THE WITCHER 2 THE WITCHER 3 MODS (THE WITCHER) MODS (THE WITCHER 2) MODS (THE WITCHER 3)
  • TECHNICAL
    THE WITCHER THE WITCHER 2 (PC) THE WITCHER 2 (XBOX) THE WITCHER 3 (PC) THE WITCHER 3 (PLAYSTATION) THE WITCHER 3 (XBOX) THE WITCHER 3 (SWITCH)
  • COMMUNITY
    FAN ART (THE WITCHER UNIVERSE) FAN ART (CYBERPUNK UNIVERSE) OTHER GAMES
  • RED Tracker
    The Witcher Series Cyberpunk GWENT
THE WITCHER
THE WITCHER 2
THE WITCHER 3
MODS (THE WITCHER)
MODS (THE WITCHER 2)
MODS (THE WITCHER 3)
Menu

Register

Battle music depending on enemy

+
N

nayava

Senior user
#1
Sep 7, 2008
Battle music depending on enemy

It annoys me a little bit, that the battle music I selected in the area properties is never played. The problem is that the played battle musik does not correspond to the character and the situation. Geralts fights against a simple member of the order, a boss music is active. He fights against a boss, the simple salamandra thug music is active. Someone knows how I could avoid this?
 
N

nayava

Senior user
#2
Sep 19, 2008
Has really nobody a solution for this atmosphere killer?
 
N

nayava

Senior user
#3
Sep 29, 2008
No one? How do you solve this in your adventures?
 
G

Gamewidow

Forum veteran
#4
Sep 29, 2008
i'm only guessing here, but have you considered setting the battle music to none and then using a script to call the appropriate music file from the On Battle Start field ? (remember .. i'm guessing here!)
 
R

ralf1731

Senior user
#5
Sep 29, 2008
hi,mmm.. without garanty: Set a script in the Charakter (Boss for example: if GetIsInCombat == 1)object oArea = GetArea(OBJECT_SELF);MusicBattleChange(oArea, 36);(36=Track) = If that script working in djinni, it must be possible to set to every boss a different music.
 
N

nayava

Senior user
#6
Sep 29, 2008
I tried it. It does not work.
 
R

ralf1731

Senior user
#7
Sep 29, 2008
@NayAva I tried it. It does not work.
Click to expand...
Ok - i tried it by myself and it doesnt work!void main(){object oArea = GetArea(OBJECT_SELF);if (!GetIsInCombat(OBJECT_SELF)){MusicBattleChange(oArea, 57); [57=mus_bat_boss3]}}1. I dont know, the track is right. From what directory, DJinni take the music? (Tracks are in the 2da-Datei: ambientmusic.2da)2. I lay the script in the "On Attack Begin" - field of the character and set "Script set" to Custom. The result was that the enemy not more attack. Very strange... - Ahh, ok i see, Djinni needs a script for... (Where are all the scripts for: forEx: def_onattacked.nss. I dont find in any directory.)3. I lay the script in the "On user defined" - field. Nothing happend!Mmm, im a little out of ideas...Edit: Now i see an other problem. My music doesnt play anymore, nor in my mod or in main-game. Music is turned on. I give up for today. If anybody has/had the same problem, pls give me an info. I dont want install anymore...
 
A

ailinon

Senior user
#8
Sep 30, 2008
I find it slightly odd. You're checking the area for combat state..? Shouldn't you be checking the player, using GetFirstPC() ?
 
R

ralf1731

Senior user
#9
Sep 30, 2008
@Ailinon find it slightly odd. You're checking the area for combat state..? Shouldn't you be checking the player, using GetFirstPC() ?
Click to expand...
No - the script lay in the character. So the Charakter NPC =OBJECT_SELF.So i checking the NPC for combat. If you check the PC, would be wrong. Could be in an other fight.
 
A

ailinon

Senior user
#10
Sep 30, 2008
Oh, I'm blind, sorry. It's early. :pAlso, "user-defined" scripts are a bit different than normal event scripts. You need to check what event they responded to - using, in this case: if (GetUserDefinedEventNumber()==CN_USER_ON_ATTACK_BEGIN) { ..... }And yes, you do need a user-defined script here. It's either you write your own script sets and not use "default" (hint: bad idea, broken AI) or you write everything user-defined.And why does it check if the NPC is not in combat?
 
R

ralf1731

Senior user
#11
Sep 30, 2008
And for what in heaven i can change "Default" to "Custom"? ::)But why can i not set the script in f.E. the "On Attack Begin" - field. So i wouldnt need the "if (!GetIsInCombat(OBJECT_SELF))" ?Or i rewrite the script "def_onattacked.nss" with the addon "MusicBattleChange(oArea, 57); ". But dont know, where that script is?
@Ailinon And why does it check if the NPC is not in combat?
Click to expand...
if ...else{MusicBackgroundChangeDay(oArea, nMusicDay); [Default music for area]MusicBackgroundChangeNight(oArea, nMusicNight);}or you set this in OnDeath - Character field. If it would be possible...
 
N

nayava

Senior user
#12
Sep 30, 2008
Is not the biggest problem that MusicBattleChange(oArea, 57); does not change the battle music?
 
R

ralf1731

Senior user
#13
Sep 30, 2008
@NayAvaIs not the biggest problem that MusicBattleChange(oArea, 57); does not change the battle music?
Click to expand...
i dont know. i can not test, my music dont play anymore... maybe my 5. installation will solve the problem temporary :sleep:in polish forum they discuss the problem too. But cant the language, and dont know it works.-------------------------------------Petterros,MusicBattleChange(GetArea(GetFirstPC()), 59); - 59 to numerek z muzyka, ktora chcesz wybrac, z listy ambientmusic.2daDeath13,-------------------------------------
 
A

ailinon

Senior user
#14
Sep 30, 2008
That's just an explanation how MusicBattleChange is used.Scriptset can be set to "custom" to enable all the OnSomething fields - otherwise the Default script set overrides those. But, if you want the character to fight or do any nice AI actions, you need the Default scripts, and just put all your own scripting in the User scripts.-- Sinus
 
R

ralf1731

Senior user
#15
Sep 30, 2008
ya i know. i looked in the 2da and see there all values. In default are a few scripts and so i thought, i can set that scriptsin my own charakter and modify that scripts in the "Custom"-area. So it is not possible to create a NEW character and set Default and he attacks. I need always a proscripted template. But anyway, that is not the topic. Thanks for all, now i want go on with my mod and in the evening with new install grrr.Such gimmicks like change music are far away from just now ;) later...So - back to the roots :peace:c y.EDIT: One more thing!I thought that im clever ;) when i change the "creaturescripts.2da".I added 1 line with exact the same like in the "Default".7 test_change_music def_onatkbegin def_onblocked def_convers def_ondamaged def_ondeath def_ondisturbed def_endconv def_onecr def_onheartbeat **** def_onperception def_onattacked def_onrested def_onspawnin def_onspellcast def_onwitness def_oninternalAfter that i changed in the NPC-Rider from "Default" to "test_change_music". All is fine. The NPC attack and speak, etc. Except the battle-music dont turn on. When i change back to the "Default", the battle-music turn on. Now im realy out of ideas :)
 
N

nayava

Senior user
#16
Oct 8, 2008
It looks like the def_oninternal file is responsible for the changing of the music. When remove it from the default entry, the music do not change any more, when I enter a battle. But I do not find the line that is responsible for this. So I but the def_oninternal script from m1 into my module so that I can try erase on line after another till the music does not change any more. But unfortunately the script from m1 can never be compiled (inc_ai.nss not found). Even when I have not changed anything. -.-
 
N

nandusso

Senior user
#17
Oct 8, 2008
Sometimes djinni does so. Have you tried to close and reopen it? Or to import into your module the file inc_ai?I'm sorry if it's obvious. :)bye
 
R

ralf1731

Senior user
#18
Oct 8, 2008
@NayAva It looks like the def_oninternal file is responsible for the changing of the music.
Click to expand...
I thought so too, but now im not so sure anymore. I dont see anything with music except the /#include "inc_musicans"/.But this script is not responsible for the combat-music. Say, if it is wrong ???I can compile the script without problems, ok not exacty without, but djinni dont like me, i know.i can only compile with shorter name of file: def_onint01Sorry, thats all what i figured out.
 
N

nayava

Senior user
#19
Nov 14, 2008
I really do not understand it. Why the music which is selected in the areas properties can not be played!?Today I noticed another detail that looked like it could be responsible for the battlemusic. In creprofiles.2da is a column called BattleMusicId. I though I finally found it, but no. Changing the Id does not effected anything. -.-
 
K

Kageru

Senior user
#20
Jan 30, 2009
It's been a while... Someone has found a solution? If no, I have one.1. Open ambientmusic.2da file.2. Let's say you want to change music for monsters. Find 2nd line and in Resource column write the name of your song. If you want to have a few new songs for monsters, f.e. battle_music1.ogg and battle_music2.ogg, then in Resource column write battle_music1:2. You can also add your pieces to original ones - their names are mus_bat_monster1:3, so you need to name your song mus_bat_monster4 and change entry in 2nd line to mus_bat_monster1:4I checked it only for monsters, but I'm sure it works the same for humans, bosses, etc. You just have to find right line in ambientmusic(1 to 5 probably).
NayAva said:
I really do not understand it. Why the music which is selected in the areas properties can not be played!?
Click to expand...
It don't work, because you select music for area here and it's actually useless, because music is ascribed to creatures, not areas. But why REDs put this option here?
 
Share:
Facebook Twitter Reddit Pinterest Tumblr WhatsApp Email Link
  • English
    English Polski (Polish) Deutsch (German) Русский (Russian) Français (French) Português brasileiro (Brazilian Portuguese) Italiano (Italian) 日本語 (Japanese) Español (Spanish)

STAY CONNECTED

Facebook Twitter YouTube
CDProjekt RED Mature 17+
  • Contact administration
  • User agreement
  • Privacy policy
  • Cookie policy
  • Press Center
© 2018 CD PROJEKT S.A. ALL RIGHTS RESERVED

The Witcher® is a trademark of CD PROJEKT S. A. The Witcher game © CD PROJEKT S. A. All rights reserved. The Witcher game is based on the prose of Andrzej Sapkowski. All other copyrights and trademarks are the property of their respective owners.

Forum software by XenForo® © 2010-2020 XenForo Ltd.