PneumaticCraft: Repressurized

PneumaticCraft: Repressurized

43M Downloads

[Feature Request] Action limit for Attack Entity

MuteTiefling opened this issue · 9 comments

commented

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.

commented

Melee weapon

commented

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)

commented

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

commented

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?

commented

Here's a ready built program if you need: https://pastebin.com/wfEDS8P5

commented

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...

commented

Can you give build 212 a go and let me know how it works for you?

commented

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

commented

Added in 2.13.4 release