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.

Dark GDK / KaosScript v1.0 Release

Author
Message
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 25th Dec 2008 05:16 Edited at: 28th Dec 2008 03:56
I put this off for quite a bit, but I got it working now. This is the third re-write. Enjoy!

KaosScript.h


KaosScript.cpp


Value names must be unique, but everything else can share names. Since that example explains the syntax, I don't need to say much more, but that it is solely line-based, so you can't have multiple statements per line, sorry.

I've thought of several uses, especially as a world saving type format. You make a block for each object in your world, and then load it.

Lines cannot be longer than 512 characters, but you can change that in KaosScript.h, the #define for MAX_LINE_LENGTH.

KaosScript is also loosely typed. Everything is a string until you cast the value. I don't know what happens if you cast a value with letters to an int or float, though. Probably turns to the ASCII values or something.

My next project is a world editor, saving to .kaos files.

Example - in my FPS's format (called Kaos, which KaosScript was made for), loads the player, a plane to stand on, and a box to push around.


This probably won't work with "vanilla" KaosScript. I mean, it will, but it won't do anything, since KaosScript is just a data formatting language. It's very flexible, though, and it's more like XML than anything (not syntatically.)
--------------------------------------------
New: C++ Usage Example
This is an excerpt from my game engine, it's not DarkGDK, but that doesn't apply to this.


"settings" is a struct containing three values indicating whether it's fullscreen or not, and the screen resolution.

Here's the relevant part of the .kaos file, "cfg/XarxesSettings.kaos".


As you can see, the block type isn't necessary. Neither is the block name, but then, how else would you find it?
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 25th Dec 2008 10:54
Maybe its just me because Im full of x-mas food but cant you give an example on Kaos script?

Niels Henriksen
www.tales-of-the-realms.com
if Microsoft can sell software with bugs, so can I.
CPPP
15
Years of Service
User Offline
Joined: 30th Nov 2008
Location:
Posted: 25th Dec 2008 18:51
Yeah, Now it only causes chaos in my head!
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 26th Dec 2008 09:06
Whoa, I thought I did. Ok, it'll be there now.
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 28th Dec 2008 05:41


I can't get it to work in a 64-bit MSVC.
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 28th Dec 2008 06:31
Looks cool!

I've been thinking about doing something like this for my next game, as it really helps when you start getting into bigger projects. Nice job.

Login to post a reply

Server time is: 2024-09-30 13:32:42
Your offset time is: 2024-09-30 13:32:42