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 / 'Hello World' said python :D

Author
Message
Dreq934
20
Years of Service
User Offline
Joined: 15th Dec 2003
Location: SC, USA
Posted: 11th Feb 2004 12:34 Edited at: 11th Feb 2004 13:29
Well, I finally figured out something that you guys could actuially use (though I suppose its already been done....). Well I'll start with the screeny:



I am porting the python scripting engine over to DarkBasic. Its something I could use, and I figure others could too. The screenshot shows me testing File I/O. But I will soon re-direct the standard I/O so you can trap messages directly from python. Of course all python-related imports will work, like WxPython and PyGame ^_^.

*Edit
Don't worry, I'll also add the ability to execute files (and most likely a good number of other things)

*Edit2
And i'll find a way to get and set variables between darkbasic and python.

*Edit3
File execution in ^_^

"I LIKE MARSHMELLOWS!" - Homestar Runner
Dreq934
20
Years of Service
User Offline
Joined: 15th Dec 2003
Location: SC, USA
Posted: 11th Feb 2004 13:57 Edited at: 11th Feb 2004 13:57
Ok, this is overkill:



"I LIKE MARSHMELLOWS!" - Homestar Runner
TheCyborg
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 11th Feb 2004 14:24
looks nice... To bad i don't know the python language

Member of Tjald - Targeted Joint Addicted Liberation Diplomacy

I am (currently) 42% addicted to Counter-Strike. What about you?
Dreq934
20
Years of Service
User Offline
Joined: 15th Dec 2003
Location: SC, USA
Posted: 11th Feb 2004 14:36
Python is a very very nice scripting language.
http://www.python.org/

Python looks like this:


"I LIKE MARSHMELLOWS!" - Homestar Runner
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 11th Feb 2004 14:39
If you can get variables passed to and from python/DBPro, it could be useful, especially if the script could run co-currently to DBPro as well...


The place for all great plug-ins.
XP3000+,1Gb RAM,FX5600,1Mb ADSL,Router,.Net 2003 Pro & me
Dreq934
20
Years of Service
User Offline
Joined: 15th Dec 2003
Location: SC, USA
Posted: 11th Feb 2004 14:48
Well I know python itself has threading support. I can write a python script to execute threaded tasks. But I think i will try to add threading DLL-side, that way maby I can create the "ThreadExecuteString" and "ThreadExecuteFile" which will do their perspective tasks in an async threaded fassion

"I LIKE MARSHMELLOWS!" - Homestar Runner
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 11th Feb 2004 15:06
Forget about variable passing for the moment.

I did manage to get integers/dwords/floats/strings all working at one point, but it was a real hack (as in trying to work out the addresses from the executable code as it was executing) and didn't work a lot of the time.

When/if pass-by-reference is built into the compiler things may change.

For free Plug-ins, source and the DBPro Interface library for Visual C++ 6 and .NET
http://www.matrix1.demon.co.uk
Dreq934
20
Years of Service
User Offline
Joined: 15th Dec 2003
Location: SC, USA
Posted: 11th Feb 2004 15:44
Finally, some interfacing



"I LIKE MARSHMELLOWS!" - Homestar Runner
Dreq934
20
Years of Service
User Offline
Joined: 15th Dec 2003
Location: SC, USA
Posted: 11th Feb 2004 16:58 Edited at: 11th Feb 2004 17:05
Ok, one more for the record before I have to go to work..



By the time i'm done, the whole memblock thing will be transparent

* Edit
I'll eventuially release this with an external "dbfuncs.pyc" which you'll "from dbfuncs import *". I'll make the darkbasic-side functions in the DLL. I plan to do something like this:

DB Pro Code:


The package will make all memory allocation, movement, etc, transparent. I know how i'll do it, but I've gotta leave for work in 40 minutes.. This is gonna take a great deal of time to finish

"I LIKE MARSHMELLOWS!" - Homestar Runner
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 11th Feb 2004 17:05
Someone could have a lot of fun with this. One of my favorite Python applications is OpenRPG, a client/server 2D chat and mapping program.
--
TAZ

David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 11th Feb 2004 23:03
This looks really good. Especially useful for times when you might want scripting in your game, or even for solving equations on the fly!

"They misunderestimated us" - George Bush
"The box said 'Requires Windows 95 or better'. So I installed LINUX. "

Formerly David89.
Dreq934
20
Years of Service
User Offline
Joined: 15th Dec 2003
Location: SC, USA
Posted: 12th Feb 2004 00:19
Yeah, if you don't know how python works. You edit python scripts and save them as .py. When they are first executed, they are compiled on thef ly as .pyc. When you distribute your game, you can just release the .pyc files, which contains aonly bytecode which cannot be read by humans! That means you can easily update small parts of your program without having to send the hwole thing again. (Not to mention giving yoru application its own plug-in support. Online games really accell with scripting languages like this ^_^

"I LIKE MARSHMELLOWS!" - Homestar Runner
Dreq934
20
Years of Service
User Offline
Joined: 15th Dec 2003
Location: SC, USA
Posted: 12th Feb 2004 06:52
Alright guys, I'm about to spend a LOT of hours working on this plugin. If anyone has any specific feature they'd like to see, let me know now

"I LIKE MARSHMELLOWS!" - Homestar Runner
heartbone
21
Years of Service
User Offline
Joined: 9th Nov 2002
Location:
Posted: 12th Feb 2004 07:25
Thanks. This is good. Really good.
I spent all of last spring in (North) Charleston, SC.
Interesting place, with the spanish moss and all.
I hope that you can finish this project before it gets too hot.
Python rules.

Peace, the anti-Bush.
Dreq934
20
Years of Service
User Offline
Joined: 15th Dec 2003
Location: SC, USA
Posted: 12th Feb 2004 07:29
I used to live in North Chlareston
And yeah that spanish moss was neato.. nothing like grey scraggily moss covering trees to really lively up the view

*goes back to work on DarkSnake*

"I LIKE MARSHMELLOWS!" - Homestar Runner
David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 12th Feb 2004 21:43
Hmm, nothing really I can request

Looks amazing already!

"They misunderestimated us" - George Bush
"The box said 'Requires Windows 95 or better'. So I installed LINUX. "

Formerly David89.

Login to post a reply

Server time is: 2024-04-24 04:15:03
Your offset time is: 2024-04-24 04:15:03