Abendigo icon indicating copy to clipboard operation
Abendigo copied to clipboard

BoneTriggerPlugin multiple targets

Open JonEhh42 opened this issue 8 years ago • 3 comments

Is there a way to get the BoneTriggerPlugin to support multiple targets? Example -

val TARGET_BONE = Bones.HEAD

val TARGET_BONE = arrayOf(Bones.HEAD, Bones.NECK, Bones.UPPER_CHEST, Bones.LOWER_CHEST)

JonEhh42 avatar Oct 15 '16 04:10 JonEhh42

val TARGET_BONES = arrayOf(Bones.HEAD, Bones.NECK, Bones.UPPER_CHEST, Bones.LOWER_CHEST)

And surround lines 34-45 with for (targetBone in TARGET_BONES) { and end with }. Then replace val ePos = e.bonePosition(TARGET_BONE.id) with val ePos = e.bonePosition(targetBone.id)

Overall it should end up looking like this:

        for (targetBone in TARGET_BONES) {
            val ePos = e.bonePosition(targetBone.id)
            val distance = distance(myPosition, ePos)

            calculateAngle(Me(), myPosition, ePos, aim.reset())
            normalizeAngle(aim)

            val pitchDiff = abs(angle.x - aim.x)
            val yawDiff = abs(angle.y - aim.y)
            val diff = sin(toRadians(pitchDiff.toDouble())) + sin(toRadians(yawDiff.toDouble()))
            val delta = abs(diff * distance)

            if (delta <= FOV && delta < closestDelta) closestDelta = delta.toInt()
        }

Jire avatar Oct 15 '16 22:10 Jire

It still does not shoot feet or legs. Please advise.

http://pastebin.com/raw/xwpyQmCy

JonEhh42 avatar Oct 16 '16 17:10 JonEhh42

@jonfatino Its because they're not included in the array of bones use val TARGET_BONES = arrayOf(Bones.HEAD, Bones.NECK, Bones.UPPER_CHEST, Bones.LOWER_CHEST, Bones.LEGS, Bones.FEET)

bradylangdale avatar Oct 22 '16 00:10 bradylangdale