Use python to mess with objects?

I do not know where to put this, but here seems as good a place as any.

  1. I want to get all the objects that have a certian property. i.e. I have 5 objects with the property food and 5 with the property animal and I want to get all the objects with the property animal.

  2. I want to get all objects whose properties equal a certian value. i.e. I have 5 objects with the property animal. Three with the value goat and 2 with the value bird and I want to get all the objects with the property animal, value : goat.

  3. I want to get the individual delta locations of an object (X, Y, and Z) and add a random amount between 0.0 and 5.0 to them then change the delta location values to the new values.

  4. I want to be able to change the delta position of an object to the in-game pos so that if I need to reset scene or change scene the object positions will not be reset.

Thank you for your responses

:ba:

    1. Check this out:
      http://www.blender.org/documentation/pydoc_gameengine/PyDoc-Gameengine-2.34/KX_Scene.KX_Scene-class.html
      It includes an example to retrieve all objects of a scene. There shouldn’t be a problem to find the objects you are looking for.
  1. What are delta locations? If you mean you want to change the location of the object there are multiple options. Here are some of them:

  1. You need to save the positions to a file and read it later. Search for a save/load script in this forum.

I hope it helps