[Feature Request] Action limit for Attack Entity
MuteTiefling opened this issue · 9 comments
Was just making a mob farm that has a single drone that picks up tools, does the murdering, then goes around capturing any drops/xp before storing everything and going to standby. The only issue is if the mobs never stop, it never stops killing. Which could eventually lead to a weapon breaking or way too many items.
Could be nice if there was an action limit on the attack piece, so it only attacks X times before continuing on.
Damn, there goes that theory. In principle, the "entity attack" action should be considered finished as soon as the drone's current target is dead, meaning the drone should move to the next widget in the program. If that's not happening, I'm going to need to do some debugging...
(I asked about melee vs. minigun since I think I spotted a bug in the minigun logic, but that doesn't apply to melee attacks, which pretty much use the vanilla attack logic)
Ah, yeah for melee attacks at least it just kills until everything in the attached area widget is dead. Then moves on.
Been a while since I used the mini gun, tbh
I was about to add some code for this, but I realised it might be simpler than that. In your case, is the drone using a minigun or melee weapon?
Here's a ready built program if you need: https://pastebin.com/wfEDS8P5
It's OK, I have a test setup now. Right now, it will continue to attack targets as long as there are valid targets available, so my earlier theory was nonsense :) But I think it should be easy enough to have the drone keep a tally of the number of attacks initiated since the widget started executing, and bail if it exceeds a configurable limit...
Works like a charm. Set it to 1 and the little guy goes in, swipes once, gets anything that might have dropped, and continues. Perfect! Thanks :D