41
Beginners' Technical Questions / Re: Playing a Video In-Game?
« on: 28 Jun 2011, 12:40 »(We're hijacking this thread btw...)
:
If this thread was a train, it got hijacked and subsequently ran off the rails. And it's still going.
Quote from: Toonloon
PlaySound command featured in densming's videos, just doesn't work for me...
If you're using the latest version of AGS I'm not surprised. PlaySound() is obsolete and doesn't work anymore. To play a sound, you simply type the name of the sound file and add ".Play;" to the end of it.
Just as an example, here's how some sounds in one of my games is played:
[code]
function PlayRicochet()
{
int RicoNum = Random(4);
if(RicoNum == 0) aRic1.Play();
else if(RicoNum == 1) aRic2.Play();
else if(RicoNum == 2) aRic3.Play();
else if(RicoNum == 3) aRic4.Play();
else aRic5.Play();
return 0;
}
[/code]
The sound files themselves are just 'Ric1' to 'Ric5' and when importing them in, AGS automatically adds the 'a' to the beginning of the name.
Of course, if you still wanted to be able to use PlaySound() then you'd have to go into the General Settings of your game, and change 'Enforce new-style audio scripting' to false (second from the top in the 'Backwards Compatibility' section)
edit: dammit dammit dammit Khris! You ninja'd me >:/ (why does this keep happening? *sob* )

it's been a long night, and it's promising to get longer (just so long as I can stay awake until that 2nd pot of coffee is done. Code doesn't write itself (usually...))



)
About a month ago I found one of my old USB sticks that had an earlier version of the work I did on it, and since then I've been meaning to get back to programming it. Thankfully, I had some help with the images and they're saved online so it shouldn't take longer then a few days to knock it out


