winstxnhdw / lc-hax

A powerful, feature-rich and highly performant internal cheat for the co-op indie horror video game, Lethal Company.
77 stars 25 forks source link

Improvements #355

Closed xAstroBoy closed 4 months ago

xAstroBoy commented 4 months ago

Add /Suit command Add /Enemies Command Add /Spawn command Add /quota command

Fix Godmode to not break player interactions add DelayedFunction extension Fix kill Self not working by delaying the toggle on by a few seconds late giving time to execute.

winstxnhdw commented 4 months ago

The branch is already a mess. If you look at the file changes, you are beginning to revert our current changes.

Create a new PR with one feature each, or you can wait for me to commit them myself.

xAstroBoy commented 4 months ago

The branch is already a mess. If you look at the file changes, you are beginning to revert our current changes.

Create a new PR with one feature each, or you can wait for me to commit them myself.

i am working on reverting the edits that are outdated.

winstxnhdw commented 4 months ago

Move everything to do with EnemyController to another PR.

xAstroBoy commented 4 months ago

Move everything to do with EnemyController to another PR.

there's not a lot of different changes, just analyzed each AI and converted their behaviour states to enumerators which makes it easy to understand and adjusted the way to make RigidBodyKeyboard set the enemy walking/running animation based off the given imputs. i forgot to merge this before you fixed and cleaned the code properly.

winstxnhdw commented 4 months ago

there's not a lot of different changes

Exactly, that’s why move it to another PR. I am not reviewing another PR with dozens of things going on again.

xAstroBoy commented 4 months ago

@winstxnhdw there we go.

xAstroBoy commented 4 months ago

@winstxnhdw im sure now the files edited aren't even editing the original codes anymore, i triple checked everything.

xAstroBoy commented 4 months ago

@winstxnhdw i removed all the obsolete edits , just the needed changes.

winstxnhdw commented 4 months ago

Also, is your ReSharper not detecting my editorconfig? I see a lot of format style commits and that happens if you keep violating the editorconfig settings. Normally, it should help you autoformat the code.

xAstroBoy commented 4 months ago

Also, is your ReSharper not detecting my editorconfig? I see a lot of format style commits and that happens if you keep violating the editorconfig settings. Normally, it should help you autoformat the code.

apparently so...

winstxnhdw commented 4 months ago

I don't use Visual Studio but maybe you can look at this.

xAstroBoy commented 4 months ago

@winstxnhdw i turned that predicate into a extension

xAstroBoy commented 4 months ago

Looks solid to me.

winstxnhdw commented 4 months ago

Move the enemy controller stuff to another PR if you want that merged soon.

winstxnhdw commented 4 months ago

can you please stop adding new things to the PR. just create a new one. it’s frustrating to review code that is constantly changing. it’ll also force you to think how you can separate code better to avoid merge conflicts, which will help you with structuring your code better.

xAstroBoy commented 4 months ago

can you please stop adding new things to the PR. just create a new one. it’s frustrating to review code that is constantly changing. it’ll also force you to think how you can separate code better to avoid merge conflicts, which will help you with structuring your code better.

that was the last one, im enchancing /spawn to cover all enemies of all levels, not just the ones based off that level, since controlcompany does a similiar thing with a override mode, i rewrote the dictionary parsing to look better and cleaner and it will fill it once as it will find all the enemies and prefabs in all levels.

xAstroBoy commented 4 months ago

@winstxnhdw changes are done and finished.

xAstroBoy commented 4 months ago

@winstxnhdw all good now?

xAstroBoy commented 4 months ago

@winstxnhdw Now?

winstxnhdw commented 4 months ago

Nope. Still too much nonsense.

xAstroBoy commented 4 months ago

Nope. Still too much nonsense.

what is nonsense? I DONT GET IT WHAT IS THE ISSUE!?

winstxnhdw commented 4 months ago

This is why I told you to separate the PRs so we can have an easier time merging. Now you are stuck here all because you are holding unnecessary state in your suit patch.

xAstroBoy commented 4 months ago

This is why I told you to separate the PRs so we can have an easier time merging. Now you are stuck here all because you are holding unnecessary state in your suit patch.

the unneccessary state is not unneccessary, it caches everyting , EDITS AND RESTORES THE STATE OF THE ORIGINAL SUIT and it works, __STATE CAN CONTAIN JUST ONE VARIABLE, NOT 3!

winstxnhdw commented 4 months ago

Use a struct.

xAstroBoy commented 4 months ago

Use a struct.

