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 Discussion / How do use have DB communicate to another program by using data files? <DBC or Pro>

Author
Message
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 15th Aug 2006 21:49 Edited at: 26th Apr 2007 23:00
EDIT: New question at last post!!!

Question for mods or any one else who would know how this high end concept would work:

It is for Dark Basic Pro

How can you include the Dark Physics and Dark AI dll file in a gaming engine, use it and allow users to have it in a final exe without giving them the dll.

I want users to create there world and the program to take the files from the game engines internal media and add it to another exe program in its internal media.

How can this be done?

Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 16th Aug 2006 11:58 Edited at: 16th Aug 2006 12:05
You can activate both DBC and DBP compilers. Please search the forum, I have already posted the solution for DBC.

If you just want to pass data, I'd suggest you use the commandline if you don't have much information to send, or just use temporary .dat files containing the information. (Something like "TEMP.dat").
But don't forget to delete it in the other program!

Or another manner would be accessing the clipboard. But this is not advisable since other programs might use it while running these programs.

[EDIT] search for link compiler.

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 16th Aug 2006 13:30
Hello there,

My guess is you want the ability to click on a button or something that creates a string of code, and then that code would be executed in DB. If this is the case, you won't be able to run the string as an executable block.

I would suggest that instead, you make functions or sub procedures that have the exectuable statements in them, and then when you click on the button, it only sends variables to the specific functions to execute the code.

Using this method, you could build a realtime interface in DBC or DBP.

At the same time the button creates the variables, you could also have it create the string of code that would be used to save as a file that could later be loaded as an actual program. This file would only have to be stored as text.

As long as the functions you write are compatible with both DBC and DBP, you could use the program for both.

If you are writing this program in an external app., Sven B's got you covered.

Enjoy your day.
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 18th Aug 2006 02:45 Edited at: 6th Oct 2006 03:06
EDIT: This program crashed due to large amount of errors and lack of commands to do it.



I need to know if there will be enough people that would use this program if I would create it.

The program I am making allows users to make code with out using dark basic.

It uses icons and prompt boxes to create code in a text file that can be pasted into dark basic.

This program will be used for two purposes to get newbies a jump start in coding by pressing on icons while having everything explained to them before they write it.

To create games faster....(unless you are a fast typer!!)

Basicly what it does is you click on a button and it writes it to a file. This would be useful for function like for movement.

Working on it -
done -

Program overview:
Basic GUI set up 25%
Concepts for writing to file
first screenie
create icons 20%
write icons to file 5%

Yes it's free!

Download screenies now!!!!!

Post what you think about this software. If I get enough support I will create it...it's just a big project and don't want to make something that no one will want to use.

Attachments

Login to view attachments
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 18th Aug 2006 05:22
It sounds like a great idea! It would definately be a jumpstart! Depending on how much time it would take you to develop that type of interface, how much longer would it take to develop a more complete World or Level maker?

Something to consider,

People like being able to just "draw" a scene or objects and have them interact. If you really wanted to put in the time, you may want to pull apart Robin King's Magic World

http://www.robinking.com/allseeingi/magicworld.htm

and see how it was put together. It's an excellent example of a GUI interface and the source code is available. This might be a great starting point if you wanted to add to it - things like animation, or actually a modelling interface - maybe collision detection etc. If those things were added, you'd have a pretty complete DB world creator.

Check out any of the level makers in the showcase. They all have different strengths. Should at least give you some design ideas.

http://darkbasic.thegamecreators.com/?m=showcase&i=5

Enjoy your day.
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 18th Aug 2006 05:33 Edited at: 6th Oct 2006 03:06
It's not a world maker it's suppose to be a code generator.

But, now it's a world maker.

Fun list of quotes I came up with:

Quote: "|School, Programming, Eat, and Sleep...Programmers Daily Cycle| By: Gfs"


Quote: "|What goes up must come down. If not there is an error.| By: Gfs"


Quote: "|Why most projects are unsuccessful is because people give up without knowing how close they were to being done.| By: Gfs"


Quote: "|Real programmers pursure their dream and never give up.| By: Gfs"


