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 / DarkBasic Pro and XML

Author
Message
Danimal Crackers
21
Years of Service
User Offline
Joined: 7th Nov 2002
Location:
Posted: 7th Nov 2002 21:40
I'm completely new to DarkBasic and DB Pro, so this might sound like a silly question. Now... I know that DB and DB pro are geared toward graphics programming, but I heard that Dark Basic is robust enough to program anything, even if it's not really practical... sort of like programing a game in Visual Basic. Visual Basic isn't really a good program to use if you want to make a game, but you can still do it.

So... can anyone tell me if XML possible with DB or DB pro?
The One Ring
21
Years of Service
User Offline
Joined: 15th Sep 2002
Location: United States
Posted: 7th Nov 2002 21:46
Creating and parsing data in XML files is entirely possible. XML is text based, and DBP provides methods of reading and writing text files.

DBP doesn't have built-in support for just simply parsing XML. You'll have to write your own routines to do that, but it can be done.

AMD Athlon 900 768MB DDR
ATI Radeon 64MB DDR All-In-Wonder 7500, ATI XPert 128 16MB
Sound Blaster Audigy Gamer w/FireWire Support
rapscaLLion
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 8th Nov 2002 00:29
ya.. but y would you do that?

Alex Wanuch
aka rapscaLLion
Get the DB Weekly Newsletter at www.dbwn.cjb.net
Danimal Crackers
21
Years of Service
User Offline
Joined: 7th Nov 2002
Location:
Posted: 8th Nov 2002 00:46
Good question...

I want to use XML in my DarkBasic programs because there are some wonderful XML-based chat bots out there that are so life-like, it's down right spooky: characters that appear to be so intelligent, they might as well be another player in an multiplayer invironment. That opens a lot of possibilities for an RPG type of game.

rapscaLLion
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 8th Nov 2002 15:02
I see. I think it would be easier just to program one yourself though, because otherwise you'd have to load in an XML script and write a program to process it. Doesn't sound easy...

Alex Wanuch
aka rapscaLLion
Get the DB Weekly Newsletter at www.dbwn.cjb.net
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 8th Nov 2002 16:46
writing an importer is simple... thought how speedy it'd be would be another thing entirely

if i were u i'd create my own bot setup because just being able to import them isn't enough you'd need the actual code to know what to do with that data - in my experience unless you create it yourself, usually you miss a few things and it never quite works how you want it to.

Anata aru kowagaru no watashi!
flanque
21
Years of Service
User Offline
Joined: 10th Sep 2002
Location: Australia
Posted: 9th Nov 2002 02:18
"Support" for XML is really defined by the end-user's "browser". To get XML working if your game you would have to write your own XML browser or interpreter.

The XML specifications specifically define XML to be easy enough for someone to write an XML parser within a week (?) if I remember correctly. It's something farsical like that.

The problem is that an XML document that works fine in one browser is almost guarenteed to fail in a different browser given that XML is an extensible markup language. You are in effect defining/creating your own markup language (eg. HTML is a markup language) and are then required to write a browser or parser for that language you define.

It certainly would be interesting to see this occur in DBP, however I suspect that DB1 would have been capable of doing this task, it just wasn't tapped into.

:: Specs: AMD Athlon XP 1600+ (1.4GHz), 256MB PC133 SDRAM, Leadtek Geforce 2MX SH 64MB, SB-Live!, LG SWrks 775N 17", MS Natural Pro KB, MS Optical Mouse, Windows 2000 Pro (SP3), DirectX 8.1 ::
Richard Davey
Retired Moderator
21
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 9th Nov 2002 18:59
Technically you could try and write your own xml parser in dbpro - but realistically it'd be a hell of a lot of work and there are several very good ones out there already - so it'd make more sense to utilise those instead.

expat 1.2 is a very good Win32 xml parser and you can download the source for it if you wish.

http://www.jclark.com/xml/expat.html

True, XML (and DTD) files are just plain text so you can read it in - but unless you can parse them, they are pretty useless. Good luck!

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming

Login to post a reply

Server time is: 2024-03-29 13:12:32
Your offset time is: 2024-03-29 13:12:32