So what I am trying to accomplish is an action that, when I walk up to some resource, I can hit a button which equips an item and starts draining from it - like a mining tool would. When the button is released, the mining stops. So far I have some stuff working but others are hair-pulling and I need some help.
I have an ability that can chain an equip and a use. Letting go of the button stops the entire thing. All good.
The ability uses an Energy attribute and if that gets to zero, it stops as expected.
I was leveraging Magic Item to sort of take care of some basics but I've noticed a couple of issues I'm struggling with
1) The Cast actions seem to be one-shot so it's not continually called to do what I want (I made a DrainResource cast action that takes health from target and adds an item to inventory)
2) I can't find the best way to cancel the action if I decide, for instance that the thing being drained is dead (Assuming I can get it to continually drain). in my tests if I kill the target and it's removed (It has a Health component on it) the action continues.
I had made a script on the Magic Item (For my mining tool) to try and test to see if I could cancel the action but I can't find the API to get there from an Item object. i.e. The current action running with that item so I can cancel it (somehow).
Have I gone about this the wrong way? Should I write my own Item from scratch in this case or is there a better choice? If my mining tool was a "shootable" would that be better and should it operate without "bullets" that need to be consumable but fire and when hitting the target, damage and then give the player a resource?. I'd still want some continual particle system that starts when the action starts and stops when it stops but should I just use the concept of "bullets/projectiles" to do the things I need?
Any help really appreciated.
Cheers
I have an ability that can chain an equip and a use. Letting go of the button stops the entire thing. All good.
The ability uses an Energy attribute and if that gets to zero, it stops as expected.
I was leveraging Magic Item to sort of take care of some basics but I've noticed a couple of issues I'm struggling with
1) The Cast actions seem to be one-shot so it's not continually called to do what I want (I made a DrainResource cast action that takes health from target and adds an item to inventory)
2) I can't find the best way to cancel the action if I decide, for instance that the thing being drained is dead (Assuming I can get it to continually drain). in my tests if I kill the target and it's removed (It has a Health component on it) the action continues.
I had made a script on the Magic Item (For my mining tool) to try and test to see if I could cancel the action but I can't find the API to get there from an Item object. i.e. The current action running with that item so I can cancel it (somehow).
Have I gone about this the wrong way? Should I write my own Item from scratch in this case or is there a better choice? If my mining tool was a "shootable" would that be better and should it operate without "bullets" that need to be consumable but fire and when hitting the target, damage and then give the player a resource?. I'd still want some continual particle system that starts when the action starts and stops when it stops but should I just use the concept of "bullets/projectiles" to do the things I need?
Any help really appreciated.
Cheers
Last edited: