2019-01-20 05:50:53

As much as I don't like bgt, it's fun to mess with sense I don't know any other languages currently, although that's a work in progress.
So I need a good menu include, sense it turns out that m_pro isn't usable, according to Mason, even though I've seen it used all over the place.
Anyway, I'd apreciate it if anyone could explain how to iether make a good menu include similar to m_pro, or point me towards a decent menu include.
I'd also like to know, how I would make menu music random. I have menumus"+random(1,5)+".ogg");, but I want another random music to play after that.

----------
“Yes, sir. I am attempting to fill a silent moment with non-relevant conversation.”
“You don’t tell me how to behave; you’re not my mother!”
“Could you please continue the petty bickering? I find it most intriguing.” – Data (Star Trek: The Next Generation)

2019-01-20 14:25:29

IDK if it's in any of the online repositories, but I use the menu class I wrote for Java, then ported to BGT. The filename is JMenu.bgt. It is, however, event-driven, rather than self-executing like dynamic_menu.
As for music, how cumbersome it'd be depends on what menu you're using, but mostly you would just say if (music.playing == false) playsong("menumus" + random (1, 5) + ".ogg");. Not exactly like that, unless you're using a sound called music and playing via a function called playsong, but that's the jist of the idea.
If you're using something like dynamic_menu, that blocks the script while it executes, you'd need to put that bit into a callback.

看過來!
"If you want utopia but reality gives you Lovecraft, you don't give up, you carve your utopia out of the corpses of dead gods."
MaxAngor wrote:
    George... Don't do that.

2019-01-20 16:33:32

Ok, so I ad some trouble aking music even play with that example, until I remembered I needed to make a bool music=false;
roflrofl. Anyway, the prblem now is, wen the current music stops playing, I need music to = false so that another random song will be picked, any ideas?

----------
“Yes, sir. I am attempting to fill a silent moment with non-relevant conversation.”
“You don’t tell me how to behave; you’re not my mother!”
“Could you please continue the petty bickering? I find it most intriguing.” – Data (Star Trek: The Next Generation)

2019-01-20 23:53:02

cant really help here. you can change the music every time the menu opens, but you can get an example of thaat in the cm source.
but since no one really uses cm source for anything, which would make it a clone! lets copy some wild blind tech code here
you need to put an int musictracks number which is the number of music tracks. you'll notice in your average menu.bgt, you'll have a void called setupmenu, in which there is a line, m.add_music("menumus.ogg");

we want to change this to:
m.add_music("menumus"+random(1,musictracks)+".ogg");
that's the basic idea
hope this helps!

2019-01-21 01:21:25

Wait...when did Mason say that you couldn't use m_pro? I'm curios where and why the hell he said this, since I use that include in all of my games.

Ivan M. Soto.
Feel free to check out my work and services.
http://ims-productions.com