Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
Beacon: Not necessarily a bug, but definitely a feel bad interaction. If they kill an innocent after stealing the Beacon role, they are swapped back to the innocent team alongside turning into an innocent.
I'll push a change to Mesmerist later since it's a role I developed.
I'll also update to add unique handling for these "issue" roles. If you have ideas for how you think they should be handled, suggestions are welcome.
I also should post a guide in these discussions, but if you know Lua, I've written this role so that there is a hook for editing the Mimic/Doppelganger's role info before they steal/change roles. So it's possible for server owners/addon writers to create their own special handling without editing the role's code.
As for ideas for how to handle the exception roles, Jester as i mentioned in this post would ideally simply turn the Doppelganger/Mimic into an Amnesiac instead. For Beacon it would make the most sense to be Innocent(ableit still as Doppel team), and for Infected it could be Unknown.
Thank you!
Alchemist has 2 timers. The main one on the server-side is set to give an equipment item after a certain amount of time. The other is client-side and simply exists as a way for the HUD element to know when the next potion is being made and how many are left. They are set up and ran at the same time.
The problem is that when a Mimic/Doppelganger copies an Alchemist, it seems that only the client-side timer that operates the HUD element starts up, meaning that they will never actually make a potion.
Would you have any idea how I may go about fixing this?
I would create a fallback using either the ROLE:GiveRoleLoadout function or the Role Change hook to start your timers.
Here is an example of the GiveRoleLoadout from Tim
https://github.com/TTT-2/ttt2-role_pha/blob/19734d15685e6fe21d24d0c04c082462f7a7205f/lua/terrortown/entities/roles/pharaoh/shared.lua#L40
And here is an example where I use the role change hook for Doppelganger's various role handlings.
https://github.com/ZacharyHinds/ttt2-role-dop/blob/master/lua/terrortown/autorun/server/sv_spec_dop_roles.lua
That function calls another function to handle the timer and set up the HUD at the same time.
https://github.com/EmberTheFlareon/ttt2-role-alch/blob/638847fd0165539367fa15212d40906b73bf2a5e/lua/terrortown/entities/roles/alchemist/shared.lua#L52
See? It sets up the potion timer's function along with sending a net message to the client to start the HUD timer.
That's why I am so confused as to why the HUD timer and element start up but the potion timer doesn't. The HUD timer even correctly pulls the ConVars for how long it will take and how many potions left.
I've looked over your role handler so many times and tried so many things to get that first timer working.
The following is what my cursory look-over spots which could be the issue. Because what it looks like to me, is that there can only be a single Alchemist timer at a time because there can only be one timer
Looking over your code, it seems to me that there can only be a single Alchemist timer running because each individual timer needs a unique string identifier. Currently, GiveMeAPotion(ply) always tries to create a timer with the identifier "MakePotion".
If I am right and this is the issue, what you would need to do is to create a unique identifier per player when they become an alchemist.
I don't have anything that handles individual timers for multiple Alchemists. That explains everything!
Looking at Imposter, the way I'd set it up is timer.Create("MakePotion" .. ply:SteamID64", timetomake ect ect....
That makes perfect sense. Right now, it sets the timer up for the role and not the player. That's also probably why the client-side timer functions just fine. It's already assigned to the client!
Thank you so much! I'll get the fix out as soon as I can.