What?

ok so… very odd bug,

if I copy the position of an object “center” and use it to move an object “component” It hovers where center is, if I attempt to hit it with a collider it works…

now, if I instead use the item “Rig” which is a rigid body bound to “center” the object moves there, but becomes “ghost” even though nothing is different except the value “Position”

:frowning:

So Rig=rigid body using 6dof to bind to “Center”

//Exact same code just using a differnet object to get offset that is a rigid body joint with a 6dof
import GameLogic as g
cont = g.getCurrentController()
own = cont.owner
scene = bge.logic.getCurrentScene()
lefty = scene.objects[‘Lefty’]
righty= scene.objects[‘Righty’]
center= scene.objects[‘Rig’]
b = center.worldPosition
d = center.worldOrientation

own.worldPosition = b
own.worldOrientation = d

//ok so this works fine

import GameLogic as g
cont = g.getCurrentController()
own = cont.owner
scene = bge.logic.getCurrentScene()
lefty = scene.objects[‘Lefty’]
righty= scene.objects[‘Righty’]
center= scene.objects[‘Center’]
b = center.worldPosition
d = center.worldOrientation

own.worldPosition = b
own.worldOrientation = d

Lol, it was a issue of a face not colliding because the object moved .025 out of the way…

I still recommend you watch some python lessons before getting serious. It’ll answer a lot of your questions before you have them. Also, you should keep updated on standard python API for the BGE.

The GameLogic module is old. It has been replaced with the sub-module logic from the module bge. I guess it doesn’t make a difference but just use one or the other (it’s just good programming practice), you’re using both right now for no reason.

This:


import GameLogic as g

Is the same as this:


from bge import logic
g = logic

So instead of


cont = g.getCurrentController()
#or
scene = bge.logic.getCurrentScene()

You can use,


cont = bge.logic.getCurrentController()
#or
scene = g.getCurrentController()

GameLogic = bge.logic

I have been learning how to apply stuff I already implemented in other code languages, I think one long python script is not the way to go, as it almost impossible to thread, instead logic nodes triggering small python modules for each piece, can run on X threads,

I am thinking and refining my practices as I go,
want to help code my game and teach me?
at the moment our project has me, and akira_b, and that is it, but it is moving forward, and it is not buggy :slight_smile:

also …is that any faster?

If there is a speed difference, then it’s probably unnoticeable d:

I wouldn’t worry about threading in python when working with the bge. There aren’t many times where you need to run two pieces of code at the exact same time in the same script.

Like I said before, there are tons of resources out there. Once again, I suggest looking at Goran’s python lessons.
Python 3 Playlist

My game is about two weeks from demo, and 6 months from finished, :slight_smile:

I have already tackled the hardest problems I faced, the animation, and lifting/aiming system, and the properties editor, and I plan on implementing a few other things, but the core of the game is done, with about 50 lines of python, total,

I plan on adding a inventory system, but this is about all that is left that will require more python…
I do understand what you mean, and I do not know everything about python, but as I find problems, and make solutions, I learn, and it sticks, if I read or watch tutorials, that is theory without application, if I find a problem I can’t solve, then I go digging…

I am a 3d animator, coder, engineer, carpenter, botanist, mechanic etc… it is hard for me to go for the big picture, better to grab pixels as I need them :slight_smile:

Imagine your physics teacher just gave you a sheet of kinematics and force problems asking you things like: Find the velocity of car A at x seconds, or find the distance it takes for plane A to stop, take into account air resistance and friction as the plane hits skids on the floor. Then he gives you a list of formulas.
How are you expected to solve these problems accurately without the theory and concepts behind the formulas given to you?

Before you apply your knowledge… You need the knowledge. Knowing the theory can save you many, many hours of frustration and dependence on people from the forums.

I think I see what Linkxgl’s saying, and he’s generally right. It’s best to learn what you need to know now, rather than go back and forth trying to solve individual problems with individual scripts in the middle of a project that you’re basically trying not to use Python on.

On the other hand, if you only need very simple scripts, then it may not be necessary to learn a lot of Python for this project, though it is an extremely good idea to work with Python.

Don’t be mistaken. The BGE is not multithreaded, and using many logic bricks triggering small scripts will not run faster than less logic bricks triggering large scripts. The BGE doesn’t process game logic like a bee hive (lots of small bits of execution) - it’s a queue (it processes all the scripts in the queue in a single game frame, one at a time). Currently, there is one thread for processing logic and passing render data to the GPU (if I’m correct). I believe you can thread logic with Python threading, but that requires knowledge of Python (of course), and doesn’t work well with BGE-specific data.

I believe that a certain moogle is tackling threading with logic right now…

Logic nodes triggering python seems best to me, from a What is going on here? stand point, it is just arranged…
more logically for me…
I am going to be making a full length game, using mostly systems I have already made, If there is some line that I cross where I will have to handle everything with python I will, but for now breaking everything into modules seems to make more sense with what is in the future for BGE and what is in other engines,

I want to learn, build, repeat…