Consumable power up Rule problem

Ok so I have a game thats using a power up system, to where once you pick it up, it stores it away and you can use it whenever you want.
My issue is that when I pick up the power up the first time, then use it the first time, it works as intended. However when I pick up the power up the second time, it just uses it on the spot.
The process seems right, and only messes up when I set the condition to "on release"
It goes like:
- grab power up by touching it.
-changes global power up attribute to 1 which is to let the power up icon actor know it know it has a certain power when that's set.
-The power up actor icon has a rule set that when global powerup attribute's value is 1 allows you to touch the powerup icon actor and use the power up as intended.
-For in my case its a bomb, and when you touch release the power up icon actor here it allows you to touch a spot you want it to blast. When you touch the icon it changes another global attribute for another global actor, who handles power up actions, to enable you to set the spot to aim, and when you touch anywhere outside it creates the blast.
-After the execution it sets the powerup attribute back to 0.
-works correctly the first time.
-now the error happens when i grab another power up, it will skip all the way to the part where the bomb executes the blast on the spot i press. The global attribute goes to 1 only for a split second when I tried debugging it, and back to 0 and executes the whole power up action by grabbing the power up instead of touching the power up icon. Its as if its skipping the part where it needs to check for the touch release on the power up icon actor.
What seems to happen, is it skips past the activation process. Everything I tried, seems to revolve around the fact it skips straight to activating whenever the rule check is set to on release. When its on press, it works correctly, except that the way i have the blast is to check by clicking outside once the bomb powerup is activated so the press activates it at the same time, and i don't want that.
My main problem I'm having is that as soon as i grab a power up, after using the first one, it will run the rule i set to only activate on release even though i didn't release.
I tried a work around where the power up will always be there to use, never turning the global power up attribute to 0, and that works perfect. Where I touch the power up icon, enabling me to set the target, touch where i want the blast, blast occurs, and things run like normal, then i click the power up icon again to activate it, and set target again like normal, etc.
But I want a way for it to be consumable. Is it a bug that it skips checking the on release part?
The way i have this checker actor set up is, the rule checks for the powerup attribute if its set to 1, when thats true, then it checks to see if I released the touch and then activates. The weird problem is that it works right the first time, but after that, as soon as I touch the power up I grab, it activates right on that spot, no release.
If someone can give me an alternative way to do a consumable power up system with pick up power ups that would be greatly appreciated. This thing has got me stumped.
My issue is that when I pick up the power up the first time, then use it the first time, it works as intended. However when I pick up the power up the second time, it just uses it on the spot.
The process seems right, and only messes up when I set the condition to "on release"
It goes like:
- grab power up by touching it.
-changes global power up attribute to 1 which is to let the power up icon actor know it know it has a certain power when that's set.
-The power up actor icon has a rule set that when global powerup attribute's value is 1 allows you to touch the powerup icon actor and use the power up as intended.
-For in my case its a bomb, and when you touch release the power up icon actor here it allows you to touch a spot you want it to blast. When you touch the icon it changes another global attribute for another global actor, who handles power up actions, to enable you to set the spot to aim, and when you touch anywhere outside it creates the blast.
-After the execution it sets the powerup attribute back to 0.
-works correctly the first time.
-now the error happens when i grab another power up, it will skip all the way to the part where the bomb executes the blast on the spot i press. The global attribute goes to 1 only for a split second when I tried debugging it, and back to 0 and executes the whole power up action by grabbing the power up instead of touching the power up icon. Its as if its skipping the part where it needs to check for the touch release on the power up icon actor.
What seems to happen, is it skips past the activation process. Everything I tried, seems to revolve around the fact it skips straight to activating whenever the rule check is set to on release. When its on press, it works correctly, except that the way i have the blast is to check by clicking outside once the bomb powerup is activated so the press activates it at the same time, and i don't want that.
My main problem I'm having is that as soon as i grab a power up, after using the first one, it will run the rule i set to only activate on release even though i didn't release.
I tried a work around where the power up will always be there to use, never turning the global power up attribute to 0, and that works perfect. Where I touch the power up icon, enabling me to set the target, touch where i want the blast, blast occurs, and things run like normal, then i click the power up icon again to activate it, and set target again like normal, etc.
But I want a way for it to be consumable. Is it a bug that it skips checking the on release part?
The way i have this checker actor set up is, the rule checks for the powerup attribute if its set to 1, when thats true, then it checks to see if I released the touch and then activates. The weird problem is that it works right the first time, but after that, as soon as I touch the power up I grab, it activates right on that spot, no release.
If someone can give me an alternative way to do a consumable power up system with pick up power ups that would be greatly appreciated. This thing has got me stumped.
Comments
Can you post an image of your rules with the "touch outside" and "touch released" so we can see whats going on and maybe find the problem ?
Also , do you use spawn for the bomb?
Roy.
-http://imageshack.us/f/854/screenshotaqj.png/
and heres one for the powerup action spawner (the thing that operates the powerups action like the bomb blast)
-http://imageshack.us/f/692/screenshot2bxn.png/
The power up itself all it has is, on release change attribute game.powerup icon1 = 1, then destroy actor.
Also i don't know the nature of your game , but if there is only 1 finger on the screen when you do this , and you want to check when the player lift his finger up , you can also use "when touch count = 0 " as a trigger ,
Let me know if this work for you and we will continue from there .
Roy.