Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / #include "filename.dba"

Author
Message
HoraxHon
User Offline
Joined: 1st Feb 2018
Location:
Posted: 4th Feb 2018 18:32
If to add all the (media) data to a main file it will be too big.
Then how to add some extra data to a project?
Need simple example - for understanding.
Thanks!
HoraxHon
User Offline
Joined: 1st Feb 2018
Location:
Posted: 5th Feb 2018 04:29
Few hours ago I did it so...
***
EMPTINESS.dba:

rem EMPTINESS
#include "MEDIA.dba"
char()
thishh_f=1
do
yrotate object thishh_f,object angle y(thishh_f)+0.1
loop
***
MEDIA.dba:

rem MEDIA
rem MODELS
rem CHARACTERS

function char
load object "DATA\CHARACTERS\THISHH\THISHH_F.x",1
endfunction
***
Maybe I did something wrong, but it works.
Kuper
10
Years of Service
User Offline
Joined: 25th Feb 2008
Playing: Planescape:Torment
Posted: 5th Feb 2018 06:40
In Editor you can do File -> New -> New File ( add to project )
Or you can write "#include" and after that file which must be included. I advice you to have all code files in one folder.Not in sub folders.
HoraxHon
User Offline
Joined: 1st Feb 2018
Location:
Posted: 5th Feb 2018 10:17 Edited at: 5th Feb 2018 12:50
Thanks, Kuper!
I think I have solved my problem by myself last night.
Quote: "I advice you to have all code files in one folder.Not in sub folders."

Here I must correct You: it is not necessary.
You may test it by modifice my code like that:
#include "DATA\MEDIA.dba"
(Certainly You have to have the folder "DATA" in your project folder.)

Attachments

Login to view attachments

Login to post a reply

Server time is: 2018-05-26 03:20:20
Your offset time is: 2018-05-26 03:20:20