08-23-2011, 01:22 AM
Hi! I'm failing to get a phonograph to play a sound.
This is a part of the original code:
// The phonograph by the entrance
void StateChangePhono01(string &in asEntity, int alState)
{
PlayPhono(2, 1, 2, asEntity);
}
// Play the phonograph messages on interact with phonograph
void PlayPhono(int iLevel, int iSet, int iPart, string &in sEntity)
{
SetEntityInteractionDisabled(sEntity, true); //No more interact with phono as it does not do anything.
SetLocalVarInt("PlayPhono", 1);
PlaySoundAtEntity("phono_scrape", "ptest_phono_loop", sEntity, 1.0f, false);
for(int i = 1;i<=iPart;i++)
AddEffectVoice("justine_rec_lvl"+iLevel+"_0"+iSet+"_0"+i+".ogg",
"",
"Recording", "justine_rec_lvl"+iLevel+"_0"+iSet+"_0"+i,
true, sEntity, 4, 16
);
SetEffectVoiceOverCallback("VoiceOverPhono");
}
This is my code:
void PlaySong(string &in asEntity, int alState)
{
SetEntityInteractionDisabled("asEntity", true);
SetEntityActive("wood_box02_13", true);
PlaySoundAtEntity("", "Alexandria_Song.snt", "phonograph_1", 0.5f, false);
}
I have put the function in the connectionstatecallback on the entity. I'd appreciate some help
This is a part of the original code:
Spoiler below!
// The phonograph by the entrance
void StateChangePhono01(string &in asEntity, int alState)
{
PlayPhono(2, 1, 2, asEntity);
}
// Play the phonograph messages on interact with phonograph
void PlayPhono(int iLevel, int iSet, int iPart, string &in sEntity)
{
SetEntityInteractionDisabled(sEntity, true); //No more interact with phono as it does not do anything.
SetLocalVarInt("PlayPhono", 1);
PlaySoundAtEntity("phono_scrape", "ptest_phono_loop", sEntity, 1.0f, false);
for(int i = 1;i<=iPart;i++)
AddEffectVoice("justine_rec_lvl"+iLevel+"_0"+iSet+"_0"+i+".ogg",
"",
"Recording", "justine_rec_lvl"+iLevel+"_0"+iSet+"_0"+i,
true, sEntity, 4, 16
);
SetEffectVoiceOverCallback("VoiceOverPhono");
}
This is my code:
Spoiler below!
void PlaySong(string &in asEntity, int alState)
{
SetEntityInteractionDisabled("asEntity", true);
SetEntityActive("wood_box02_13", true);
PlaySoundAtEntity("", "Alexandria_Song.snt", "phonograph_1", 0.5f, false);
}
I have put the function in the connectionstatecallback on the entity. I'd appreciate some help