Skip to content

Fix up issues related to +use, doors, buttons, and such#1792

Merged
TimGoll merged 21 commits intoTTT-2:masterfrom
wgetJane:+use-fix
Mar 11, 2025
Merged

Fix up issues related to +use, doors, buttons, and such#1792
TimGoll merged 21 commits intoTTT-2:masterfrom
wgetJane:+use-fix

Conversation

@wgetJane
Copy link
Contributor

@wgetJane wgetJane commented Mar 10, 2025

fixes #1775
fixes #1691
fixes #1633
fixes #1626

@wgetJane
Copy link
Contributor Author

wgetJane commented Mar 10, 2025

this should be ok for testing now, i've tested it on a bunch of maps and it seems to work like it does in ttt (the main goal of this pr is to restore parity with ttt's +use behaviour with map entities)

gonna mention @Crashington since they seem to have had issues with ttt2 stuff in their maps as well, pls let me know if those issues are fixed with this pr

also i'm gonna restore crowbar unlocking/opening behaviour to be in line with base ttt, then i'll open this pr after that

@TimGoll
Copy link
Member

TimGoll commented Mar 10, 2025

I will try to see if this breaks any things that I implemented with external addons

@Crashington
Copy link

can confirm from my end that the pr fixes the two issues i found (#1 doors not being openable when the door entity origin is too far away from the door brush the player pressed use on. #2 func_rotating being paused/started by +use)

@TimGoll
Copy link
Member

TimGoll commented Mar 10, 2025

Seems like your changes broke this addon from me: https://steamcommunity.com/sharedfiles/filedetails/?l=indonesian&id=3335175627

other than that everything seems to work fine right now

@TimGoll
Copy link
Member

TimGoll commented Mar 10, 2025

Ah, another issue: When having a marker vision entity in LOS and looking at it, hitting E not only opens its UI, but also triggers the button:

image

This is something that should not happen, markervision elements, same as traitor buttons, should have priotiy over in world entities

@wgetJane
Copy link
Contributor Author

Seems like your changes broke this addon from me: https://steamcommunity.com/sharedfiles/filedetails/?l=indonesian&id=3335175627

other than that everything seems to work fine right now

i'll check later, what's broken specifically?

@TimGoll
Copy link
Member

TimGoll commented Mar 10, 2025

Seems like your changes broke this addon from me: https://steamcommunity.com/sharedfiles/filedetails/?l=indonesian&id=3335175627
other than that everything seems to work fine right now

i'll check later, what's broken specifically?

The addon is able to overwrite the name and description for buttons - that seems to no longer work.

Well, maybe it was on me. I just notived I have multiple version of this MC map. Maybe I chose the wrong one. I will test again!

@wgetJane
Copy link
Contributor Author

wgetJane commented Mar 10, 2025

Ah, another issue: When having a marker vision entity in LOS and looking at it, hitting E not only opens its UI, but also triggers the button:

This is something that should not happen, markervision elements, same as traitor buttons, should have priotiy over in world entities

oh right i forgot, ttt is supposed to "cancel" your actual +use if you're pointing at a "special use" entity like corpses and traitor buttons and such, probably just needs a return true in cl_keys

@TimGoll
Copy link
Member

TimGoll commented Mar 10, 2025

Confirmed on ttt_elevatorandstairs that it is not working:

image
image

Not even the admin-info is working:

image

This should show info about the button (like its ID etc)

Here's the relevant code: https://github.com/TTT-2/ttt2-button_info/blob/main/lua/terrortown/autorun/client/cl_buttoninfo_tid.lua#L8-L31

If the ent is valid on the server and the client, then this should work

@wgetJane
Copy link
Contributor Author

wgetJane commented Mar 11, 2025

@TimGoll seems to work fine for me

image

image

@wgetJane wgetJane marked this pull request as ready for review March 11, 2025 03:52
…the centre of the entity and in fact it can even return Vector(0, 0, 0) so the correct function to use for this is Entity:WorldSpaceCenter()
@TimGoll
Copy link
Member

TimGoll commented Mar 11, 2025

@wgetJane That is so weird, because it still doesn't work for me

@TimGoll
Copy link
Member

TimGoll commented Mar 11, 2025

@wgetJane you're right, oof. Somehow I enabled minimal mode for targetID:

image

works now. So consider this resolved

@TimGoll
Copy link
Member

TimGoll commented Mar 11, 2025

Your changes also fix #1627

Even the vehicle on grovestreet now works again!

@TimGoll TimGoll linked an issue Mar 11, 2025 that may be closed by this pull request
Copy link
Member

@TimGoll TimGoll left a comment

Choose a reason for hiding this comment

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

Thank you so much for looking into this issue. That looks really good to me. Besides the one question, could you add to your changelog that you also fixed the car usage?

@TimGoll TimGoll merged commit 4729f81 into TTT-2:master Mar 11, 2025
4 checks passed
@Crashington
Copy link

it is with a heavy heart that i must report that the most recent update seems to have not fixed everything it should have.
https://steamcommunity.com/sharedfiles/filedetails/?id=1293781407
on this version of waterworld the button inside the soda machien that is supposed to teleport you does not work
also, it seems like the "healing dispenser only heals for 1 health at a time" bug has returned

i am sure i am on the newest version since i have the new c4 settings available in the f1 menu

@wgetJane
Copy link
Contributor Author

on this version of waterworld the button inside the soda machien that is supposed to teleport you does not work

it doesn't work in base ttt either, the button is locked

using the ent_fire !picker unlock console command, the button can be pressed in both ttt and ttt2

also, it seems like the "healing dispenser only heals for 1 health at a time" bug has returned

this might be caused by the ENT.CanUseKey = true line in ttt_health_station.lua, which is not present in base ttt

@Crashington
Copy link

oh sorry on the waterworld thing then. weird that its locked but thats irrelevant here then.

@TimGoll
Copy link
Member

TimGoll commented Mar 19, 2025

The health station issue is handled in TTT2. Maybe you accidentally removed our continuous use implementation?

@Crashington
Copy link

i wouldnt know how i would have done that. we use the normal workshop version on the server. unless another addon could be somehow interfering? we dont have anything that directly interacts with the health station anyway

@wgetJane
Copy link
Contributor Author

probably meant me, not you, though i haven't touched the health station at all, just forgot to test it for this pr

i'll figure out a solution later, was my fault anyway for not checking the health station (i just tested the traitor's placeables lmao)

@TimGoll
Copy link
Member

TimGoll commented Mar 20, 2025

probably meant me, not you, though i haven't touched the health station at all, just forgot to test it for this pr

It is not part of the health station per se, but part of the use code. Holding E retriggers use 10 times per second.

In theory this is an engine feature. I reimplemented it in lua. Dunno which approach would be best with your changes though

TimGoll pushed a commit that referenced this pull request Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants