I have 100 object with Near sensor, And controller and Edit object(property Edit object is End object) actuator. When i run game, some objects disappear some remain. I need to have objects that disappeared learn his Name(Object Name) and store them, for example a text file. How to do that?
example
I have 100 object with Near sensor, And controller and Edit object(property Edit object is End object) actuator. When i run game,
some objects disappear some remain. I need to have objects that disappeared learn his Name(Object Name) and and store them, for example a text file. How to do that?
simplest way: before ending the object write it’s name to the console.
def printName(controller):
print(controller.owner.name)
BTW. 100 near sensors eat a lot of processing time.
Thank you for your help. Here’s how I use your tip
<b>import bpy
import bge
import sys
def main() :
controller = bge.logic.getCurrentController()
obj = controller.owner
#print("Controller owner")
#print(obj.name)
f = open('D:\\list_cell.txt', 'a')
f.write(obj.name + '
')
f.close()
main()</b>
I have a question, is it possible to create 10,000 or more objects? My limit of 9000 objects, if I create more program hangs. I’ll be glad if someone tells about the limits of this process.
Yes, you can create as much as you like … nut it eats processing power and memory. So there are technical limits. These limits vary from system to system.
The technical goal must be to have a s less a possible objects at the same time (belongs to all game engines). The entertaining goal is to have as much objects as possible.
So your goal is to find a balance between this two goals. ;).