EnhancedNetwork / TownofHost-Enhanced

TOHE is the best Host-Only mod for anyone who wants to change their Among Us Experience!
https://tohe.weareten.ca
GNU General Public License v3.0
79 stars 68 forks source link

Disable Use Vent For Vanilla (Port from MoreGamemodes) #1186

Closed Tommy-XL closed 4 days ago

Tommy-XL commented 3 weeks ago

It seems to work, but I still don’t understand the structure of the code, and it seems there is an option to block certain ventilations

I also don't yet know how to return use vent again

image

Ultradragon005 commented 3 weeks ago

fr

Ultradragon005 commented 3 weeks ago

~as ridicolous as it sounds, maybe you can reassign their roletype, by #1182 (make a new branch were u merge those 2 to test). And see if that maybe resets it. Unless rabek knows another way~

Tommy-XL commented 3 weeks ago

I understand how the code works In fact, if vents is active for player again, need to send pc.RpcSetVentInteraction()

Ultradragon005 commented 3 weeks ago

oh okay, I noticed that but didn't think it would work, since the original uses Detoriate and not deserialize

Tommy-XL commented 3 weeks ago

Damn, for some roles need to send an Rpc with a check for activate/blocking vents

NikoCat233 commented 3 weeks ago

It is working but part of the code is not quite good. In vanilla ship status is normally updated with messagewriter instead of serializing data. This code seems to be changing the data for overall ship status, which is unnecessary. I will try code a better one later

NikoCat233 commented 3 weeks ago

NikoCat233 you don't have to code it. There is already better code in More Gamemodes.

@Rabek009 Maybe you want to check my latest codes regarding this https://github.com/0xDrMoe/TownofHost-Enhanced/pull/1195/files#diff-2bded07295473e854b5e5ff63c8a1dbac0626aaf78cd09ed3e72a8f948cfd82aR261

Your code seems to be patching overall shipstatus and thus preventing other systemtypes to be updated

Rabek009 commented 3 weeks ago

My code doesn't patch shipstatus. It only patch ventilation system.

NikoCat233 commented 3 weeks ago

My code doesn't patch shipstatus. It only patch ventilation system.

Sorry for misunderstanding your codes. It only delays other dirty system types from updating when ventilation is dirty and doesnt have much influence.

And I suggest you check these

In IntroCutscene the old code stop adding LastVentId when it meets a "true". fixed that so last vent id is added to all needed players Before IntroCutscene got destoryed (game really starts), the old code is serializing Vents. This will make the first 2 vents in Skeld unusable. Fixed by delaying updating the custom vents.

https://github.com/0xDrMoe/TownofHost-Enhanced/pull/1195/files#diff-f28d7cf36b36f9eedd77ae1497343146c6ec19aa116ee0b8b2bdefce37da437aR636

Tommy-XL commented 5 days ago

Now need to add RpcSetVentInteraction for those roles that temporarily block their vents, for example Arsonist, etc. I'll do this later