Media play using template2

Posted By: DancesWithLight

Media play using template2 - 09/29/08 14:48

Why doesn't this show a bitmap when I start the main?
Before this I put
bmap warning = "warning.bmp";
//my warning screen bmp in game directory

media_play("gentle.wav",bmap_for_entity(warning,0),100);
Posted By: Nidhogg

Re: Media play using template2 - 09/29/08 18:30

Did you create the bmap first..

bmap warning
function call_warning()
{
var warning_msg;

warning_msg = media_play("warning.wav"),warning,100);
}

The above code is untested but I think that's how it should be done.
Posted By: DancesWithLight

Re: Media play using template2 - 09/29/08 19:49

Well, the bitmap is white letters on a black background. I don't know what they mean by a 16 bit pcx or bitmap form. My paintshop only let me choose 24 bit. It jumps from a choice of 256 colors to 24 bit 65 million colors. But it shows up fine in a panel. And I use them for sprites and they show up. The bitmap is in the game directory with the models and sprites. Maybe it only lets me show a bitmap if I'm using it as a model to project a movie on, which I can't do, because I only have the Standard version, and can only use media play for midi files and wavfles. But I thought it would show a bitmap at the same time.

Maybe I'd better just use a panel function to show a bitmap and play a music. Like:

//define the panel correctly then...
function warning()
{text_pan.visible=on;
media_play(music.wav,100);
sleep(3); //give them time to read the message
text_pan.visible = off;
wait(1);
}

This works at the start of a game. I'd also like to attach a function like this to a trigger, to use similar code in other functions. Then I could have messages pop up when the player walks into certain places. But I have less luck writing triggering code to attach to invisible objects. Template2 has some triggers, but I don't know how to identify a particular trigger with a function I write. Need a trigger tutorial.

Thanks
Anton
Posted By: Nidhogg

Re: Media play using template2 - 09/30/08 02:15

What version are you using. whay I ask is becuase if you are using
version A6 some of the code is new. Example sleep(3) is now wait(-3)

Maybe you should do a tutorial or refer to the manual...
Posted By: log2

Re: Media play using template2 - 10/01/08 09:51

also if you're defining a bmap, it needs to be BMAP, not bmap, aka caps... just incase it's not
Posted By: Nidhogg

Re: Media play using template2 - 10/01/08 23:28

caps doesn't matter with c-script as it's case insenseitive, where as lite-c is
Posted By: log2

Re: Media play using template2 - 10/02/08 20:57

ah ok, well that's good to know, but still think it looks better, haha, but thanks for the info
© 2024 lite-C Forums