Quote: "|A way to ones heart is though looking at how they program.| By: Gfs"


Quote: "|You best ideas come before you sleep.| By: Gfs"



Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 18th Aug 2006 06:21
Just throwing some ideas at ya...

After clicking on a button to say, create a cube, would there be a dialog box to enter dimensions?

Enjoy your day.
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 18th Aug 2006 16:47 Edited at: 6th Oct 2006 00:53
Here's a more clear understanding.... This program is a text generator for db or db pro. It uses buttons and prompt boxes to generate code on a text file and is suppose to cut down on typing time by writing a command for you. Example: I press the load object button. Then I explains what it is which can be toggled off or on depending on if switched them on or off at the beginning of the program. (This part I made for newbies) Then It would ask for a path for the file then if I was done I would press export script and it would write the code on a text file. I could copy the text on the text file and paste it in db. This is the purpose of the program. This program doesn't use db in anyway. It uses GML game maker language which was my first program I used to toy with.....I also have some games make with it to but I don't know if people would get mad if I post them in a db form....

It doesn't use db like I wanted it to so I ended up dumping the project once I looked at how long it would take for something I may not use. I will use your idea thought to make a world creator because I couldn't find a good one that would write the code.

This new project I have already come up with some issues. You create one object then set all it's properties and positions how do you cut down on code or save fps in the game because 400+ objects = 400+ lines of code which seems would run slow.

Thanx for the idea!

I am only in to about a few months of db so I might ask alot of questions!

It was easier for me to make it in game maker code so that's why I used it because it has more text commands but you would be suprised how close it is to GML.

Edit: I did check them out and have tried a few. Magic world I have created levels but can't export it in db code and I don't want to create something like magic world because there is no snaping to next space.(using the size) Also I need to include particles, lights, 3d sound listeners, effects boxes (An idea I hade to use an effect at a position of a invisible box), and load and export code. I have seen what effect files are but still a little confused because I know what it is but never able to get them working...(DB pro)



Dark World in development.

Real physics engine, position objects, particles, lights, and event areas. Click and create each aspect of the game and load it to a main file that will run the game. Use it with or without dark basic.

Due Date: Nov 2007
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 19th Aug 2006 01:31 Edited at: 6th Oct 2006 00:53
I need help with functions!!! I haven't used functions in a while so I need some help. I am trying to figure out how to use the varibles in the function. I think you use globals.








Dark World in development.

Real physics engine, position objects, particles, lights, and event areas. Click and create each aspect of the game and load it to a main file that will run the game. Use it with or without dark basic.

Due Date: Nov 2007
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 19th Aug 2006 02:05 Edited at: 30th Sep 2006 05:46
Never mind I got it to work.... duh.... I forgot to use endfunction [return varible]...



Dark World in development.

Real physics engine, position objects, particles, lights, and event areas. Click and create each aspect of the game and load it to a main file that will run the game. Use it with or without dark basic.

Due Date: Nov 2007
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 19th Aug 2006 02:07
what exactly are you trying to do?

Are you trying to create a text version of a function to include in your editor's output file? Or are you trying to write a function in DBC?

Functions contain local variables, but the values of globals can be passed to the function through the function parameters. A function can return a value.



Enjoy your day.
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 19th Aug 2006 02:22 Edited at: 30th Sep 2006 05:46
Just an function in dark basic pro code.

Edit: I am having trouble with this code...

Heres the code:


[center]


Dark World in development.

Real physics engine, position objects, particles, lights, and event areas. Click and create each aspect of the game and load it to a main file that will run the game. Use it with or without dark basic.

Due Date: Nov 2007
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 19th Aug 2006 19:56 Edited at: 30th Sep 2006 05:46
Dark World in development.

Real physics engine, position objects, particles, lights, and event areas. Click and create each aspect of the game and load it to a main file that will run the game. Use it with or without dark basic.

Due Date: Nov 2007

Attachments

Login to view attachments
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 19th Aug 2006 19:59 Edited at: 6th Oct 2006 03:07
I have another problem.....

When I load my sprites and load them onto screen they end up looking funny....like the black color is see though as in you can see the 3D maxtrix though it.

