cube distance

How would i stop using the cube as a reference to a position and still have the distance property calculate how far the other cube that i am moving is from that cube?
http://www.pasteall.org/blend/22231

I do not understand this.

To calculate a distance you need to answer following question:

A) From where to measure? (or what defines the starting point?)
B) To where to measure? (or what defines the end point?)
C) What to do with the result? ( or where to place the result to?)

Finally you should get rid of that silly main() thingy.
A) you call this def from module level which is surely not what you need. This easily leeds to unwanted side effects (like running the code twice).

B) main() is a placeholder used as startpoint in Python applications. A Python controller is no application. The usage of main() is confusing.

C) Give things real names. Write down what you want. Let the reader guess the purpose of a thing.
Example: measure.py / setDistanceToTarget()
In opposite to: gamelogic_simple.py / main()

Why can’t the computer just imagine the cube is still in the same scene and it not be in the same scene?Without scene overlay.And then still calculate it’s distance.Why do computers programs lack an imagination?

It has a very precice imagination. He thinks humans cant express their wishes very well.

So you want to measure the distance of objects of different scenes?

Yes without scene overlay.

Well forgive me that i was a little impatient.I am trying to assimilate the miles that the surface of a planet has.And i want to be able to come back to the same spot like a real planet.

Do you mean you want to create an orbiting motion?

No.I want a character that a person controls to be able to walk the miles of the circumference of the earth, using just two small areas of two scenes and be able come back to the same spot.

It’s hard for me to understand what you are describing. Why would you have to measure the distance between an object and another in another scene? Why would you need two scenes running at the same time?

Imagine the two scenes acting like a conveyer belt,that can go west, east,north and south.A person would feel that he had walk a great distance but he would not have.Maybe we should go about this a different way since you don’t understand.I will make a new thread.

Simply have a heightmap with dynamic displacement, and then the player will be back where he started when the image wraps around!

In general there are no distances between two scenes. It is like two universes or two different times.
Imagine: how far do I have to go to meat socrates?

As he does not live in your personal time, you will never met him regardless how far you go. So the distance is eternity and zero at the same time.

While this goes pretty phylosophical we ned to look at the problem from a different point of view.

I guess view is what will lead us to what you mean. The relation between the two scenes are the cameras. Both project their views to the same space: the screen space. So I guess (again) you mean the distance the object seems to have when looking throw both cameras at the same time.

This requires you to calculate the transformation from one scene space to the other (connected via screen space). So it might look like this one:

It does not use the cameras as reference to the other scene, but both cameras are synchronized. So they are “virtual” at the same place looking in the same direction. This allows to project the objects to other scenes (this ncludes the red/green cubes and the cameras. While the ground and walls exist in one scene only.

BTW. this technique enables you to create huge worlds including massive planets and galaxies at the same time. Unfortunately my system is not ready for delivery right now.

Back to your problem. I would like to see where you need this. Because my assumptions might be completly incorrect.

I wish for it to use a small space of both scenes and make it seem like you are going far distances when you are not.It essentially reuses the space and it adds objects in with add object.When a property gets within the range of a certain number. The objects will end.When a property gets away from the range of a certain number.You use empties to do this.To make this illusion seem as real as possible.Does what your making meet those requirements?

This is a LOD. The least detail level = not there.

But where do you need the distance?

It acts like tread mill when you go forward and move with the keyboard.You move to a certain point and it goes to the next scene.There are rectangular boxes around a certain part of the scene that the character is in.They are used to switch to the second scene and turn the character invisible and they are also used to trigger a script that pulls the player back to the opposite side of the box.The player has ray sensor facing forward on him that triggers the script that pulls him back while he is invisible.And also he has a ray sensor that points backwards that makes him become visible.When it detects the property.You can count how much he moves at a certain degree.You have it so the negative of each degree it subtracts from the property and the positive of each degree it adds.

I remember torakunsama created a game with exactly this method. I suggest to contact him.

I dont know if he is willing to give me a blend file that i can add my own enemies houses and other things to.And if he is willing to put that in resources.If he wont do that.I guess i will have to keep asking question until i figure it out.

I do not think he will give you a ready-to-use solution. But you can talk with him about how he solved this problems.

While you do that you will came up with an own one.

I can only give some general advice as I never implemented this in an own application. SO I do not know if I miss something.

There is no one by that name on this websight.Maybe he changed his name.I did a search and found no one.

Oups there wrong keys :o. silly me … corrected

Try this link: http://www.blenderartists.org/forum/member.php?32422-torakunsama