Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OoT] Fixed door upgrade #287

Merged
merged 6 commits into from
Jan 27, 2024
Merged

[OoT] Fixed door upgrade #287

merged 6 commits into from
Jan 27, 2024

Conversation

Yanis002
Copy link
Contributor

@Yanis002 Yanis002 commented Jan 9, 2024

It was lacking a simple condition (and an import somehow)

@Yanis002 Yanis002 added the oot Has to do with the Ocarina of Time 64 side label Jan 9, 2024
@Yanis002 Yanis002 added the bug Something isn't working label Jan 10, 2024
Copy link
Contributor

@Dragorn421 Dragorn421 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔

Comment on lines 322 to 325
for obj in bpy.data.objects:
if obj.type == "EMPTY" and obj.ootEmptyType == "Room" and actorObj in obj.children_recursive:
transActorProp.fromRoom = obj
break
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't this break existing blends where the fromRoom isn't the room the empty is parented to?
I have such blends

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be fixed now

fast64_internal/oot/oot_upgrade.py Outdated Show resolved Hide resolved
fast64_internal/oot/oot_upgrade.py Outdated Show resolved Hide resolved
Comment on lines 324 to 327
if "dontTransition" in transActorProp:
transActorProp.isRoomTransition = transActorProp["dontTransition"] == False
del transActorProp["dontTransition"]
elif transActorProp.fromRoom is not None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is the second block under an else now? (elif)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump

Copy link
Contributor Author

@Yanis002 Yanis002 Jan 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this case is most likely impossible but I thought the for loop may not find an object to set to transActorProp.fromRoom, so if this is still None on the block you highlighted it will raise an error (I think I should just assert this idk)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean if "dontTransition" in transActorProp: is likely to pass if upgrading a blend
then that means transActorProp.toRoom won't be set based on upgrading from transActorProp["roomIndex"]

Copy link
Contributor

@Dragorn421 Dragorn421 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw which previous PR is this a fix for

@Yanis002
Copy link
Contributor Author

btw which previous PR is this a fix for

PR #243

@Dragorn421
Copy link
Contributor

test blend made using fast64 9637bc4 (before #243): test_door_props.zip

There are three rooms and 5 doors. "Door Actor XY" means "from room X to room Y". the ones with X==Y have "dontTransition" set.

image

Exporting with 9637bc4 (before #243)

c TransitionActorEntry array:

TransitionActorEntry test_door_props_scene_header00_transitionActors[] = {
    // Wooden Door
    {
        /* Room & Cam Index (Front, Back) */ { 255, 0x00, 1, 0x00 },
        /* Actor ID                       */ ACTOR_EN_DOOR,
        /* Position                       */ { 130, -120, -406 },
        /* Rotation Y                     */ DEG_TO_BINANG(0.000),
        /* Parameters                     */ 0x0000
    },

    // Wooden Door
    {
        /* Room & Cam Index (Front, Back) */ { 1, 0x00, 2, 0x00 },
        /* Actor ID                       */ ACTOR_EN_DOOR,
        /* Position                       */ { -129, -120, -502 },
        /* Rotation Y                     */ DEG_TO_BINANG(180.000),
        /* Parameters                     */ 0x0000
    },

    // Wooden Door
    {
        /* Room & Cam Index (Front, Back) */ { 255, 0x00, 2, 0x00 },
        /* Actor ID                       */ ACTOR_EN_DOOR,
        /* Position                       */ { 119, -120, -596 },
        /* Rotation Y                     */ DEG_TO_BINANG(0.000),
        /* Parameters                     */ 0x0000
    },

    // Wooden Door
    {
        /* Room & Cam Index (Front, Back) */ { 0, 0x00, 1, 0x00 },
        /* Actor ID                       */ ACTOR_EN_DOOR,
        /* Position                       */ { -67, -120, -302 },
        /* Rotation Y                     */ DEG_TO_BINANG(180.000),
        /* Parameters                     */ 0x0000
    },

    // Wooden Door
    {
        /* Room & Cam Index (Front, Back) */ { 255, 0x00, 0, 0x00 },
        /* Actor ID                       */ ACTOR_EN_DOOR,
        /* Position                       */ { 127, -120, -173 },
        /* Rotation Y                     */ DEG_TO_BINANG(0.000),
        /* Parameters                     */ 0x0000
    },
};

opening any door writes

camera: error: illegal camera set (0) !!!!
....change door camera ID -1 (set 1)

in game logs

opening "dontTransition" doors softlocks Link (can't move after link has passed the door)

opening doors between rooms works as expected

Loading blend with 84967dc (current main)

props are basically not upgraded because of missing bpy import lol

Loading blend with 9b17409 (from this PR, #287)

props are mostly upgraded, besides "room to transition to". I believe this is a bug I commented on here #287 (comment)

Copy link
Contributor

@Dragorn421 Dragorn421 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

props are properly upgraded in the previous test blend and the code looks good

@Dragorn421 Dragorn421 added the merge soon Will be merged in a few days at most if nothing else comes up label Jan 26, 2024
@Dragorn421 Dragorn421 merged commit 6c840f4 into Fast-64:main Jan 27, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working merge soon Will be merged in a few days at most if nothing else comes up oot Has to do with the Ocarina of Time 64 side
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants