tModLoader

tModLoader

Terraria Overhaul (Configuration Update!)
なかの31 31 May, 2024 @ 5:53pm
Attempting to implement compabitility with TerraGuardians Mod.
I'm trying to add compatibility with my companions mod, but there are some features that are getting in the way, and I'll explain why (sorry for the wall of text in advance):

The companions of my mod extends the Player object, and has a custom update script with workarounds to have them work.
For the mod to work, I need to set the companion temporarily as the player character in a number of cases, to make so some things like attacks and other things work (or else, they'd be treated like a multiplayer character that can't be touched on the client).

The video bellow showcases two issues (beside one I have no idea what causes) that I caught on the mod. First, there's that odd... Constant hitting sound, that plays for a while if I don't move the character.

The second issue, is that due to the Player Direction system in Overhaul, the companion can't turn by itself because it's set to always face the mouse (And the companion itself is programmed to have its internal mouse be placed in front of them when they're not in combat).

https://youtu.be/m3oNJIrIEDA

At least for the Player Direction case, I thought about having a flag attached to the ModPlayer that manages it, which can be flipped off to disable the feature for that ModPlayer instance (since the companions also have their own ModPlayer objects).

Or at least was the idea I had when checking the mod source, or at least unless a better idea shows up, but I don't think I can do that directly from my side.
< >
Showing 1-2 of 2 comments
Mirsario  [developer] 22 Jun, 2024 @ 4:51am 
It sounds sufficient for you to just move your mouse position override to
(player.Center + (Vector2.UnitX * player.direction))
As for the sound - no idea what that is, attach a debugger onto SoundEngine.PlaySound from TML's solution, or peek at the soundstyle via injections.

You are however also hearing low health & low mana sound loops, which only update on Main.myPlayer player instances. It doesn't sound like a good idea to have companions be such instances.

GitHub is a better replace for such questions: https://github.com/Mirsario/TerrariaOverhaul/issues
Last edited by Mirsario; 22 Jun, 2024 @ 4:52am
なかの31 22 Jun, 2024 @ 11:56am 
Thanks for the answer.

The mouse override actually is a genius idea. I just need to move make so when Terraria Overhaul is present, temporarily change the mouse position before the hook the mouse direction changes happen, and then revert it afterwards.

I actually had no idea that could be done tho, about the attaching a debugger onto something.
That will come in handy for testing that issue.

The companions being flagged as the player character is a workaround I used to make a lot of functions work on them, or else they would behave like another player in multiplayer:
Intangible, and various other issues.
If the low health and mana sounds are looping, there's probably some companion knocked out in the world.

I'll be sure to use the issues session next time I have questions (I tend to avoid using that on other github pages because generally they have astronomic numbers, yeah, poor devs).

Anyways, Thanks again for the answer.
< >
Showing 1-2 of 2 comments
Per page: 1530 50