Game Development Community

Datablocks/sound not showing up

by Foestar · in Torque Game Engine Advanced · 12/06/2009 (5:33 am) · 3 replies

Am I doing this wrong or something. I added the following to create a data block for a sound trigger for my game. But when I go into the triggers I get only the default trigger showing up. Mine doesn't. What do I need or am I doing something wrong.
datablock AudioProfile(act1opening)
{
filename = "~/data/sound/music/Act1.WAV";
description = "AudioClose3d";
preload = true;
};


function act1openingplay::onEnterTrigger(%this,%trigger,%obj)
{
sfxPlay(act1opening,%obj.getTransform());
}

#1
12/06/2009 (8:03 pm)
You need to make sure you're also executing the file where you have it defined so it gets loaded. exec("yourfilenamehere");
#2
12/06/2009 (8:48 pm)
if this is the only code you have for your trigger then you are missing the datablock for the actual trigger

datablock TriggerData(act1openingplay)
{
   tickPeriodMS = 100;
};
#3
12/07/2009 (1:51 am)
Ah, gotcha. Working now. Thanks much!