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 / Darkbasic in a Game

Author
Message
Data
20
Years of Service
User Offline
Joined: 26th Nov 2004
Location: Winnipeg,Canada
Posted: 22nd Feb 2006 04:08
Just a question, for a game I want to make I want the user to be able to code in darkbasic while playing the game as this is part of the game. I won't go explaining the whole game right now but is this possible?Can I have the user coding in darkbasic while playing what I have made in darkbasic?

http://jimmyr.co.uk
"THere is no spoon"
MORPG programmer
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location: runescape
Posted: 22nd Feb 2006 04:52 Edited at: 22nd Feb 2006 04:54
yes, but its extremely hard... you have to essencilly re-write the DarkBASIC compiler.

MORPG programmer?
nah, MMORPG gamer is more like it =D
3D modelers needed for new MORPG!! join now!!
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 23rd Feb 2006 12:58
I dont think it is so hard and you dont have to re-write the
compiler.
You can write some code you want, then save this as a .dba and
add:
function input()

rem code here
endfunction

and use #include "name.dba"

and call the function:
input()

I think the hardest thing will be the "console"
try to use "input" but it has some bugs

[/center]
Sunflash
19
Years of Service
User Offline
Joined: 28th Jun 2005
Location: Seattle, Wa
Posted: 23rd Feb 2006 21:45
Yeah, have the code write to a .dba file, then open and read it when you need to, use the #include command. Then when your done, delete it.

When FPSC develops enough, lets make a Redwall game!

Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 23rd Feb 2006 23:36
nope, when one include option is made and an .exe is built it will read all the dba files that are (included) and write them ALL INTO ONE .EXE file , by that tgc is protecting from someone to make the same Dark Basic in a few secs with Dark basic.

Milkman
19
Years of Service
User Offline
Joined: 30th Nov 2005
Location: United States
Posted: 23rd Feb 2006 23:40
Dodic's right on this one...

formerly xMik
MORPG programmer
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location: runescape
Posted: 24th Feb 2006 03:31
yep, i was right, you have to re-write the compiler.

MORPG programmer?
nah, MMORPG gamer is more like it =D
3D modelers needed for new MORPG!! join now!!
Dodic
19
Years of Service
User Offline
Joined: 6th Nov 2005
Location: SNM (Serbia&Montenegro)
Posted: 24th Feb 2006 13:00
Witch might not be legall to do in DB..Perhabs yes, maby not...

Anyways it would be a heck of a job to do...Thats what i was working on in "Shark Basic", and well, i stopped..there is a point where you cant progess more, and by that make a working interpreter. (the problem was in making do/loops work...if i had..i would make the same DB in a few weeks time...)

blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 24th Feb 2006 21:38
Quote: "Just a question, for a game I want to make I want the user to be able to code in darkbasic while playing the game as this is part of the game."


There are (last time I checked when I was online, a month ago or so) there were numerous scripting languages available in some of the PA & WIP boards. I recommend you get a particurlaly DBC-friendly one and just make sure the language syntax is familiar to DarkBASIC's own. That's the best thing about some of the interpreter languages; you can tweak them how you like.

A simple interpreter should do the trick, although you'll have to fake it a bit if the user (in the game) runs arbitary code to modify your game. Fake it basically. ^_^

Support us! Click! Image! Visit! Site!
MORPG programmer
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location: runescape
Posted: 25th Feb 2006 20:14
dodic, makimng a compiler...hard? lol i redid my compiler about 15 times and i'm almost done with the final piece of it. its not hard, just time consuming.

MORPG programmer?
nah, MMORPG gamer is more like it =D
3D modelers needed for new MORPG!! join now!!

Login to post a reply

Server time is: 2025-05-23 16:50:14
Your offset time is: 2025-05-23 16:50:14