[Bf-committers] Python access to linked sensor/actuators/controllers in the logic window

Alex Fraser alex at phatcore.com
Sun Apr 24 03:37:54 CEST 2011


On Sat, Apr 23, 2011 at 9:13 PM, Trouble Maker <makers.f at gmail.com> wrote:
> Another problem i run in is that after adding a game property (
> game_property_new() ), there is no way to have a reference to the property
> just added. Right now i'm using context.active_object.game.properties[index]
> (where index starts = 0 and is increased of 1 when a new property is added),
> but this can work only if the object has no already existing property.

I think that with this collection (not all collections), the new
property is always the last - so you can access it with
object.game.properties[-1]. But you're right, it would be nice to have
a game.properties.new() function.

Cheers,
Alex


More information about the Bf-committers mailing list