Jump to content


Photo

question regarding music


  • Please log in to reply
7 replies to this topic

#1 gansnudel

gansnudel
  • Members
  • 25 posts

Posted 13 June 2006 - 01:48 PM

Hi,

I´m currently working on a mod that balances and polishes the game by removing bugs, adding some more salute sounds etc. I am mostly finished, but there is one thing that I want to add:

I want to make it so that specific music files start playing when specific events happen.
For example the summon rohirrim spell or theoden´s glorious charge should trigger a rohan theme. Ent summon a last march of the ents theme; fuel the fires an industry theme etc.

Getting the music to start is easy, I just used initiate sound= "name of musictrack" in the ocl.ini . However this locks the music in the rohan theme and it gets kinda old if it repeats itself again and again until the end of the mission. In addition it doesn´t get cancelled when a new musicfile starts playing.
I want to make it so that the music returns to normal once the track finishes and that the track can get overriden if a new music trigger starts.

There is already one similar thing in the game, where the music changes when you destroy 5 enemy buildings, the EA people used a fake Eva event to do this. However I don´t understand what actually triggers the music there.

Any help is appreciated.

#2 Sûlherokhh

Sûlherokhh

    Sagacious Engineer

  • Project Team
  • 3,754 posts
  • Location:Central Germany
  • Projects:S.E.E., Sage A.I., Code Advisor
  •  'Axe'er of the Gordic Knot

Posted 13 June 2006 - 04:16 PM

Open the file 'libraries/music_musicscripts_single.map' with worldbuilder.
Now open the scripts. Everything you need is in there.

bannerreal01mittelit3.jpg
Axed Head and A.I. Coder for S.E.E. and ... stuff

".. coding is basically boring. What's fun is finding out how things work, take them apart and then put them together in ways that were not intended nor even conceived."


#3 ched

ched

    .

  • Undead
  • 4,431 posts
  • Location:Angers (France)
  • Projects:Rhovanion Alliance
  •  T3A Team Chamber Member
  • Division:BFME
  • Job:Previous Division Leader

Posted 13 June 2006 - 04:18 PM

as for the scripting required, it's probably something like

**IF**
Object RohanTheoden is using SPECIAL_POWER_WHATHEVER

**THEN**
Play RohanTheme with bla

But you're probably better off asking the knowledgeable folks in the WB section
Software is like sex; it's better when it's free ~Linus Torvald

#4 gansnudel

gansnudel
  • Members
  • 25 posts

Posted 13 June 2006 - 10:28 PM

Thanks for the quick answers. I managed to do it in that script file. The scripts were pretty easy to do, here is what I did:

*** IF ***
	True.
*** THEN ***
  Set Flag named 'Rohirrim_summoned_music_ended' to FALSE

*** IF ***
	Player Player '<Local Player>' starts using Special power 'SpellBookRohanAllies'.
	*AND*  Flag named 'Rohirrim_summoned_music_ended' IS FALSE
*** THEN ***
  Push (stack) 'R_BbGood115' atop the current music track and play it  1  times using fadeout (FALSE) and fadein (FALSE), then set Flag named 'Rohirrim_summoned_music_ended' to TRUE. (Does NOT pop the music off the stack upon completion.) 

*** IF ***
	 Flag named 'Rohirrim_summoned_music_ended' IS TRUE
*** THEN ***
  Resume use of (turn on) the music scripting system, fading out (TRUE) the current music track and fading in (TRUE) the music scripting system's music.
  Set Flag named 'Rohirrim_summoned_music_ended' to FALSE



I would have preferred to limit myself to just modding the ini.big, but I guess 3 different files(with tooltips) is ok.

By the way is the single tag in the name of the .map file purely cosmetic and that map file gets loaded no matter if I play multi or single, or is there a different file I have to mod for multiplayer?

Edited by gansnudel, 13 June 2006 - 10:30 PM.


#5 ched

ched

    .

  • Undead
  • 4,431 posts
  • Location:Angers (France)
  • Projects:Rhovanion Alliance
  •  T3A Team Chamber Member
  • Division:BFME
  • Job:Previous Division Leader

Posted 13 June 2006 - 10:35 PM

nice bit of scripting here. Thanks for sharing.

AFAIK, MP and SP use the same file for music scripting, so you should be fine.
Software is like sex; it's better when it's free ~Linus Torvald

#6 Tobi

Tobi
  • Members
  • 128 posts

Posted 14 June 2006 - 12:44 PM

I would have preferred to limit myself to just modding the ini.big, but I guess 3 different files(with tooltips) is ok.


u can put all ur edited things in one big-file if u don't want to change so many of them, u just have to rename it so that it will be read in alphabetical order... easiest would be to cut ur original ini.big from ur bfme folder and then put in ur file named _ini_.big

then it will be preferred and the game doesn't use the other files

#7 Fingulfin

Fingulfin

    I Like Pi3. Do you?

  • Hosted
  • 1,752 posts
  • Location:California, USA
  • Projects:Staying Alive.
  •  This place looks familiar. I can't remember why.

Posted 15 September 2006 - 09:52 PM

BUMPED, from the ashes of forgotten topics...

I tired this, and got the scripts exactly like mentioned above, then added it to my mod.big with the same name that it has in Libraries.BIG. However, in-game it doesn't do anything... I activate my power, then nothing... Is there something else I have to do? Or can you simply not use Libraries.big files in a normal -mod mymod.BIG?
Posted Image
--------------------------------------
"You look like a ghost of your former self..."

#8 gansnudel

gansnudel
  • Members
  • 25 posts

Posted 16 September 2006 - 06:45 AM

Hmm I didn´t use the -mod command for my mod. I have refined the musicscripts a little in the latest version of my mod, the script code posted here is the bare bones stuff.

Why don´t you rename your mod into something like _mymod.big and put it in the main folder. If the music works then, you know it´s a problem with the -mod command.




2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users