Another thing is they are bigger then they are suppose to be and they are distorted. What do I do to get them back to the right size and show the black???

Download the pix...

Edit they are old pix so you can see black though the black not the maxrix....but in my program you can see though them.










Dark World in development.

Real physics engine, position objects, particles, lights, and event areas. Click and create each aspect of the game and load it to a main file that will run the game. Use it with or without dark basic.

Due Date: Nov 2007

Attachments

Login to view attachments
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 21st Aug 2006 06:44 Edited at: 23rd Sep 2006 10:48
In your wireframe toggle code:

do
if mousey() > 426 and mousex() > 0 and mousex() < 41 and mouseclick() = 1
if wire_frame$ = "on" then wire_frame$ = "off"
if wire_frame$ = "off" then wireframe$ = "on"
endif
loop

I think you meant:
if wire_frame$ = "off" then wire_frame$ = "on"

There's no underscore in your original code.

Your sprite sizes:

Maybe when you drew your pictures, your screen resolution and depth was higher than the mode you are running DBC in. The default resolution for DBC is 640x480X16. You might want to switch it higher with SET DISPLAY MODE.

Enjoy your day.
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 21st Aug 2006 16:55
Thanx! I got the size to work, but what about the black showing up as green. The back drop is set to green so the black is turned in to green?

attached

Attachments

Login to view attachments
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 22nd Aug 2006 03:15
use the SET SPRITE command and set the transparency to 0 (turns black as transparent color to off)


SET SPRITE <sprite num>,<BackSave>,<Transparency>

Enjoy your day.
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 24th Aug 2006 00:47 Edited at: 24th Aug 2006 00:48
Can you have a function that returns nothing just executes code outside of the main loop and is only runned with a constraint to reduce some lag. How would you set up an infinate array for users input of object position, number, properties ect.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 24th Aug 2006 08:53
Yes. You could, for example, have a funtion that just prints text to the screen - never returns a value; or a function that updates all the positions of your objects.

An infinite array? If you planned on storing lots and lots of info without destroying it - you might want to store it in a file as a database or something like that. The larger an array becomes, the more memory it gobbles up, and ultimately you might suffer a performance hit.

If you really want to store it in memory, you could conserve space with compression routines. Though, this could cause a performance hit as well.

Instead of an infinite array, you might place limits on how much info is stored in the array before it is automatically saved to a file. You could then wipe memory (clear out the array) and start over with new info, knowing that the previous info is safely stored.

Enjoy your day.
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 24th Aug 2006 14:27
Thanx.
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 25th Aug 2006 03:41
object_position#(object_pick#,2) = objy#

I get an error that deals with the object_pick# varible what is wrong with it. (I have already used a dim object....(50,3)) This array stores the object number that was picked then the x which is 1 y which is 2 and z which is 3.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 25th Aug 2006 04:33
you shouldn't be using a float. Array index values can only be whole numbers [0,1,2,3,4.....]. Change or create another variable to stand in for object_pick# (maybe just pick_object - without the #)

Enjoy your day.
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 25th Aug 2006 14:38
After this project is done it will be able to position objects, 3D sounds, lights, event areas, rotate all the ones I just said, and maybe a scripting engine for the objects properties like movement and have functions that are set up in my premade script set and you will also be able to make your own scripts. (all in db pro) If you have any ideas and how to do them I will try to get them into my editor!
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 26th Aug 2006 02:07
It still didn't work and I have array problems. The error message stated that object_position doesn't exist. It does exist that is why I am confused.

Here's the code:
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 26th Aug 2006 07:49
I'm not familiar with DBP code but I think in the line

object_position(obj_pick).object_x = objx#

In the array object_position you originally defined object_x# as a float in the type definition, but when you are writing it as a field in object_position(obj_pick).object_x you left out the # after the x. So it might just be a typo that's holdin' you up. Try it with the #.

Don't get confused with my previous post where I stated the array index has to be a whole number. ex: apple(22) - the number in the parenthesis is the index.

Also, at this point in the program does obj_pick have a value? You have to make sure it isn't out of the range of your dim statement (0-50).

Enjoy your day.
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 26th Aug 2006 16:54
How the type works is it just defines the numbers as varibles.

Example:



What this code is suppose to do is the same as this line of code



is suppose to do except it defines the numbers 1 - 3 to these varibles called types. It makes it easier to define more then one varible in an array.
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 28th Aug 2006 23:43
thanx I got it fixed!
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 30th Aug 2006 02:49 Edited at: 1st Sep 2006 02:07
How do you insert a pix???????? I was going to but confused?
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 30th Aug 2006 04:34 Edited at: 1st Sep 2006 02:07
I have a question about how to read off a data file.

Here's the code:





This is what I use to write to file and I have made sure that everything is defined my question is why isn't this code below not working.

Here's the code I am having a problem with:



I have enclosed the file that needs to be read. I used types for this and have no clue what to do to get the types I have wrote to the array, out of them.

Modeling links:
http://forum.thegamecreators.com/?m=forum_view&t=87205&b=7

Attachments

Login to view attachments
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 5th Sep 2006 21:34
In your first bit of code, it looks like you are writing float values to the file. Float values are 4 bytes long.

In the second bit of code, you are reading bytes out of the file. Bytes are one byte long - so you can see, you are off 3 bytes per read.

Since you used WRITE FLOAT, you should use READ FLOAT instead of READ BYTE.

Also, in your type definition, don't you have to make object_x, object_y, and object_z floats if you are going to read and write float data to them?

Enjoy your day.
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 21st Sep 2006 02:15
Is it possible to have a program record commands in darkbasic as a string to a text file then open it with another an run it? If it is possible how would it be done?

