Qbasicnews.com

Full Version: Help with compliling, (with) Qmidi... and other stuff too.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Greetings.

I have recently worked VERY HARD on this game that is OUTLANDISHLY too large and unnessecarily complex, but it is my first work that has gotten longer than 10 minutes of play, so I am pleased, you know? Well anyway, I was planning on compiling it into an executable file so that I could give it to my friends. The thing is that I have A LOT of midis and whatnot, so I will also need a installer to make sure all the files get where they need to be, but that won't be a problem.

The problem that I need help with (I know I've asked this before. Curse my procrastination) is loading SBMIDI and SBSIM right before the .exe file runs. I know it can be done, but I forgot how. There was some special way of doing it, I thought.

And then, does the library that you need to run QMIDI in Qbasic have anything to do with the .exe files? Do I need to include a library or something... do something extra when I compile?

I guess that's it. I'd give it to you guys to show it to you but as I said, it is my first work (therefore not up to the 'standards' that I have seen people's work here) but I am proud of it. Also the outlandish size of everything (I am bad at downsizing.) Any help would be greatly appreciated.


MY NEW AVATAR COURTESY OF MECH!!! IF YOU WANT A COOL ONE TOO, TALK TO HIM!!!



-Nova
Just load it up in QB as if you were about to run it, then compile it from the menu. That's the most foolproof method - you don't have to worry about how/when the libraries and other modules get compiled and linked in, QB takes care if it all for you. (though it's not really that hard to do it manually)

To ensure that SBMIDI and SBSIM are run before the exe, create a batch file for your users to use.

"RUN_ME_INSTEAD_OF_THE_EXE_FILE.BAT":
Code:
sbmidi
sbsim
THE_EXE_FILE.EXE
sbsim /U
sbmidi /U
You can also call a bat-file in the program with something like, and then decall it then:

Code:
SHELL "INITQMID.BAT activate"
'
' The rest of your code here
'
SHELL "INITQMID.BAT deactivate"

In the INITQMID.BAT file there is:
Code:
@echo off
if %1=="active" sbmidi.exe
if %1=="active" sbsim.exe
if %1=="deactive" sbmidi.exe /U
if %1=="deactive" sbmid.exe /U
From "Qmidi.doc" of QMidi 4.1:
Code:
--- Notes ---

    - Never load the sound drivers using the BASIC "SHELL" command.  They
      won't be loaded properly using this method.  The drivers should always
      be loaded directly from DOS, or from a batch (.BAT) file that is
      run from DOS.
It's because SHELL creates a new instance of dos, then anything you do only affects that instance, not the one the program's running in.
I've said that 1,000,000 times... :roll:
Okely dokely that is about 100% easier than I thought it would be, thanks for all your help. I am a little dissapointed in your lack of promptness in not being first, though, na_th_an Wink



EDIT:

To avoid the FEARED double-post, I am just sticking in this NEW question as an edit. I attempted to compile my program, which at first failed miserably. I programmed this one part, where the attack of the character is determined by his strength and the power of his weapon, right? Well, I did this a long time ago. I used about 116 IF THEN statements for if your strength was 1 to if it was 116... well, I shortened it up to about 6 lines of code (HOW's THAT for condensing?) and so now I only get one 'severe error' when I try to compile.

This error comes in one of QMidi's SUBs... where it reads the MIDI in 16 kilobyte increments. I don't know what to do to make it work. It says that there is "Program-Memory Overflow" I assume that that means I have too much ineficient coding... right? Anyway, if this is right then tell me so and I'll go through the code and sqwoosh it. (BTW, sqwoosh is the word of the day for today ok?)

EDIT OF THE EDIT:
Nevermind, I think that my assumption was correct. I have to frikin downsize all of my miserably outlandish code. Oh well, I already have 109039203920985932809 ideas about where to start. (actual idea count may vary.)

EDIT OF THE EDIT OF THE EDIT:

Well, it appears that I keep answering and contradicting myself at the same time... over and over and over and over again. Well, this time I have a question about Qmidi. If there are functions, such as timemidi and stuff like that, that I don't use in my particular program, is it okay to delete the subroutines, or will that just mess up the rest of Qmidi? I have to downsize my prog, and so far it's gone pretty well. I have condensed all of the shops in the towns into one subroutine, thereby eliminating over 120 of unneeded code. and some other stuff, too.


Oh yeah, another question. I use PP256 and .put files in my program. It's not a tile RPG but it has some .put "trees" in it. The only problem is I have a horrible technique for placing these trees. I assign each one a variable for each screen. Such as


Code:
IF PLACE = 2 THEN
HARLOADPUT "evgrntre.put", MYARRAY
PUT (120, 100) ,MYARRAY, PSET
PUT (23, 54), MYARRAY, PSET
'and so on for about 10 - 20 trees

so, as you can see, I need a better system!!! I am sort of picky though, I don't want the trees to be randomly placed each time the player goes onto that screen (such as if he goes to the next screen and comes back, the trees shouldn't be in different places) [randomization] and I don't want there to be every so often a tree (such as FOR i = 1 to 320 step 10 : place tree...: next i). Is there any way to acomplish my outrageous wants? The ideal thing would be to have a seperate text document or something where Qbasic READS the placement from and then just puts them on there somehow, but I have tried to figure that out before to no avail. Any help would be appreciated.


Please respond so I don't have to keep editing... I know how much SOME people hate double-posters... or in my case QUADROUPLE posters... :oops:

EDIT: I figured out how to make all my PP256 thingys work better!!!! YAY! I just have to work real hard for awhile, but it'll be worth it if I can consolidate my code by around 80%!
SORRY FOR THE (actual) DOUBLE POST :oops: :oops: :oops:

but... I think that no one is responding to me because it doesn't show up on the programming help section as a 'new post' so forgive this useless post and just look above it for all my questions. Thanks.



EDIT:
I beta tested my game and it works pretty good even without the Qmidi subs that I don't need. I still need to consolidate my code to make an .exe file but I'm workin' on it!