Lamps and addObject()?

Dear blenderartists community,

for my current project I would love to create lightsources with a limited lifetime ingame.
I was using the addObject() command, but it behaved quite different than expected.

While I could add and position normal objects with addObject(), my lamps where all moved to the position of my last created lamp.

Does anyone have an idea how to solve this problem?
I have attached a sample blender file, illustrating the problem.

Thanks,
Savart

Attachments

lamp.blend (358 KB)

You must have added all light sources before you start the game engine.
Adding new light sources, while the game engine is running, is not possible.

Oh wow, didn’t expect that. Thank you for your quick reply.

I’ll try to circumvent this by adding lots of lamps, and simply moving them around :frowning:

@Savart
You could also try out Kupoman’s Cucumber branch. He has some code to attempt to fix this issue. I’m sure he would be happy to have testers. :wink:

What platform are you on?

Thanks for the suggestion, I’m currently using Win7 64bit.
While I’m not in dire need of duplicated lights anymore, I’ll gladly try the Cucumber branch out!

EDIT: working like a charm :). However, restarting a scene takes quite a bit longer than with 2.57.

It looks like there are already some Cucumber builds on graphicall. If you are getting some graphical issues with one of the graphicall builds, try changing the storage mode in the render panel (while in blender game mode) to either “Vertex Arrays” or “Immediate Mode”.