In-game music help?

In-game music help?

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
Carnston
Posts: 7
Joined: 29 Jul 2008, 15:59

In-game music help?

Post by Carnston »

I've just installed the in-game music script found on this site and I was rather disappointed to find out that it only plays when your own units are killed.

I'm very inexperienced with any kind of coding - the most experience I've had was trying to figure out the syntax for Dawn of War's Mission Editor's map scripting. Ultimately, it was a frustrating attempt at learning something when no helpful information was given.

If someone has a modified version of the script that functions when enemy units are killed, I'd love to see it.
If not, I'd be all ears for any kind of basic modding for the script.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: In-game music help?

Post by Forboding Angel »

in before links to lua faq
User avatar
Carnston
Posts: 7
Joined: 29 Jul 2008, 15:59

Re: In-game music help?

Post by Carnston »

Tried looking through that, didn't really help me find the argument or command I was looking for.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: In-game music help?

Post by Forboding Angel »

If you are talking about the TA ingame music widget, it plays regular non-war tracks when nothing is going on. It starts playing war tracks based upon units worth. Unfortunately the values are set quite high, much higher than they should be in my opinion, so the war tracks take forever to switch to. However, the widget doesn't care which units are killed. It assigns a value no matter who the units belong to unless I missed something, but as i read it, that's the way it works.
User avatar
Carnston
Posts: 7
Joined: 29 Jul 2008, 15:59

Re: In-game music help?

Post by Carnston »

Now, I'm fairly certain that's wrong. I snooped around the file myself and changed a few numbers; the required value of units killed was 12, I lowered it to 3. There was a multiplier that upped the value of your own units, I changed that to just 1 so it wouldn't be a concern anymore (So I think.). There were a bunch of metal cost values (>500 is worth 2 value units, etc.) that I lowered to get battle music to play, but this never happened when things started dying - unless they were my things dying.

I got the same result after the modification. Battle music refused to play when enemy units were killed, despite the significantly lowered values. I'll check with unit worth requirements set to just 1 to confirm this theory.

Edit: It is indeed what I suspected. I went through numerous Jeffies, a torpedo launcher, and a D-Gun multi-kill of a vehicle plant, Samson, Jeffy, Construction Vehicle, and Podger. Battle music only played when a Jeffy killed one of my metal extractors.
Last edited by Carnston on 29 Jul 2008, 17:51, edited 1 time in total.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: In-game music help?

Post by Forboding Angel »

Not saying you are wrong, but that's quite different from my own experience. I'll dl the file and maek looky again.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: In-game music help?

Post by Forboding Angel »

Yep you're right

Code: Select all

function widget:UnitDestroyed(unitID, unitDefID, teamID)
  local PlayerTeam = Spring.GetMyTeamID()
That is grabbing your team ID and then further down it initiates keeping track of your own units. I imagine that this could be changed to track all units if it was made into a gadget.
User avatar
Carnston
Posts: 7
Joined: 29 Jul 2008, 15:59

Re: In-game music help?

Post by Carnston »

Well, is there any way some generous coder could turn this into a gadget? Or at least give me a shove in the right direction as to how to do it myself?
I'd be very grateful, Jeremy Soule kicked ass with TA's music.

Sorry for the late post, attention wandered off for a good deal of time.
User avatar
Thor
NOTA Developer
Posts: 291
Joined: 05 Mar 2006, 10:26

Re: In-game music help?

Post by Thor »

The problem with turning it into a gadget would be you couldn't use it except in a mod that actually had that gadget.
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: In-game music help?

Post by Hoi »

would it matter if it just plays everything, ignoring the war/peace stuff? i'm currently trying to make a music widget that can play every wav/ogg from folder x, in a random order if you want to
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Re: In-game music help?

Post by Warlord Zsinj »

Well, yeah, Hoi - that's really the whole point. Otherwise there's nothing just stopping people from running winamp or whatever in the background.
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: In-game music help?

Post by Hoi »

which is annoying becaus i always forget it, also if you make the music ingame you could also have pause, next track, and more options without having to alt-tab
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Re: In-game music help?

Post by Warlord Zsinj »

True, but I really think the selling point here is the need to have dynamic usage. Most decent players will let you hook a hotkey to next track or whatever, if you don't already have the buttons on your keyboard.

Without meaning to sound dismissive, I really think a music player needs to be able to be able to perform dynamically with regards to the gameplay, otherwise it's not much use. However, don't let that stop you from doing what you're doing, because that's a great first stepping stone.
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: In-game music help?

Post by Hoi »

but the dynamic stuff will limit the music to the TA soundtrack, i dont want to play that but my own music :wink:
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Re: In-game music help?

Post by Warlord Zsinj »

o_O

I don't see how that will limit you to the TA music.

You simply have a bunch of folders that it reads from. One folder is called "Tension" one called "Battle", etc. You drag and drop your music into each of those folders so that you determine what setting your music suits, and then in-game, the game selects the appropriate set of tracks for what is happening.
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: In-game music help?

Post by Hoi »

but the ta music is made for that, "real" music would be alot harder to sort out like that, and not only that, it would also be alot harder for me to make 8)
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Re: In-game music help?

Post by Warlord Zsinj »

Image
Post Reply

Return to “Lua Scripts”