Problem with importing GameLogic module ... (i'm a newbie)

Hello, :smiley:
(First of all sorry for my english, but i’m from Belgium )
I just started learning how to work with Python in Blender.
I’m following tutorials about it they say i have to import a GameLogic module, but if i want to test my work, i always get an error [!] : No module named GameLogic . i dont know wath i have to do …

( if you wanne send me a mail send to : [email protected] )

Thx !!! :stuck_out_tongue:

PJ

Hi pieter

There is a little exception with that module
it can only be imported if your script is launched during the game engine is active
for inst if you create an always sensor, link it to an python scripts, the gamelogic will be available at that time

It sucks because I think (at least) some of the functions of that module should be available. anyways. been through that, know what it is,
you wanna talk about it ?
lol just kidding

hope this helps

Happy New Year

Thx for helping me ,
but i still wont work :-? . I’ve checked the console (the dos window that opens with blender. and i found new information … if i start blender i get the message :"" ‘import site’ failed use -v for traceback , noinstalled python found , only build-in modules are available. “”

I have installed python ( i’v downloaded it from the site and installed it and the ‘import site’ thing i dont understand.

Do you know a soloution ???

Thx

PJ

though I was writing in english?
why the f@# you want it to work
I just told you it cannot work as the game engine is not active
you cannot imprt gamelogic and launch a script manualy.it must be linked
there are thousands of tuts and doc about that
download blender documentation/reference

do not worry about that console thing
that ‘import site failed’ was there since i downloaded blender the 1st time, years ago

i’ve add an always sensor and connected it to a python controller ( and i filled in the name of my text file ) and it still wont work … i think i’ve insalled python wrong or some things like that … or maybe its somthing else ???

Somone know a soloution ???,

PJ

try this:
http://membres.lycos.fr/rompelstilchen/GameLogic.blend

Nope … doesnt work. When i press alt-P iget an error : the name ‘GameLogic’ is not defined. Maybe i’ve installed python wrong ? there are some sites who tells somthing about that but i dont understand it

PJ

Hi, I am ssorry,
maybe I do explain wrong ??

Please re-read the whole thread and you will understand that IT CANNOT WORK WITH ALT-P !!!

got it ? I hope, can comeone explain him ?
I hope you understand
the GAME LOGIC module is only available when you pres P in the 3DVIEW !!!

regards

Ok, lets stay calm and solve both problems:

First:
Make sure you installed Python 2.3.3 (or whatever version in the 2.3 series), NOT Python 2.4. Blender expects Python 2.3.X, it will not work with Python 2.4.

Second:
You can only import the gamelogic module when the game engine is running. That means it will NEVER work if you start a script (Alt-P or otherwise) when Blender is running in “edition mode” . You have to link your script to a gameblender sensor to trigger it after the game engine is start (Pkey or Start Game in the Game menu).

Martin

thx

I also checked the file I provided you and it is working
wave your mouse over the 3dview
press p
and go check the output of the script

Sincerely yours, with no jokes and no vulgarity of any sort…just serious, always…keep serious, no laugh, no smile , just serious

Though his attitude sucks he’s info is correct. In the gameengine the script is called (accessed) as a scriptlink by the logic, not by Alt-P. Look in the Controlers menu and you’ll see an option for Python.

%<

Hi m8
tell me about my attitude ??
do you like to be agressed as you try to be friendly ?
me neither
have a nice day
Merry xmas
Happy new year

I already did, if you’d read your private messages…

You don’t want me or any other admin to have to talk to you about your attitude again.

Agressed? As far as I’m concerned, the only one being agressive here is you.
This

though I was writing in english?
why the f@# you want it to work

is not acceptable here.

If you can’t post without that sort of comment, then just don’t.

Martin

THX teeth !!! you are the best !!! it works !!! i just installed python 2.4 that was the problem !!! THX !!!

Also than u to all the rest who helped me !!!
Your all angels !!!

THX THX THX !!!

PJ

strange that I created the blend file at work wit no python install at all and it was working :slight_smile:
anyway, I’ll go for a smoke now
I am glad it helped you and sorry for the rest Teeth
Happy new year anyway