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

Colliders: elemType -> elemMaterial #2189

Merged
merged 2 commits into from
Sep 16, 2024

Conversation

Dragorn421
Copy link
Collaborator

Split from #1925

Rename ColliderElement.elemType / ELEMTYPE_ -> ColliderElement.elemMaterial / ELEM_MATERIAL_

The elemMaterial is primarily used to determine the sfx made when struck by the player (0: NA_SE_IT_SWORD_STRIKE, 1: NA_SE_IT_SWORD_STRIKE_HARD, others: no sound) (in CollisionCheck_SwordHitAudio)

Additionally ELEM_MATERIAL_UNK4 prevents some behavior from interactions with hookshot and arrows.

  • for hookshot, the difference with using ACELEM_HOOKABLE is that ELEM_MATERIAL_UNK4 prevents playing the sound NA_SE_IT_ARROW_STICK_CRE and the hookshot keeps going (I think)
  • for arrows, the difference with using ACTOR_FLAG_14 ("ACTOR_FLAG_ARROW_CAN_CARRY") is that ELEM_MATERIAL_UNK4 prevents playing the sound NA_SE_IT_ARROW_STICK_CRE and the arrow keeps going (I think)

/* 5 */ ELEM_MATERIAL_UNK5,
/* 6 */ ELEM_MATERIAL_UNK6,
/* 7 */ ELEM_MATERIAL_UNK7
} ElementMaterial;
Copy link
Contributor

@krm01 krm01 Sep 12, 2024

Choose a reason for hiding this comment

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

I just noticed, the structs above this use ColliderElementXXXXXX instead of simply ElementXXXX like this one. should it be consistent? (not that it matters much, this enum name is never referenced afaict 😁 )

@mzxrules
Copy link
Contributor

To me, it just looks like ELEM_MATERIAL_UNK4 allows the Hookshot tip and Arrow type arrows to pass through a collider even though it is detected as being hit.

@fig02
Copy link
Collaborator

fig02 commented Sep 12, 2024

that is what dragorn said, with the added detail that it prevents a hit sfx from playing

@mzxrules
Copy link
Contributor

what he wrote does not make it clear that the detected collision with a collider is being thrown away unconditionally.

Copy link
Collaborator

@fig02 fig02 left a comment

Choose a reason for hiding this comment

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

dont think material particularly works for the arrow/hookshot thing, but am willing to go with it for now

@fig02 fig02 merged commit 48780cd into zeldaret:main Sep 16, 2024
1 check passed
@Dragorn421 Dragorn421 deleted the colliders_elemmaterial branch September 17, 2024 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants