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.

Newcomers DBPro Corner / New to the language: Few quick questions

Author
Message
Wariv
14
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: Iraq
Posted: 3rd Nov 2009 08:59 Edited at: 3rd Nov 2009 11:54
Greetings,

I will try to keep this as quick as possible. I am new to this language. I am switching over from blitz3d. It was easy, but it really had many limitations. It seems like DBPro can do quite a bit more. It's going to take some time for me to get a handle on this new language, syntax, etc. But, hopefully you can help me out with these quick questions.

1.) Object ID's
I noticed that DB does not handle these dynamically? This is not a real problem if I can code past it. Pretend I am making a particle system. Each particle has a sprite attached to it using classes and linked lists. For each "particle" I create, will it have to be assigned a unique id, or will an instanced copy work fine? If this is the case then...I guess I will have to code around the issue. I might try using a system of pointers? Who, knows.

2.) Overloading functions
Is this possible in the native language? If so what is the syntax?

this leads me to my 3rd question

3.) Lets pretend that in a month or two I get relativly comfortable with the language. And I decide I want to create a plugin/library/command set. Would I be doing this via PURE or will I need to compile my own DLL's? I am sure there is documentation on this; I am just looking for a quick answer.

That's it. Upon first look those are the only questions I have right off the start. I bet I'll be lurking in this board for a while until I get the hang of it.


Since this is my first post I will introduce myself proper. My name is Will. Degree in Comp/Sci. I'm a Sysadmin for the USMC. I am currently dying of boredom over here in Iraq. (I'm on the same side of the pond as some of you all now, lol) Anyways, I figure now is the best time to switch languages, I have all the time in the world to learn it over the next few months.

I used to write little FSM automated battles with blitz and turn them into screensavers. However, with DB I plan to get a little more creative. I am looking into creating some modeling software (ie plantlife models), and some other medium sized projects. Just for kicks though. But I am sure I will be researching alot about fractals and scouring the internet for that "one" math equation I need lol. (It's always on the last page of google from my experience.) If it turns out nice then I may try to sell it. Who knows. I would also like to write my own plugins for DB if any of my projects turn out well. Time will tell. Thanks for reading my entirely too long post.

-Semper-
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 3rd Nov 2009 19:12 Edited at: 3rd Nov 2009 19:14
Well, welcome
First out, DBP unfortunately is not object oriented. All sorts of built-in entities are handled using ID's. That said, that id can basically be though of as a reference to the entity it repressents.
By naming variables holding the id's there shouldn't be much of a problem; for example:


1) As I just said.
It is easy enough to write a function that finds a free object / image / etc. id by randomly testing a number a couple of times, whereafter it resorts to a linear search from the last random index. For most actual cases, the random function alone should find a free id within two jumps (most entities, save plugins, memblocks, files and bitmaps, can have ~2.1 billion different ID's, I think).
For the particles, you would set up an array holding the id's of them, which you preferably obtain through your free id-finding function. Something like this:


2) Unfortunately not.

3) You'll have to write any plugins on your own.
There's a tutorial supplied with DBP that tells you how to do this using Visual C++. The actual plugin making isn't too hard, but you naturally need to be familiar with the C++ language in order to follow said tutorial. It would do to be pointed out that you can however access the DBPro core commands from within your plugins, so it is really just a matter of rewriting the loop types and a slightly different syntax, if you were refering to make a plugin out of a successfull DBP project.
On the whole, DBPro doesn't support precompiled libraries or that kind of things.

Edit: Oh yeah, regarding the id numbers, you can adjust your findFreeEntity functions to also create said object, and there you could get a slightly more "dynamic look" on your code.
Something like this would be possible:


Wariv
14
Years of Service
User Offline
Joined: 3rd Nov 2009
Location: Iraq
Posted: 4th Nov 2009 07:02
Alright, thanks for that info. I am going to become a bit more framiliar with the IDE a bit. Then it looks like I will be spending some time in visual studio .

As for my other projects; I think I will just develop them with opengl integrated into a VB app. But I will use DB for my little fun projects and maybe make some .libs in the future. OOP is the way to go. Does TGC have any intentions of making the language a bit more OOP oriented in the future?

I appreciate the response.

-Semper-

Login to post a reply

Server time is: 2024-09-28 12:28:15
Your offset time is: 2024-09-28 12:28:15