Why overcomplicate it ? it works! NO NEED FOR A STRUCT!

winstxnhdw commented 4 months ago

Because __state only works between Prefix and Postfix. Your static fields are accessible throughout the class.

xAstroBoy commented 4 months ago

Because __state only works between Prefix and Postfix. Your static fields are accessible throughout the class.

BECAUSE THE PATCH HAS TO SET ONE FIELD TO OVERRIDE THE PRIVATE CLASS FIELD BEFORE EXECUTING IT!

winstxnhdw commented 4 months ago

How about I ask you a question? Why not, I just convert every single variable, method and class in my program to static. It's easier and apparently, 'less complicated' after all.

xAstroBoy commented 4 months ago

How about I ask you a question? Why not, I just convert every single variable, method and class in my program to static. It's easier and apparently, 'less complicated' after all.

These variables can and they are exposed, because there's a reason, not because there's not.

winstxnhdw commented 4 months ago

Sure, then why create classes or structs at all? Just store them as static fields, right? They have a reason.

xAstroBoy commented 4 months ago

Sure, then why create classes or structs at all? Just store them as static fields, right? They have a reason.

Because they need to be accessible from the same patch externally! Why you overcomplicate it? if you want to make it your way just do it, i dont get it why there's such a big deal just for 3 fields exposed to be edited externally!?

winstxnhdw commented 4 months ago

Same thing can be said, why not just use a struct? You should read up on https://en.wikipedia.org/wiki/SOLID. Using a struct instead of a static field is trivial. They both take the same amount of time to implement so why don't you just choose the better one?

Am I asking you to spend hours to profile your code for micro performance gains? No. Just write better; least accessible, typesafe, immutable code.

xAstroBoy commented 4 months ago

@winstxnhdw i rewrote /suit and removed the patch

winstxnhdw commented 4 months ago

I am not changing sell. It works better as it was.

xAstroBoy commented 4 months ago

I am not changing sell. It works better as it was.

issue is your algoritm does not work, i adapted to work with your grab logic and it did do nothing it said 0 and the array was always empty, unless i sell all stuff, and that works.

winstxnhdw commented 4 months ago

No idea what do you mean by not working. I played the entire night and used the sell command many times. Worked perfectly.

xAstroBoy commented 4 months ago

No idea what do you mean by not working. I played the entire night and used the sell command many times. Worked perfectly.

then just take the modified PlaceItemOnCounter and adapt it to work with .GrabObject as i did, that way when you type /sell it will not show floating items randomly flying to the desk, it will show you placing them there.

winstxnhdw commented 4 months ago

I want it to fly to the desk. Why would I want others to know it was me who sold the items?

xAstroBoy commented 4 months ago

I want it to fly to the desk. Why would I want others to know it was me who sold the items?

oh, then just adapt PlaceItemsOnDesk , it works either way without a player holding it as you will force place the item there.

winstxnhdw commented 4 months ago

The main branch version of sell is atomic. But you want to switch to GrabObject which requires async code, is less performant, and harder to maintain. There is no good reason to use it over what we already have.

xAstroBoy commented 4 months ago

The main branch version of sell is atomic. But you want to switch to GrabObject which requires async code, is less performant, and harder to maintain. There is no good reason to use it over what we already have.

i mean did you try just invoking the AddObjectToDeskServerRPC without even holding the item only? seems that is working better than setting a variable and doing that.

winstxnhdw commented 4 months ago

Not sure what you mean.

xAstroBoy commented 4 months ago

Not sure what you mean.

nevermind, i discarded all changes about the sell command, invoking the RPC only is not enough.

winstxnhdw commented 4 months ago

Yes, that’s how grabbables work in this game. You need to first ‘grab’ them to gain ownership of the item.

xAstroBoy commented 4 months ago

@winstxnhdw i hope you agree the ESP looks better. i fixed the ESP bug that rendered unexistent players as well made it change color if a player died and a body exists. Found a way to make it display dead body when a dead body player's name spawns and i gave it a different color

xAstroBoy commented 4 months ago

@winstxnhdw now the body shows which player is from

winstxnhdw commented 4 months ago

Seems like your PlayDropSFX is server-side only.

xAstroBoy commented 4 months ago

Seems like your PlayDropSFX is server-side only.

what do you mean?

winstxnhdw commented 4 months ago

I think I meant to type ‘client-side’ only.

xAstroBoy commented 4 months ago

I think I meant to type ‘client-side’ only.

how so? im doing it exactly how the game plays it when you drop, i couldn't find a rpc for it