Quote: "1. In Unity you can operate with changing variables etc... Why not use DarkBasic Pro to open and read your own files with variables? This would be cheaper, and this way you could also change parts in the game without re-compiling. You would not get all the functualitys from Unity like the arrays and object orintation thought.
So instead of have to do a:
+ Code Snippet
open to read 1,"blabla.myScript"
read string 1,wooo$
close file 1
you could just load a whole file with like 2 commands in Unity?"
Those two are sorta connected so I'll answer both. The example you give is easy. Read one string, close file. However the DBPro code required to say, read files, read in identifiers, cope with strings / numbers / floats, read in data in any order, read in lists etc spirals very quickly. So I suppose the usefulness in terms of data description depends largely on how much you'll use files. If you just store 1 string, then using dbpro would probably be easier. But if you had a file like so
Name="saraf"
Number=1235
AnotherName="sgfdthdfth"
Morenumbers=2314
PlayerPos = { x=1, y=5, z=3 }
It would require a great deal of DBPro code to robustly load that in and store each bit of data against their descriptors.
If somebody can load the above in 2 lines, I'd be impressed
Some time in Jan there's going to be a demo out. You can then use it for yourself and make your own mind up. But for me the three best bits are:
- Having logic separated from DBPro code. Faster compiles. When you have a proper game engine running, it's also a lot simpler just to reference a loaded "chunk" of logic rather than having a long set of IFs in dbpro like so:
if unittype="ship"
do what ships do
endif
if unittype="person"
do what people do
endif
if unittype="tank"
do what tanks do
endif
It's a lot easier just to do something like
lua set function unittype,0,0
lua call
If your game is set up really well this allows you to add new type of unit to a game without touching the DBPro code once.
- Data storage. It's just easier to have complex, multidimensional arrays in unity. In DBPro you cannot do
Weapons("sword").Health = 1
in unity you can.
- Equation solver. Pretty cool imo!
eq$ = "x = 12 + y"
lua set int "y",10
r=lua execute(eq$)
print "X is: ";lua get int("x")
The point is, the "12+y" bit can change dynamically at run time. if you just did
x=12+y
in DBPro it's stuck as 12+y until you change the dbpro code and recompile.