The Binding of Isaac: Rebirth

The Binding of Isaac: Rebirth

Inseparable Jacob & Esau Plus
This topic has been locked
Stlkngne 18 Oct, 2022 @ 9:31pm
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.
< >
Showing 1-1 of 1 comments
Ixion  [developer] 19 Oct, 2022 @ 1:11am 
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!
< >
Showing 1-1 of 1 comments
Per page: 1530 50