heyas ^_^ I was just wondering, whats the deal with included source? I had this nice orgonised layout setup.. My main project file wasnt going to do anything apart from call functions needed for whatever task was due to happen. The menu system was to be written in a menu.dba, all the types (like a player type, entity types) were to be defined in a types.dba and the main game engine was going to be written in engine.dba
I created these files by using the project manager and saying add new. Then in my main project i typed the statment #include "whatever.dba".
But dbp really doesnt seem to like this kind of setup -_- It started complaining about things. Like:
In my types.dba i had this kind of type def:
Type Ball
x as float
y as float
z as float
model_num as integer
size as integer
endtype
and then in my engine.dba i had a function called init() which did this:
global player as ball
player.x = 0.0
player.y = 0.0
player.z = 0.0
player.size = 25
player.model_num = 1
and that worked fine. Then just below it i had:
make object sphere player.model_num,player.size
This raised an error something like (cant remember exactally): Parameters do not match Make Object Sphere object number,size in engine.dba (disapointed to note it didnt tell me what line that was on, but i only had one make object so i knew what it was on about).
i then changed my code to: make object sphere 1,25. Same error. I then commented it out. I had another function in my engine.dba for camera control, i tested it previously and it works fine. But when i commented out the make object sphere line it gave the same error but about position camera x,y,z!
Frustrated and unable to find the error in my code I closed it and started work on a map editor to take my mind of things. I was going to use the same kind of layout, one main project file which just calls functions from included source files. I made my project and then added gui.dba. I started work on my gui, writing a few 2d drawing routines for dialogs and buttons. I then told it to write using the text command (for button lables). I compiled. To my horror i got that error back again, Pameters not matching for text x,y.
Then just as a test I copied all my gui functions out of gui.dba and into the main file and then deleted gui.dba. I compiled, it worked perfectly! I didnt change any of the gui code, just moved it.
Can anyone tell me where i've gone wrong? It appears my idea of what #include should be used for is wrong. I presumed i could write functions for certain things in different files to form libararys.. am i wrong? Wassup with this? ^^
Im sorry if this is too long.. but i thought a good explination might help people to understand the exact problem ^_^
-Seph