I have already took a few stabs at it by using this method.(it didn't work) Is there any other method of doing this?

Maybe some why of compiling it.

Note I want the user to type up a program in a text document and run it in by opening an executable.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 21st Sep 2006 11:38 Edited at: 21st Sep 2006 11:46
Yes. You can still use the method I mentioned before. First, create your script file by writing strings of DarkBASIC commands to it. Save it with the .dba extension. This example asks the user to type:

Print "HELLO WORLD"

as a command string and creates the file test_exe.dba.



Now, if your program allows a command line interface, you can send the following commands to the shell to create an executable out of the script:

DB.EXE -b "test.exe" test_exe.dba
This creates an exe with no media.

DB.EXE -f "test.exe" test_exe.dba
This creates an exe with media.

You'll have to supply the proper directory paths.

If your program doesn't allow command line, then you can have your program create a batch file at the same time it creates the .dba script. The bat file has a .bat extension and might be named in this case test_exe.bat.

Inside it might look like:

"C:\Program Files\Dark Basic Software\Dark Basic\DB.EXE" -b "test.exe" test_exe.dba

There's a way to have a batch file find the first occurance of a program without you having to put a literal path, but I've forgotten how to do it. You can look it up online.

Anyway, once the bat file is created, the user just double clicks on it and it creates the exe. Then click on the exe to run the newly created program.

Oh yeah, if you want to run the script without turning it into an executable, the same methods apply except the line command is

DB.EXE -x test_exe.dba

Enjoy your day.
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 23rd Sep 2006 00:23
I get how you laid it out just what commands would you use to commands to the shell?

I don't get how this works:

Quote: ""C:\Program Files\Dark Basic Software\Dark Basic\DB.EXE" -b "test.exe" test_exe.dba

DB.EXE -b "test.exe" test_exe.dba
This creates an exe with no media.

DB.EXE -f "test.exe" test_exe.dba
This creates an exe with media."


Also what would the second file look like that was executing the shell???
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 23rd Sep 2006 11:39
Ok,

If you are still using GML I think you send a command line string like this:

In GML, I believe the function to run an external program is
execute_program(prog,arg,wait).

So, if the darkbasic script that was created by your code maker is called test_exe.dba, and you want your final exe to be called test.exe, then in GML I would guess the function looks like:

execute_program(DB.EXE, -b "test.exe" test_exe.dba, wait)

Though I've never used GML - I gleaned this off of the help page.

Quote: "I don't get how this works:


Quote: "C:\Program Files\Dark Basic Software\Dark Basic\DB.EXE" -b "test.exe" test_exe.dba

DB.EXE -b "test.exe" test_exe.dba
This creates an exe with no media.

DB.EXE -f "test.exe" test_exe.dba
This creates an exe with media."

Also what would the second file look like that was executing the shell??? "


Sending something on the command line or executing a shell command (basically the same thing) means sending the processor an instruction to run a program directly - without using a point and click interface. Shell commands are direct to the program, but their parameter conventions can be a little cryptic - (this has to do with ancient days of CPM and UNIX type processing, C, DOS and - blah blah blah - I'm sure you don't really care about any of that)

The command:

DB.EXE -b "test.exe" test_exe.dba

would generally be typed on a DOS command line and means

-run the program named DB.EXE
-use the switch -b which stands for "build an executable"
-this will create an executable file named test.exe
-from the input file named test_exe.dba

This assumes DB.EXE is in your set path. If it isn't, you have to include the full directory path of where it's located.

That's what

"C:\Program Files\Dark Basic Software\Dark Basic\DB.EXE" -b "test.exe" test_exe.dba

is an example of. In the batch file, I had to include the full path to where DB.EXE is located (that is the main DarkBASIC program - the one you bought, not the executable you are trying to create from the script)

The switch -b means build an executable that doesn't include the media.
The switch -f means build the final executable that contains all the media.

If you are using GML, the command I referenced at the top will probably do the trick, you'll just have to read up on the syntax to make sure the quotation marks and such are in the right places. If you decide to use the batch file, then it's no more difficult than creating your script file.

A batch file is another method to send strings to the command line. It's basically a DOS script that has a series of commands that execute in sequence. You can perform various disk functions including launching applications.

I'll attach a copy of the batch file so you can see what it looks like. It's really just a text file with a .bat extension, and contained inside is the command to create an executable out of a darkbasic script.

Enjoy your day.

Attachments

Login to view attachments
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 23rd Sep 2006 16:42
Thanx! I am creating a new program and I needed a way for users to execute commands without the dark basic program. How my program would work is it would load images, place them on a grid, and write the positions on a data file. The user would next enter a bunch of commands in a text file that have to do with the images that were placed. One command might be to open a file by clicking on the buttons that were just created or goto a loading screen. This program is like a gui creator so the user doesn't have to spend a lot of time on little things in programming.

This is one of several programs that I am creating. If shelling out commands to each program is successful then it will allow users full control of this big program without using dark basic.

Another program is a world creator called dark world that has a bunch of useful buttons kind of like magic world except it uses dark basic pro to create and minipulate objects, textures, lights, particles, event areas(execute script if in area), marker(position of main character), and if I have time it will be able to use shaders.

There is also going to be a terrain editor that can move a point up or down by using a rod that is controlled by the keyboard kind of like T.ED that plugs into Dark world. (Deals will any of the enviromental things like shaders, the sun, and much more)

Scripts can be used for both of these programs.

To make there video game all the user would have to do is collect all the data and extention files with a executable that is premade to run the scripts and the main program and put them in a folder. A main program would run the gui menus first which would run each file in a certain order.


There will be several other program that will go in this package and any ideas would help!
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 24th Sep 2006 04:05
Just so I'm not misunderstanding you:

In order to create a DarkBASIC exectuable, the user would have to have Dark Basic installed on their computer.

If you want them to be able to "make there own game" so to speak, without having DarkBASIC installed you would have to create an application that not only creates the code, but can run it as well.

But if you want owners of DarkBASIC to be able to quickly create code by clicking buttons or choosing menu options, I think you are on the right track.

Enjoy your day.
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 24th Sep 2006 16:34 Edited at: 24th Sep 2006 22:49
You got it! I am not creating the quick code program though because that will add alot of time to my project. To make things even more clear I will soon post the specs of my program along with a few old screen shots an one new one. (Mostly GUI) I might even have a short demo of the older version.

Edit:

Here's some screen shots!

Attached.....

Attachments

Login to view attachments
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 25th Sep 2006 00:18 Edited at: 30th Sep 2006 05:47
I also have another question. How do you have two programs communicate to each other while both are running? I am wanting to check the clipboard in a do,loop and if it equals an number then record it some how and stop checking.

Here's my code



I want it to include all numbers and a constrant so I doesn't write it repeativly. Like to store the last clipboard in a varible then comparing them. Is there a better way of doing this?

Edit: Is there an easy way to do this like you storing something in memory and reading it from memory??

Would this work?






If this would work how would it be used for what I am doing?


Dark World in development.

Real physics engine, position objects, particles, lights, and event areas. Click and create each aspect of the game and load it to a main file that will run the game. Use it with or without dark basic.

Due Date: Nov 2007
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 30th Sep 2006 01:10
What two programs do you want to communicate?

The first thing you have to figure out when getting applications to "work" together is to determine first, what kind of information can they both use. Not all programs are compatible - even programs that output text may add a little bit of formatting or remove all of the line feeds or whatever. You have to find out first, what kind of information is common between the two programs.

Let's say text (string) information can be used by both. Program one can output a line of text in a file or send it to the clipboard, Program two can do the same. In this startup stage of making the programs share information, I wouldn't use the clipboard for the test. The clipboard is too dynamic for an early stage to see if the programs work together. Clipboard information can be erased and changed too easily to make it a sound test environment this early on.

I would use a file first, because it is less dynamic. You can view the file, rename it and save copies, use it over and over without (hopefully) corruption of the data.

So far in our test scenario we've determined:
1. Both programs can use text information
2. We will attempt to pass information between the two programs using a common file that they can both write (to).
3. ?

For our 3rd step, we know both programs can write a text file, but can they both read one? And how do they do it? Does the text have to be formatted in a certain way?

Now we run a series of output tests for each program. Have the programs output several lines of information and then look at the created file(s) to see if it is what you expected and if the output of one program is compatible with what you know about the other program. If it's not what you expect, rewrite the output for each prgram until it is compatible with the other.

Note: For the two programs to share information, the output of one program doesn't have to be in it's own format, it has to be in a format the OTHER program can understand. If this can't be done, then you have to modify the reading in routine to make the information compatible as it's being read.

So far in our test scenario we've determined:
1. Both programs can use text information
2. We will attempt to pass information between the two programs using a file that they can both write (to).
3. Both programs can read the information that's contained in the file(s)

If you can succesfully pass the information in the file, you should be able to modify the code to pass it via the clipboard.

Before getting one program to control and launch the other, resolve the ability of sharing information. In the case of the file, you can launch one program, create the file, then launch the other one and test the ability to read the file. You can do the same with the clipboard.

With all that said, to send information in DBC to the clipboard:



create a file, save it, then write it to the clipboard:



If this information is already on the clipboard, you can read through the clipboard by just dumping it into a string variable:



As far as comparing the clipboard i don't really understand.

Why do you want to compare them? Is there a value or a change in value that you would want to find?

Enjoy your day.
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 30th Sep 2006 01:48 Edited at: 6th Oct 2006 00:54
The information is stored in a data file. It has a mode in the main loop. Mode one is read info from file, mode two writes data, and mode doesn't read or write just skip these commands. This is for each program. What I meant for comparing clipboard was compare the modes and do what every according the mode that was set.

(Clipboard would set the number for the mode....better way???)

I am using Game maker as a gui menu and Dark basic pro is doing everything that game maker sends out. The commands are the same. So think of it as a Dark basic to Dark basic communication and I will convert the code over into game maker commands.

Dark Basic Professional will be creating the batch file...but how can you run it without having dark basic??? This program is self reliant; works without the help of a dark basic program. I thought about just using the nessisary files for compiling and some how making the dark basic editor unable to be runned by the user so they can't use the program but I wouldn't want the user who doesn't have dark basic to be able to run it.

What does this mean:




Also in the future after taking physics I will create a physics engine and a collision engine for my project.

Sorry I am asking dumb questions that I just over looked the answer. I am not even out of high school yet so I am not up with my math that would help with vector calulations. They don't provide the right math for 3D calulations at my school.

I just started to use dark basic pro last year and I am creating a big project already and am ready to spend the vast quanity of time while at school.

Would you like the full documentation of my ideas so you know what I am doing? I could send them by email along with what I have so far so you would have a better understanding of what I am doing.

My program is kind of like a program that has many plugin's that will all be able to create there own kind of file and will be collected by the main compiler that will run them. For the DBPro uses they will be able to view the files info and copy the source code, run it all together, and have there project done without having to do all that scripting for positioning things and long math. It's just a massive tool set that will help in creating a video game project. Later I will have documentation of how to use everything in detail...kind of like a book that explains everything step by step. I will also learn a modeling programs so I can help people create better models. Also I will learn several complex engines later for light mapping and such. I want to cram pack this project so much that anyone will be able to make there program at it's best and will a little programming as possible.

Although this is hard to say it, there will be a price on this very reasonable for my work. I will make sure that everything is in working order before I realese it.




Dark World in development.

Real physics engine, position objects, particles, lights, and event areas. Click and create each aspect of the game and load it to a main file that will run the game. Use it with or without dark basic.

Due Date: Nov 2007
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 30th Sep 2006 04:07 Edited at: 2nd Oct 2006 03:20
I think I understand...

You are creating the program that you would distribute, in Game Maker (GM). The user will click on buttons, or fill in text boxes, or draw picture, or whatever you allow them to do in GM, and this information will be sent to DarkBASIC Pro (which is hiding underneath so to speak). DarkBASIC Pro will take the commands sent to it and create the necessary 3d. Also, the commands will translate into an actual DBP script that the user could edit or change.

If this right I see where you are having problems. If the user has DBP installed on their computer, they could just start DPB and run the script files created by GM without a problem.

But if they don't, you would need to have created a DBP executable that runs the script files. So then the question is "How to pass the commands created by the GM GUI to the DBP executable?"

If I got this right, you are actually trying to recreate the DBP compiler for those that don't own it.

Quote: "Would you like the full documentation of my ideas so you know what I am doing? I could send them by email along with what I have so far so you would have a better understanding of what I am doing."


Sure,

Though I think there is a 2mb limit with this account.

Enjoy your day.
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 30th Sep 2006 05:38 Edited at: 6th Oct 2006 03:08
You've got it!

As you know this is a major project, but I love to share ideas and mold my ideas from what I learned from other people so thanks for helping!

You can edit out you email because I got it.

I will send the documentation when I am done gathering it.

Note: I working very fast on my project on the weekend and friday night so you may have a questions during the day. This is to make sure that my project is done on time.


<edit>

New update

I am making a function that has every command on it. So the user without a dark basic pro program can just enter attribute in this function that are runned in a certain order.

Example:

(Command will be the command that I assign to the command in dbpro)




This can be a useful function to people who want to accomplish the same thing.

Since this is a function it should run smoother then just putting it in a loop and because all the commands will be written to file the function should have no problem accessing the commands.

</edit>





Dark World in development.

Real physics engine, position objects, particles, lights, and event areas. Click and create each aspect of the game and load it to a main file that will run the game. Use it with or without dark basic.

Due Date: Nov 2007
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 1st Oct 2006 16:42 Edited at: 7th Oct 2006 16:46
I found an easier way to get the scripts to work but I have a problem with it.

I created an executable with this code:



and the script file like this:



When I change the print statment to print something else it prints the same print statment. Is there a way to have it change it with out running it just thought the dark basic compiler?


<EDIT>
Also how can you just run one command that the user enters in the program using a input command instead of shelling commands from another file to this one creating a new executable.
</EDIT>


<EDIT>
The more I learn the more gets added to the project. I am now going to use windows gadgets for the GUI and also windows events to make things run a little smoother. This means that everything will be in dark basic pro now...unless it doesn't work.

I am also using Visual Basic to make the menu's and write to file. This will take the place of game maker.

I just started to learn VB so this might lengthen the time of it's release.


</EDIT>
______ = Most reasent update



Dark World in development.

Real physics engine, position objects, particles, lights, and event areas. Click and create each aspect of the game and load it to a main file that will run the game. Use it with or without dark basic.

Due Date: Nov 2007
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 6th Oct 2006 22:53 Edited at: 7th Oct 2006 16:46
@Latch: Can I use your pool ball example you make in this post to get me started with my physics engine?

(I will put your name in the credits for it.)

Edit: Here's the link: http://forum.thegamecreators.com/?m=forum_view&t=86881&b=10



Dark World in development.

Real physics engine, position objects, particles, lights, and event areas. Click and create each aspect of the game and load it to a main file that will run the game. Use it with or without dark basic.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 6th Oct 2006 23:52
You can use the example and credit me, but it is a work in progress. And if you look up my approach against "standard" physics sims of colliding pool balls, you will see some differences. My collisions behave more how I "expect" them too rather than what is "supposed" to happen according to the texts I've read. And my example leaves out spin, friction, elasticity, and gravity for the most part.

I wasn't satisfied with most texts explanations so I had to find a way to approach it that I understood.

In regards to your program:

If you are going to utilize various API's along with DBP, you may want to consider a target audience and what the system requirements will be of your final product. Is everyone going to have to have the very latest Direct X installed on their machine to use your app? Is everyone going to have to have Windows XP or Vista or can it be run on a Windows 98 machine? Are there any additional DLLs that people will need, or graphics card specifications? These are just a few quesionts to keep in the back of your head.

Enjoy your day.
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 7th Oct 2006 00:07 Edited at: 7th Oct 2006 16:45
I only need a basic physics in my project I won't into much. Just enough to have deflections like in the pool ball example and behavior if a box if it id dropped on another box. It's going to have built in physics objects.

I am having a problem with text in an image. When I load my image using 'load image' and making it a sprite the text has some pixles missing. I have the transperency set to 0 so I don't know why they are removed.

Were you able to compile the code I sent you? If not I will resend it already compiled.

Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 7th Oct 2006 03:19
I made a few adjustments to the code so it would compile, but I didn't check to see if how I was changing it made sense. I got two of the programs to compile - the dark manager seemed to work though it had trouble making a path.

The gui maker would've taken a lot of time to modify to get it to work with DBC so I haven't done anything with that.

I couldn't get the mouse thing to work - then I noticed you have a couple of key controls in it... I'll have to try it again.

I couldn't use any of the exes because I got a message that said I didn't have directx 9.0c installed. When I look at my computer settings, it says that I do. I dunno...

Pool Ball Physics:
In my example, I wanted to be able to calculate different angles between objects and which directions they were traveling regardless of which direction they were facing. For me it meant not using any of the OBJECT ANGLE commands because those commands return values based on which direction an object is facing - I had to come up with the math to do this.

Though I thinks it's cool that you think my demo is useful, you may want to hold off on using my collision example because it is incomplete and I don't really know how accurate it is. I was doing it as a learning tool to understand some of the basics of collisions in 2 dimensions.

Boxes dropping on top of each other can be a little complicated. If you study physics you probably could handle it without too much trouble. Sphere's are easier to collide because there is one point of contact and generally not a shift in the centrum (center of mass). The boxes would hit at a point then rotate and hit at another point - There are some great examples of this on this website:

http://www.adamdawes.com/programming/tokamak/index.html

Enjoy your day.
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 7th Oct 2006 04:26 Edited at: 7th Oct 2006 05:05
I see if I can get the programs to work for dark basic so don't worry about it, I will convert the code over into dark basic.

I sent the fixed files to your email.
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 7th Oct 2006 20:50
Check out this link, It's a response I recently posted that might help with your physics engine:

http://forum.thegamecreators.com/?m=forum_view&t=90542&b=10

Enjoy your day.
Gamers for sale
18
Years of Service
User Offline
Joined: 19th Nov 2005
Location: Some where beneath the elements
Posted: 9th Oct 2006 19:00 Edited at: 10th Oct 2006 03:40
I am having a problem with loading images to dark basic. The text turns out really weird and I don't know how to get it back to fix this.


Here is the original image:

Removed

Here's the image loaded in to dark basic pro:

Removed


It streched the image and messed up the text can you help me?

I have messed with the display mode and can't get it to look right.

Login to post a reply

Server time is: 2024-05-03 15:28:38
Your offset time is: 2024-05-03 15:28:38