The Binding of Isaac: Rebirth

The Binding of Isaac: Rebirth

Inseparable Jacob & Esau Plus
此主题已被锁定
Stlkngne 2022 年 10 月 18 日 下午 9:31
3 player tether behavior
In the code, I see this loop:
for i, character in ipairs(characters) do for y, characterEntity in ipairs(character.characterEntities) do if (not (character.characterEntities[y - 1] == nil)) then InseparableJEPlus:handlePhysics(character.characterEntities[y - 1], characterEntity, i - 1) end end end
which calls this:
function InseparableJEPlus:handlePhysics(mainPlayer, subPlayer, controllerIndex)

If you have 3 characters assigned to your controller (Isaac w/ 2 strawmen or Jacob/Esau/Strawman) then that loop appears to compare the 2 subPlayers together. If they're close enough to each other then all 3 characters are forced back together. Since you can only move the mainPlayer independently, it makes more sense to compare each subPlayer against the mainPlayer, right?

As a test, I changed the loop to:
for i, character in ipairs(characters) do for y, characterEntity in ipairs(character.characterEntities) do if (not (character.characterEntities[y - 1] == nil)) then InseparableJEPlus:handlePhysics(character.characterEntities[1], characterEntity, i - 1) end end end

I don't know if this is the best fix, but the behavior here felt better to me.
< >
正在显示第 1 - 1 条,共 1 条留言
cybre warrior  [开发者] 2022 年 10 月 19 日 上午 1:11 
Hey, thanks for going the extra mile and checking the code, as well as writing this post. I appreciate the extra effort you've put in helping with fixing this issue.

I just realized what you meant in your bug description, the mod isn't supposed to teleport the 2 Keepers back to Isaac as soon as the drop key is released. I wrote this code so that the additional characters would form a line when stuck, but I guess I never checked if they could still be controlled separately.

Your solution works properly, and it's true that the first character in characterEntities will always be the player, so it makes sense to only have them be the mainPlayer when calling handlePhysics. I've implemented these changes and credited you in the change notes. Feel free to let me know if you find any other issues, and thanks again!
< >
正在显示第 1 - 1 条,共 1 条留言
每页显示数: 1530 50