Online Virtual World

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Posts: 3
Joined: Thu Jan 01, 1970 1:00 am

Online Virtual World

Postby Gabriel » Fri Jan 27, 2006 1:26 am

Hi, I am curently working on a project that consists of a massive online multyplayer game using python for everything from networking to building the maps using map data files.
This project is going great sofar, but it has lead me to want to create a second project, an online world that could be used and edited by many users using only python.....
If anyone knows how I could implement a python prompt into a blender game, and get this to work with the game in real time, any help or sugestions would be greatly apreciated.I know i could manualy make a parser for input but this would be redundant and pointlessly timeconsuming,

I am a student and in no way a pro..... but I can learn, so if anyone has links or info, plz give it to me :P

thx in advance,


Posts: 250
Joined: Wed Mar 17, 2004 5:20 pm

Postby an-toni » Fri Jan 27, 2006 1:47 pm

soya has a GUI library which includes the Python console as a widget, so you can just run it as a cool semitransparent opengl thing on top of the game.

.. i just tried the interactive interpreter there last week, dont remember the exact command to start it now tho .. perhaps it is in tofu demos.

it is really easy to have a python interpreter anywhere, just instanciate PythonInterpreter() or whatever it is called from the standard python library. in Blender one window to it is in the Scripts/System.


Posts: 3
Joined: Thu Jan 01, 1970 1:00 am

Postby Gabriel » Mon Jan 30, 2006 1:30 am

thx toni, i'm looking into it right now
it seems rele interesting, but do you know if I can use it with blender as oposed to exporting blender scenes for it?
and also does anyone know how to send information from scene to scene? I want to use a download scene and a login scene (its simpler then using just 1 scene) but I don't know how to keep the information between the scenes anyone have an idea?
Edit: I got it fixed now, everything is run from python at the begining of the game to it dosnt create the world untill after it is loged in so the login and main scenes are now merged :D
Very Happy


Posts: 3
Joined: Thu Jan 01, 1970 1:00 am

Postby Gabriel » Mon Jan 30, 2006 8:49 pm

I need more help :)
I have a litle problem with runing a script only once in my update maps and data scene....
I have an empty with the property "ready" set to 0
I am using a property sensor, it is set to look for the ready property then run my scipt, at the begining of the script I change the "ready" to 1 to stop a second execution of the script, it updates any files that needs to be updated then at the end of the script it changes "ready" to 2 to triger another property sensor to change scenes, sofar, everytime i have tried it, the least amount of trigers it gave me was two. To conpensate for this I used "if obj.ready == 0:" to run the rest of my script
although this works, it uses more memory when I execute large scripts
Does anyone know any better ways to get a script to start at the begining of a scene only once?

takes me 2h to make a very simple character for a game....... takes God 6 days to create the universe.......

Return to “Python”

Who is online

Users browsing this forum: Yahoo [Bot] and 0 guests