I'm trying to build a charge attack that would activate on the release of a button, however, it seems that there isn't a microscript that would allow me to use ammon on a button release, thus, I tried building a system of modifiers to work around that problem (by using the button NOT pressed microscript) but I hit another wall, such a set of modifiers would require me to use a modifier on the item, so the ammo doesn't keep getting used while holding the button, yet, it seems there is no such a thing as a modifier for the inventory item.
So I ask for help: @zep, is there a way to work around this issue or a possible update to help?
It's a bit tricky -- here's the simplest solution I could find:
You can use the 'AUTO' property in the inventory item for this. Instead of using the inventory item when a button is pressed, it is used on request. So if you create a USE_ITEM trigger with such an inventory item, it should be inside another modifier that is only true when you want to inventory item to be used.
Here I've used the PREV field in the activation controller for the 'charge' modifier in robot's root folder. This means that it will only activate when the trigger is true AND the 'pressed' modifier is active. The result is that when you release the button, 'charge' will activate and 'pressed' will deactivate in the same frame.
When AUTO is set on an inventory item, it is automatically used whenever a trigger asks if it is being used. So it's the same as if one of the button checkboxes is set (inside the inventory item definition), if the player constantly held down that button.
One gotcha which I need to improve via the designer interface: make sure the item is wielded! Use the WIELD ON COLLECT option.
[Please log in to post a comment]