Repository navigation
fix(TutorialIsland): walk to and open rat pen gate before melee attack (1.3.17) - #644
Merged
Merged
Conversation
…k (1.3.17) The melee rat step only opened gate 9719 when the player already stood on the x=3111 gate strip, and otherwise gated the attack on Rs2Walker.canReach, which routes through the gate transport and tolerates a 2-tile endpoint offset. Rats were clicked from outside the closed pen (spam-clicking) or the step idled. Now the attack is gated on a strict collision reachability check; when the rat is not reachable the player walks to the gate and opens it. The ranged step attacks the rat over the fence without a reachability check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LjtEMzQHGuq4M1Mpqk9pPV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Discord bug report "Tutorial Island can't kill rats" (thread), with fresh reports today (1, 2) and earlier confirmations (1, 2).
At the melee giant rat step the script never goes through the rat pen gate. Instead it keeps clicking the rats, or the character stands idle near the ladder/stairs. It is intermittent, and 3 users have reported it.
Root cause
walkAndAttackRatonly opened gate 9719 when the player was already standing on the x==3111, y 9516-9519 strip, and nothing ever walked them there. Everywhere else it attacked only ifRs2Walker.canReach(rat)was true, and that check is too loose:shortestpath/transports.tsvlists the rat pen gates (9719/9720) as transports, so the path goes straight into the pen.canReach(WorldPoint)passes when the boxes around the path end and the target overlap, which gives about 2 tiles of slack.So "Attack" was sent from outside the closed gate. The player walked to the fence, stopped, and the click repeated every tick. When the check came back false, the method returned without doing anything, which is the idle symptom. The ranged step went through the same method.
Change
RatPenhelper: gate 9719, outside tile 3111,9518, inside tile 3110,9518.next(playerLoc, ratReachable)returnsATTACK,OPEN_GATE(when the player is within 1 tile of the outside tile on the same plane) orWALK_TO_GATE.walkAndAttackRatnow decides reachability withRs2Tile.isTileReachable(a strict collision-map search from the player). Then it either attacks, opens the gate and waits until the inside tile is reachable, or walks to the gate tile.attackRatAtRange(), which attacks the nearest giant rat with no reachability check, because ranged fires over the fence.Validation
RatPenTest(6 tests): attack when the rat is reachable, walk to the gate from the ladder or the instructor, open the gate on or next to the gate tiles, a null location, and a different plane.PluginManifestVersionTestpasses../gradlew build -PpluginList=TutorialIslandPluginsucceeds.Known gaps
transports.tsv) has not been checked in game.RatPenTestcovers only the decision function.🤖 Generated with Claude Code
https://claude.ai/code/session_01LjtEMzQHGuq4M1Mpqk9pPV