Object 'ocean' is not a member of the 'AudioProfile' data block class

Author Topic: Object 'ocean' is not a member of the 'AudioProfile' data block class  (Read 3962 times)

I'm trying to get sounds to work in my map and it keeps telling me ocean is not a member of the audioprofile class.

Code: [Select]
*** Stage 2 load
Executing Add-Ons/Map_Island/Island9.mis.
Object 'ocean' is not a member of the 'AudioProfile' data block class
Object 'ocean' is not a member of the 'AudioProfile' data block class
Object 'ocean' is not a member of the 'AudioProfile' data block class
Object 'ocean' is not a member of the 'AudioProfile' data block class
Object 'ocean' is not a member of the 'AudioProfile' data block class
Object 'ocean' is not a member of the 'AudioProfile' data block class
Object 'ocean' is not a member of the 'AudioProfile' data block class
Object 'ocean' is not a member of the 'AudioProfile' data block class
Object 'ocean' is not a member of the 'AudioProfile' data block class
Object 'ocean' is not a member of the 'AudioProfile' data block class
Object 'ocean' is not a member of the 'AudioProfile' data block class
Object 'ocean' is not a member of the 'AudioProfile' data block class



Code: [Select]
datablock AudioProfile(ocean)
{
   filename    = "./ocean.wav";
   description = AudioDefaultLooping3d;
   preload =true;
};
datablock AudioProfile(seagulls)
{
   filename    = "./seagulls.wav";
   description = AudioDefaultLooping3d;
   preload =true;
};

My code.

name it OceanSound and SeagullsSound

First, yeah, Heedi is right. You need to name your datablocks in a unique way so that there's no chance of overwriting any other datablocks. The more explicit and less generic, the better.

Also, make sure you are declaring the datablocks before they're used. If you're declaring the datablocks after the instance that is requiring them, the engine will throw errors and they won't appear or be utilized in-game.

Wrong
Code: [Select]
new ClassType(ObjectName)
{
sfxDatablock = mySound;
};

datablock AudioProfile(mySound)
{
// Resources
};

Right
Code: [Select]
datablock AudioProfile(mySound)
{
// Resources
};

new ClassType(ObjectName)
{
sfxDatablock = mySound;
};

If you're absolutely sure the sound resources are being created before the instances that use them and they still don't work, you may want to post your entire console when you start the server.

Well I took out seagulls and now ocean works.