Creating modules
BlitzMax Forums/BlitzMax Programming/Creating modules
| ||
Hey, i'm trying to create a game engine module to throw all my useful code into, and just call routines from that. I've taken a good look at a few modules i've downloaded and compiled, and even BRL's module, and some tutorials aswell. Yet I'm having a problem! This minimum code below is a test of my engine. To see if it compiles and everything: SuperStrict Rem bbdoc: Yahfree's Game Engine about: Handy functions stored in one place EndRem Module Yah.GE ModuleInfo "Name: Yahfree's Game Engine" ModuleInfo "Description: Useful code to reduce repetive junk" ModuleInfo "License: Public Domain" ModuleInfo "Authors: Yahfree" Import BRL.Random Import BRL.StandardIO Rem bbdoc: test function about: Prints a random number between 10 and 20 returns: Nothing EndRem Function ModTestFunction() Print Rand(10,20) End Function Sure enough, it compiles first time, the location of this GE.bmx is "BlitzMax/mods/Yah.mod/GE.mod" Now I want to test it of course, so another minimal app to test it...: Import Yah.GE SeedRnd MilliSecs() ModTestFunction() End Now I get an error?? what?? Does anyone know what I did wrong? The error: Compile Error Can't find interface for module 'yah.ge' Also strange: It doesnt show up on the right under third party modules. Additional info: I have all my MinGW system path vars set up, and the correct version as per the sticky in the Module Tweaks section of the forums. |
| ||
whats the filename of the BMX file in the mod folder? did you press build modules? |
| ||
Do you have the module files under "BlitzMax\mod\yah.mod\ge.mod\" ? |
| ||
If your mod name is ge.mod your bmx file will have to be named ge.bmx (I think...) Also, you have to compile it using batch/command line or using "build modules" from your ide. |
| ||
the file is located at: "blitzmax\mod\yah.mod\ge.mod\ge.bmx" and it was compiled using "CTR+D" in the Blitzmax IDE |
| ||
Edit: Just rebuilt the module, compiled perfectly again, but the test source is not working - same error Compile Error: Can't find interface for module 'yah.ge' |
| ||
No clue whats wrong there then. |
| ||
Not good :\... Any suggestions? |
| ||
What is the output for building the module? Are there .a and .i files in the mod folder? |
| ||
>Are there .a and .i files in the mod folder? There's two .a files in the same directory, and Bmax made a folder in that directory with some .i files, .o files, and .s files. >What is the output for building the module? Building Modules Compiling:GE.bmx flat assembler version 1.66 3 passes, 1005 bytes. Archiving:GE.debug.win32.x86.a ar: creating C:/Programing/BlitzMax/mod/Yah.mod/GE.mod/GE.debug.win32.x86.a Compiling:GE.bmx flat assembler version 1.66 3 passes, 623 bytes. Archiving:GE.release.win32.x86.a ar: creating C:/Programing/BlitzMax/mod/Yah.mod/GE.mod/GE.release.win32.x86.a Process complete |
| ||
Just a guess - but I struck something similar a long time ago and I think I fixed it by converting all module names to lower case. Worth a try anyway. |
| ||
>Just a guess - but I struck something similar a long time ago and I think I fixed it by converting all module names to lower case. Worth a try anyway. HOLLALUA!! that worked! sweet, bizzar though. Now on to figuring out why my code won't highlight -.- |
| ||
:-) |
| ||
Hey, any reason why it's not showing up under third party modules? Edit: I cant seem to find any documentation on it wierd? |
| ||
Try putting your bbdoc directly above your function/type/method etc..Rem bbdoc: Audio sound type End Rem Type TSound ... Rem bbdoc: Set playback volume of an audio channel about: @volume should be in the range 0 (silent) to 1 (full volume) end rem Function SetChannelVolume( channel:TChannel,volume# ) |
| ||
still no effect... hmmm |
| ||
here's one of my functions for example:Rem bbdoc: Particle count function about: Returns the particle count returns: The particle count End Rem Function ParticleCount:Int() Return ParticleList.Count() End Function |
| ||
Program->Rebuild Documentation (maxide) |
| ||
Writing modules now, eh? Excellent :-) Took your code from the top post, and the function doesn't appear in the docs.. although the module does. As Plash says, your doc comment needs to be above the function without any blank lines. Changing your code to match, the function now appears in the documentation for your module and becomes syntax coloured when typed into the IDE. Have you run "Rebuild Documentation" ? :-p <edit>Like what Plash said above ;-) |
| ||
*Facepalm* Thanks Edit: Awsome! syntax highlighting, everything, nicely done |