Anyone know how to add a sound to an object?

tatwi

Member
Joined
May 31, 2012
Messages
66
Either as a client side or server side would be great. I'm trying to add a looping engine run sound to object/ship/player/player_basic_hutt_light.iff, so that when I call it from the datapad to fart around in it won't be dead silent.

I tried a few things, in c++ and lua, but have not had any luck. Even added a child object in its lua file causes the client to crash when its called (tried it with the droid detection device, as it's noisy).
 

Timbab

Administrator
Staff member
Administrator
Moderator
Joined
Oct 6, 2010
Messages
1,057
Location
Magna Germania
Unsure about the trigger system, but in theory, you simply attach a .CDF in your Object file (SHOT FORM, look for the 'clientDataFile' XXXX chunk, set the byte after the '00' string end to '01' and then link to a .CDF.



In case you want to use the template to easily edit that chunk:
Code:
// clientDataFile
// META(CHUNKID:XXXX)

String[Chunk Name]
Byte[on/off type toggle]
String[CDF Path]
There are a couple of sound chunk types for CDF, but the most typical one used in cases like this would be 'ASND', which just contains a path to a SND. If you make an ASND in it or use an existing one with one, you can simply use my templates that I already put up in the SIE thread to easily edit it.

This would be it:


Best is to look at existing object/soundobject of how they operate.

I've never tested it myself, but it should be simple enough. :)
 

tatwi

Member
Joined
May 31, 2012
Messages
66
Wow, never thought I would say this but... I prefer C++ over the crazy mess that you just explained and I loathe the crazy mess that is C++! lol... Thanks for explaining it though. I will see what I can do and if it works, I will share.
 

Timbab

Administrator
Staff member
Administrator
Moderator
Joined
Oct 6, 2010
Messages
1,057
Location
Magna Germania
It'll be more streamlined/straightforward once I got an editor out for both (next update probably). :)
 

Sytner

Administrator
Staff member
Administrator
Joined
Sep 18, 2010
Messages
426
tatwi said:
Wow, never thought I would say this but... I prefer C++ over the crazy mess that you just explained and I loathe the crazy mess that is C++! lol... Thanks for explaining it though. I will see what I can do and if it works, I will share.
It's just type[name], how is that a crazy mess? You could barely define a simpler syntax than that... :(
 

tatwi

Member
Joined
May 31, 2012
Messages
66
Sytner said:
tatwi said:
Wow, never thought I would say this but... I prefer C++ over the crazy mess that you just explained and I loathe the crazy mess that is C++! lol... Thanks for explaining it though. I will see what I can do and if it works, I will share.
It's just type[name], how is that a crazy mess? You could barely define a simpler syntax than that... :(
SOE's system of where things are and what they're attached to, blah, blah, etc., not your tool. :)

Incidentally, I was able to add a sound into the client data file just fine, but interestingly it would only play while in the ship if I was in a space zone (tested with space_tatooine). When I was in a planet zone it would play the sound, but mute it while in the ship and when I got out of the ship the sound would restart and loop forever, yet that didn't happen in the space zone.

Anyhow, I don't care enough to dick around with it further. lol...
 

Sytner

Administrator
Staff member
Administrator
Joined
Sep 18, 2010
Messages
426
tatwi said:
SOE's system of where things are and what they're attached to, blah, blah, etc., not your tool. :)
Oh right sorry, I must have misread. Since we're on the topic though the template system doesn't really work for object templates... people should bug Timbab to finish the editor for it :).
 
Top Bottom