Barotrauma icon indicating copy to clipboard operation
Barotrauma copied to clipboard

Character flipping enhancements

Open TheNinjaScout opened this issue 1 year ago • 4 comments

Added "flipcharacter" status effect command to make a character flip. Mainly only useful for non-humanoids, for example, to make them spawn already flipped through some conditions.

Made "spawncharacter" status effect command and husk infection spawn the new characters already flipped if the target character is also flipped.

Made corpses spawned throughout the level have a 50% chance to spawn flipped.

TheNinjaScout avatar Sep 21 '24 17:09 TheNinjaScout

Very coolio PR

PanmanS avatar Oct 07 '24 11:10 PanmanS

I went ahead an implemented a fix to the flipping syncing bug in our private repo.

Fixed flipping monsters behaving inconsistently in multiplayer when controlling a monster: other clients saw the monster facing in the position of the cursor, even if it hadn't turned at all at the end of the client controlling it. There were two issues here:

Character.Control set the target dir based on the cursor position, disregarding if the character is a humanoid or a monster. The client controlling the monster reported the TargetDir of the monster to the server, but it doesn't do anything at the clients' end unless the monster moves. I think we can just report the actual direction the monster is facing as opposed to the direction it "wants to face".

Regalis11 avatar Oct 15 '24 11:10 Regalis11

I went ahead an implemented a fix to the flipping syncing bug in our private repo.

Fixed flipping monsters behaving inconsistently in multiplayer when controlling a monster: other clients saw the monster facing in the position of the cursor, even if it hadn't turned at all at the end of the client controlling it. There were two issues here: Character.Control set the target dir based on the cursor position, disregarding if the character is a humanoid or a monster. The client controlling the monster reported the TargetDir of the monster to the server, but it doesn't do anything at the clients' end unless the monster moves. I think we can just report the actual direction the monster is facing as opposed to the direction it "wants to face".

Can I reduce the contents of this PR to just the additions rather than fixes then? Namely, making a spawned character spawn already flipped if the character triggering the status effect or husk infection transformation is also flipped, as well as a status effect command to manually flip a character, in case we want to flip them in certain occasions, such as when spawning in.

TheNinjaScout avatar Oct 15 '24 12:10 TheNinjaScout

That sounds good, those seem like useful additions and I can't see any major problems in those changes.

Regalis11 avatar Oct 16 '24 08:10 Regalis11