Collection Actuator Doesn't Have Python Documentation About His Variables UPBGE 3.0

When I search on upbge documentation, it doesn’t have the documentation of Collection Actuator.

The version 0.3.0 have Collection, but the python link is broken. Can someone tell me how do I acces all Collection actuator variables (I want to be able to change wathever collection to activate or deactivate via python)?

In python you can use print in conjunction with dir() or help()

Like

print(dir(bge.logic.getCurrentController().actuators['Collection']))

Well, Thanks! That’s very useful indeed, it could solve a lot of problems in the past and save me a lot of time!

But sadly, the only shown attributes for the Collection Actuator is:
‘executePriority’, ‘invalid’, ‘name’, ‘owner’

And for the comparsion to a Steering Actuator:
‘acceleration’, ‘behavior’, ‘distance’, ‘enableVisualization’, ‘executePriority’, ‘facingMode’, ‘invalid’, ‘lockZVelocity’, ‘name’, ‘navmesh’, ‘owner’, ‘path’, ‘pathUpdatePeriod’, ‘selfterminated’, ‘steeringVec’, ‘target’, ‘turnspeed’, ‘velocity’

I can’t acces the collection property. I wish I could change the collection trough python…

BPY code for the Collection actuator should work.

https://upbge.org/#/documentation/docs/latest/api/bpy.types.CollectionActuator.html#bpy.types.CollectionActuator

if this stuff is edited though - you have to create a copy of the object and then link to the scene / burn the original as the objects are converted on game engine startup

copy =  orignal.blenderObject.copy()
bpy.data.collections['Collection'].objects.link(copy)
own.scene.convertBlenderObject(copy)
orignal.endObject()

this should create a copy that has the changes applied

1 Like

Well, the way I found to be organized and clean on changing collections (activating new parts of the level and deactivating the old ones to optimize) is to create empty objects with a message listener, if they are activated it disables the collections. The bad part is that I need to make a collection actuator for every collection.

The thing is that I can’t even acces the variables to edit it during game, my goal was to make a collection change pratical and fast, but I find another workaround for this.