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

[Core] Add setMeleeRange LUA binding #5908

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

0x05010705
Copy link
Contributor

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my PR will be ignored.
  • I understand I should leave resolving conversations to the LandSandBoat team so that reviewers won't miss what was said.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have tested my code and the things my code has changed since the last commit in the PR and will test after any later commits.

What does this pull request do?

  • Creates a LUA binding mob:setMeleeRange(float) that allows for a mobs 'hitbox' or melee range to be dynamically modified.
  • This allows for mobs with larger/smaller than normal hitboxes to be changed to values that deviate from the standard range that is listed in mob_family_pools.sql without changing every instance of that mob.

NOTE: This does not modify/change the behavior of mob pathing in any way, only the melee range that both the player and the mob can hit each other from.

This helps resolve issues where a mobs flags might trigger model scaling (IE: Flag Values 0x02, 0x04) which increase the mobs size, and then players have to be right up next to the mob/inside the mob to maintain melee range.

Steps to test these changes

After Rebuilding
1 - Engage in combat with a mob in any zone
2 - Increase the melee range with !exec target:setMeleeRange(10)
3 - Move your character far away and note that both the player and the mob can melee each other from this new range.

This is more impactful on things with larger models such as on Wyrms.

@zach2good
Copy link
Contributor

You've added a new binding, but not used it anywhere. Can you add it to some relevant mobs to show that you've tested this properly?

@0x05010705
Copy link
Contributor Author

You've added a new binding, but not used it anywhere. Can you add it to some relevant mobs to show that you've tested this properly?

Are you asking to update mob luas in the PR? Or just to add it to some mobs and show that it works through screenshots?

@zach2good
Copy link
Contributor

Presumably, the plan is to apply this to mobs that have a large model size and, therefore a larger melee range, so do that. I'm assuming this wasn't written exclusively to use as !exec target:setMeleeRange(10).

@WinterSolstice8 said something about this data being sent through 0x00E - Entity Update. I think the long term goal would be to have 0x00E fully implemented against @atom0s's RE packet definitions (https://github.com/atom0s/XiPackets/tree/main/world/server/0x000E#graphsize) and then have this as data that's assigned at the pool level, not the script level - but this PR will be fine for now if there are big Wryms etc. that really need to have their melee ranges pushed out.

@0x05010705
Copy link
Contributor Author

Sounds good - I should have some more time to get to this in another day or two.

Copy link
Member

@WinterSolstice8 WinterSolstice8 left a comment

Choose a reason for hiding this comment

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

personally I don't really have a problem with this until we get around to fixing 0x00E and adding in the range to mobs

It may be a while before that happens - I think the data we want hasn't been captured before which means every mob type would have to be captured and made generic (I assume most mobs of the same type/size would have the same extra range)

but re-capping the entire game is a pretty tall order, especially because the tooling hasn't been made yet

tl;dr: 0x00E update will probably happen before the range is implemented anyway

@zach2good zach2good merged commit 3da1133 into LandSandBoat:base Jul 16, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants