Regarding Collision Handler Event Sequences [SOLVED]

Sorry for the weird topic naming, I’m really not sure what to call this. Its this section of the Manual:

For each kind of event, the CollisionHandlerEvent will construct an event name out of the names of the from and into objects that were involved in the collision. The exact event name is controlled by a pattern string that you specify. For instance:

handler.addInPattern('%fn-into-%in')
handler.addAgainPattern('%fn-again-%in')
handler.addOutPattern('%fn-out-%in')

In the pattern string, the following sequences have special meaning: %fn the name of the “from” object’s node
%in the name of the “into” object’s node
%fs ‘t’ if “from” is declared to be tangible, ‘i’ if intangible
%is ‘t’ if “into” is declared be tangible, ‘i’ if intangible
%ig ‘c’ if the collision is into a CollisionNode, ‘g’ if it is an ordinary visible GeomNode
%(tag)fh generate event only if “from” node has the indicated tag
%(tag)fx generate event only if “from” node does not have the indicated tag
%(tag)ih generate event only if “into” node has the indicated tag
%(tag)ix generate event only if “into” node does not have the indicated tag
%(tag)ft the indicated tag value of the “from” node.
%(tag)it the indicated tag value of the “into” node.

The thing is, I’m not sure how to implement the patterns with the tags. I know that the regular way is:

        ## Checks when the objects goes into another object...
        self.collHandEvent.addInPattern('into-%in')
        ## And when it goes out of an object
        self.collHandEvent.addOutPattern('outof-%in')

So how do I put it when I want to do a check on tags?

Thanks.

Like this:

thing.collisionNode.setTag ('CollisionCategory', 'enemy')
thing.EventHandler.addInPattern ('%(CollisionCategory)ft-into-%(CollisionCategory)it')
accept ('enemy-into-ground', thing.groundCollision)

Ahh… Thanks!

Saves me a lot of time and management for collisions, planning to use this to differentiate between ground collisions and normal collisions.