安装 Steam
登录
|
语言
繁體中文(繁体中文)
日本語(日语)
한국어(韩语)
ไทย(泰语)
български(保加利亚语)
Čeština(捷克语)
Dansk(丹麦语)
Deutsch(德语)
English(英语)
Español-España(西班牙语 - 西班牙)
Español - Latinoamérica(西班牙语 - 拉丁美洲)
Ελληνικά(希腊语)
Français(法语)
Italiano(意大利语)
Bahasa Indonesia(印度尼西亚语)
Magyar(匈牙利语)
Nederlands(荷兰语)
Norsk(挪威语)
Polski(波兰语)
Português(葡萄牙语 - 葡萄牙)
Português-Brasil(葡萄牙语 - 巴西)
Română(罗马尼亚语)
Русский(俄语)
Suomi(芬兰语)
Svenska(瑞典语)
Türkçe(土耳其语)
Tiếng Việt(越南语)
Українська(乌克兰语)
报告翻译问题
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.