HOW TO - Stop action IF...

Hi dear members of the forum. I’m making a game like Bomberman, and I’m having problems with the explotion mechanics. The explosions are like “PLUS sign (+)”, and stop if touch a hard block, or level wall limits (bomberman pic).

I made for testing purposes an explosion that expands each side individually like simple animation (pic 1,2) but I don’t know how to STOP when hit or touch something, cause it goes through (pic3). I would like after the explosion starts, to stop then touch, for example, the red block or red material.

I did with the logic bricks (pic 4) but doesn’t work (I forgot screnshoot, when fire touch red block, object ends). What can I do? Any suggestion (without python)??? Thanks.

Attachments




Uhm, just an idea.

You are using an animation for the explosion right?

Then i would add an property to the bricks/walls, when the explosion object hits the wall with the poroperty, set property True on the explosion object. With this you can simply add another action actuator and tell him to stop the action when the property is True. And you can then combine it with a counter so that the explosion object gets removed after a few seconds.

There are probally better solutions but this game up my mind.

Hi cotax, I got your idea, but how can I stop an animation already playing with an action actuator? or how to configure the actuator? (sure, put the object to be removed after few secs is good). Thanks


You can’t stop an action in play mode.

But you can do that with loop stop mode by deactivating the actuator.

In effect Monster, Action must be in Loop Stop (my bad).

But I made this example. If press P “play”, you can notice the 3 Fires are the same, only difference is the Origin postion. So why only Fire C stops when touchs the Block, if in all cases are touching? I would need for easy work the Fire A working… But no idea why goes through the Block.

Aparently only detect as touching point the origin, and not the rest of the mesh. In the properties on debug, you can see all Fires starts at 0, and changes to 1 if “touch the block” but Fire A never touch (supposedly) and Fire B only touch but after going through.

What can I do, or any idea with Logic Bricks to make a fire like Bomberman mechanics? (explode in PLUS form and stop if touch some objects, like blocks) Thanks to all.

(=^ェ^=)

Attachments

test.blend (499 KB)

Guys, any idea or suggestion please?

With what Monster said, you can deactivate a loop_stop action. You can do this using python:
Something like this:


cont = logic.getCurrentController()
own = cont.owner
if cont.actuators["collision"].positive:
    cont.deactivate("Action")
else:
    cont.activate("Action")

I find that it is easier to use Python once animation logic starts to get complex.


#Play action
armature.playAction("Action Name", start_frame, end_frame, layer=(0,1,2...), play_mode=(0,1,2))

#Stop action
armature.stopAction(layer_of_action)


You can combine these two things with if/then statements to get your animations working correctly. There are also more optional switches for playAction. Check the API for those. (blendin, speed)

Ok guys, thanks all for your help. It’s done. SOLVED