All Purpose Blender GE Library (GEL)

The All Purpose Blender GE Library is a script I made that simplifies the game programmers life. It is very simple to implement and reduces lines and lines of code into a few function calls. Remember to put the script in C:/Program Files/Blender/.blender/scripts/bpymodules

Here is a demo .blend file
Here is the script
Here is a WIP of Tanks 3D (approx. 1 meg)
Here is a WIP of Krystal (approx. 4 megs) now with 11 levels

UPDATE
6-16-07: added water()
7-02-07: updated demo, script, Tanks
7-16-07: added mouse functions (mouseMove(),mouseLook(),etc) and more; Tanks and Krystal update
Please ask if you have any questions!

==========================================
Tanks Controls:
=Arrows control bottom part of tank
=ASWD control top part
=FGTH make top part turn slower than ASWD
=1,2 switch cameras
=Numpad 1,2 switch weapons
= +,- increase/decrease firing power
=Space fires

+++++++++++++++++++++++++++++++++++++++++
Krystal controls:
+mouse moves blue circle cursor thing
+left MB sends repulse beam
+right MB sends attract beam
+space stretches blue circle cursor thing (to act as platform for falling blocks)
GOAL: to get the green glowing icosphere (the krystal) into the blue basket. Cursor does have collision detection. Green blocks are not active; other colored blocks are activated by colored buttons, which are activated by touching it with a grey block. If a grey block touches the green circle below the pieces, the scene restarts. The blocks are destroyed if they touch the basket or the ground below the green circle, which is (usually) a good thing. Ask if you need any hints or help.

But it doesnt work? The arms are still stuck below the plane, with hands sitting on top?

I am new to blender and python, so I am still trying to understand the script and how to use it.

The little scripts per object are function calls to the bigger script stored in .scripts for blender, correct?

Cool, now to understand it. Like the portal, the springy thing, etc.

yeah it killed the framerate and didn’t work ;-( not sure why…? sounds cool tho

Probably because they are all used in one scene. I didnt disect it yet though. Smile. No time right now.

The little scripts per object are function calls to the bigger script stored in .scripts for blender, correct?

The bigger script (APBL.py) is stored in C:\ … \ .blender\scripts\bpymodules. Sorry for that confusion.
The only reason the framerate should be down is because there’s so many things on one scene.
If it’s still not working, check the module (the DOS window that opens when you start blender), and tell me if it’s spitting out an error. Like it might say ‘NameError in APBL.py on line 96: blah…’

But it doesnt work? The arms are still stuck below the plane, with hands sitting on top?

Did you turn the property collBuff on the ground plane to True?

EDIT: My mistake:

If it’s still not working, check the module (the DOS window that opens when you start blender)…

it’s not called the module its the console. My bad.

I’m sure that someone will find this very usefull.

Keep up the good work.

Did you turn the property collBuff on the ground plane to True?

Sorry, I just ran it the way it came, will do that.

And as Social said, good job. Dont stop now. Make lots of functions for us! Smile.

yeah now i just need to think of more, but now that schools out it’ll be a lot easier. Some of them i created specifically for the script but most of them i had already written long before.
If anyone has any ideas feel free to present them!

PS i don’t have any plans of making them for stuff other than the GE (animating, modeling, texturing, etc), because i’m not that good at animating or that stuff any way. Maybe once i start getting better in those areas i will but don’t count on it…

Social: Did you download the demo? or just look at the script? I just want to know what effort exactly i’m being credited for…

Looking at your script, it is really good. But I also got a frame rate of 0.3 fps.

I looked at the script - I assume that the demo simply implements the same functions. Good effort generally.

That said, there is some stuff in there that I just find downright silly. The OnOff() for example. Defining a new function here just seems unnecessary to me.

I mean if you have a situation where you really have to activate/deactivate actuators more then a few times, just set an assignment:
“ActiveAct = GameLogic.addActiveActuator” then just call via “ActiveAct(name, state)”.

I don’t know, I guess it’s a matter of personal preference and style, but to me functions are something that should be reserved for summing up tasks of somewhat higher complexity.

i see what your saying. I guess i’ll change that, but don’t expect a new download anytime soon now that schools out. My dad’s really picky about what goes on in his computer, so yeah…

sorry Social, im kinda using my age as an excuse, but it’s not like i was using it as an argument to get someone to be nice to me or to grab attention.

Looking at your script, it is really good. But I also got a frame rate of 0.3 fps.

C-106: Did you put the script in the bpymodules dir? or did you run as is like itirx did?

UPDATE*****
added water()
see first post

The script seems to no longer be there. :frowning:

Well, the script must be on the demofile, because I tried the demo without the library and it worked.

Or maybe I’m just imagining…

But, yea, the demo tears down the framerate.

the script’s definitely gone, and not in the demo file. This sounds interesting though, I’ll check it out once the script’s back up.

Oh, looks like he added in a bit too much text to the end of the url. Here is the real link for the script http://www.savefile.com/files/814998

Anyway, pretty intersting, I noticed the frame rate increased dramatically once I got rid of the ragdoll. Everything seemed to work just great!
Thanks for this!

thanks for noticing that facemania i changed it on the first post.
Yes the ragdoll does take a chunk out of the f/r.

I will change the demo so the ragdoll is in its own seperate scene, as well as add water and make a few tweaks so its easier to understand.

PS Thank you all for the encouragement!! i really hope this script can help you.

Big update! i added a bunch of new functions, fixed a lot of bugs, all but completely overhauled water(), and even included a WIP-yet-still-functional game!

-Demo

-Script

-Tanks 3D(WIP)

Tanks Controls:
=WASD-move/rotate tank
=Arrows-rotate barrel
=TFGH-rotate barrel slowly
=1,2-TankCam/BarrelCam respectively
=Pad1,Pad2-Select weapon (morter,missile)
=Space-Fire
=M,N-map on/off respectively

Hello

Great! Nice functions!
Teleport its nice and works perfectly!
Explosion didn’t work
( File “/home/deb/3D/blender/.blender/scripts/bpymodules/APBL.py”, line 176, in explode
if own.getPhysicsId() != 0 and own not in ignore:
TypeError: iterable argument required
Gravity neither
File “/home/deb/3D/blender/.blender/scripts/bpymodules/APBL.py”, line 91, in gravitation
mass1=obj.Mass
AttributeError: Mass

Water it’s funny, floating action is nice, but the diving…??
String works well
Bye and thank you for your effort

Ah the ignore thing i added becuase i needed the tank in Tanks had to be excluded from the explosion…will fix…
and gravity is also an easy fix. Sorry for the bugs