Garry's Mod

Garry's Mod

[TTT/2] Hot Potato!
 이 토론은 고정되었습니다. 중요해서 그렇겠죠?
SkyDivingL  [개발자] 2021년 1월 29일 오전 11시 48분
Errors thread
Let me know if and how the add-on is ruining your day and I'll try to fix it.
< >
전체 댓글 20개 중 1~15개 표시 중
[★SG★] Guushi 2021년 2월 21일 오후 4시 32분 
Players found an issue. If you are holding a Detectives weapon or equipment and a traitor gives you the potato, the weapon or equipment overrides the potato as long as you are holding the weapon/equipment.
[★SG★] Guushi 2021년 2월 21일 오후 4시 33분 
I'm assuming the outcome is the same if you are a Traitor and ur holding a T weapon.
SkyDivingL  [개발자] 2021년 2월 22일 오전 8시 03분 
★SG★ Guushi 님이 먼저 게시:
Players found an issue. If you are holding a Detectives weapon or equipment and a traitor gives you the potato, the weapon or equipment overrides the potato as long as you are holding the weapon/equipment.


★SG★ Guushi 님이 먼저 게시:
I'm assuming the outcome is the same if you are a Traitor and ur holding a T weapon.

Hey, thanks for letting me know. I confirmed this was the case and updated the add-on. Please let me know if the issue pops up again or other issues come up.
The Stig 2021년 5월 23일 오후 10시 21분 
@SkyDivingL I got these two errors:

[[TTT/2] Hot Potato!] gamemodes/terrortown/entities/weapons/weapon_ttt_hotpotato.lua:145: attempt to call method 'Detonate' (a nil value)
1. fn - gamemodes/terrortown/entities/weapons/weapon_ttt_hotpotato.lua:145
2. unknown - lua/ulib/shared/hook.lua:109
3. FireBullets - [C]:-1
4. ShootBullet - gamemodes/terrortown/entities/weapons/weapon_tttbase.lua:328
5. unknown - lua/weapons/weapon_stenmk3/shared.lua:75

[[TTT/2] Hot Potato!] gamemodes/terrortown/entities/weapons/weapon_ttt_hotpotato.lua:151: attempt to call method 'Detonate' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_hotpotato.lua:151

I highly suspect it is because we were holding our guns for some reason and not the hot potato when we were given it, so the "GetActiveWeapon()" call was pulling the gun we were holding and not the hot potato, hence the 'Detonate' function didn't exist.

Maybe try using 'self:Detonate(ply)' instead of calling GetActiveWeapon()?
And adding a timer.Simple to ply:SelectWeapon( "weapon_ttt_hotpotato" ) so they equip it after a delay?

Also, the speed boost convar didn't seem to do anything.
The Stig 님이 마지막으로 수정; 2021년 5월 23일 오후 10시 23분
SkyDivingL  [개발자] 2021년 5월 24일 오전 5시 25분 
The Stig 님이 먼저 게시:
@SkyDivingL I got these two errors:

[[TTT/2] Hot Potato!] gamemodes/terrortown/entities/weapons/weapon_ttt_hotpotato.lua:145: attempt to call method 'Detonate' (a nil value)
1. fn - gamemodes/terrortown/entities/weapons/weapon_ttt_hotpotato.lua:145
2. unknown - lua/ulib/shared/hook.lua:109
3. FireBullets - [C]:-1
4. ShootBullet - gamemodes/terrortown/entities/weapons/weapon_tttbase.lua:328
5. unknown - lua/weapons/weapon_stenmk3/shared.lua:75

[[TTT/2] Hot Potato!] gamemodes/terrortown/entities/weapons/weapon_ttt_hotpotato.lua:151: attempt to call method 'Detonate' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_hotpotato.lua:151

I highly suspect it is because we were holding our guns for some reason and not the hot potato when we were given it, so the "GetActiveWeapon()" call was pulling the gun we were holding and not the hot potato, hence the 'Detonate' function didn't exist.

Maybe try using 'self:Detonate(ply)' instead of calling GetActiveWeapon()?
And adding a timer.Simple to ply:SelectWeapon( "weapon_ttt_hotpotato" ) so they equip it after a delay?

Also, the speed boost convar didn't seem to do anything.

Can you tell me anything that happened before the error occurred? From your description it sounds like you were holding a weapon and somebody gave you an activated hot potato, but that shouldn't cause any issues.

I'll look at the issue and also that of the convar.
The Stig 2021년 5월 24일 오전 5시 48분 
SkyDivingL 님이 먼저 게시:
From your description it sounds like you were holding a weapon and somebody gave you an activated hot potato, but that shouldn't cause any issues.

That is exactly what happened. I had to manually select the hot potato to hold it, ran out of time, but didn't explode and the second error happened.

The first error happened away from me so I didn't see what happened, but I copied it from the console anyway.
SkyDivingL  [개발자] 2021년 5월 24일 오전 8시 23분 
The Stig 님이 먼저 게시:
SkyDivingL 님이 먼저 게시:
From your description it sounds like you were holding a weapon and somebody gave you an activated hot potato, but that shouldn't cause any issues.

That is exactly what happened. I had to manually select the hot potato to hold it, ran out of time, but didn't explode and the second error happened.

The first error happened away from me so I didn't see what happened, but I copied it from the console anyway.

I'm investigating some causes for this error. I have managed to recreate it, and it looks like other addons interfered with the logic of the potato.

The potato works by removing the equipment 1 item (slot 7 typically, but irrelevant) and replacing it with the activated potato. It doesn't matter what weapon you're holding when this happens (with the exception of a potato that's already activated).

After that, the code assumes the player is still holding the potato. I've tried to prevent players from losing the potato: they can't drop it, they can't switch weapons, it blows up on death.

I forgot that some addons could strip weapons from a player, such as the Free Kill Gun Gifter. This weapon in particular removes the equipment 1 item, and if this is an activated potato, there is no way to access Detonate(). This recreates the issue you had.

I'll try and fix this issue for some addons I know (FKG gifter, handcuffs), but could you also tell me about any other addons you use that have similar effects? This allows me to make sure the fix works for these addons as well.

On the subject of the speed convar, I can't find any issues with it either. It is only applied to the player holding an activated potato. By default it's 1.2x boost and I observe this in testing, and I confirmed the convar works in general by setting it to 100x. Maybe 1.2x wasn't noticeable?
The Stig 2021년 5월 24일 오전 10시 17분 
SkyDivingL 님이 먼저 게시:
The Stig 님이 먼저 게시:

That is exactly what happened. I had to manually select the hot potato to hold it, ran out of time, but didn't explode and the second error happened.

The first error happened away from me so I didn't see what happened, but I copied it from the console anyway.

I'm investigating some causes for this error. I have managed to recreate it, and it looks like other addons interfered with the logic of the potato.

The potato works by removing the equipment 1 item (slot 7 typically, but irrelevant) and replacing it with the activated potato. It doesn't matter what weapon you're holding when this happens (with the exception of a potato that's already activated).

After that, the code assumes the player is still holding the potato. I've tried to prevent players from losing the potato: they can't drop it, they can't switch weapons, it blows up on death.

I forgot that some addons could strip weapons from a player, such as the Free Kill Gun Gifter. This weapon in particular removes the equipment 1 item, and if this is an activated potato, there is no way to access Detonate(). This recreates the issue you had.

I'll try and fix this issue for some addons I know (FKG gifter, handcuffs), but could you also tell me about any other addons you use that have similar effects? This allows me to make sure the fix works for these addons as well.

On the subject of the speed convar, I can't find any issues with it either. It is only applied to the player holding an activated potato. By default it's 1.2x boost and I observe this in testing, and I confirmed the convar works in general by setting it to 100x. Maybe 1.2x wasn't noticeable?

Oh, the speed convar is only applied to a live potato? My fault then.
The hot potato never exploded when we used it around 10 times on different maps, we weren't using weapon-stripping weapons every time. But if it's working for you then there's something on my end that's interfering with it. Not sure when I can get around to testing.

As for addons I use that could strip weapons, here's some links:
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2249861635
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=785294711
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=1821994534
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=1821993909

There's also the randomat, though that might be a bit much to make compatible:
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2055805086
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2428342861
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2428350426

This mod might also interfere, putting it here just in case:
https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2451418207
The Stig 2021년 5월 25일 오전 3시 20분 
@SkyDivingL I've found the problem: TFA Guns. From my testing, the hot potato failed to work every time a bot was holding a TFA gun, but worked fine otherwise.

What is a TFA Gun? Any weapon using TFA Base as a base for the weapon, for example these weapons: https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2451435560

I tested with the duel-wield shotguns (classname: c_reaper_nope) from the mod above, here's what I did to get the error:

Make someone hold out a TFA weapon, give them a hot potato, and the player will fail to switch from the TFA weapon to the hot potato, after they were supposed to explode, this error will occur:

[[TTT/2] Hot Potato!] gamemodes/terrortown/entities/weapons/weapon_ttt_hotpotato.lua:164: attempt to call method 'Detonate' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_hotpotato.lua:164

Timer Failed! [Bot03_PotatoTooHot][@gamemodes/terrortown/entities/weapons/weapon_ttt_hotpotato.lua (line 162)]
SkyDivingL  [개발자] 2021년 5월 25일 오후 5시 51분 
The Stig 님이 먼저 게시:
@SkyDivingL I've found the problem: TFA Guns. From my testing, the hot potato failed to work every time a bot was holding a TFA gun, but worked fine otherwise.

What is a TFA Gun? Any weapon using TFA Base as a base for the weapon, for example these weapons: https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2451435560

I tested with the duel-wield shotguns (classname: c_reaper_nope) from the mod above, here's what I did to get the error:

Make someone hold out a TFA weapon, give them a hot potato, and the player will fail to switch from the TFA weapon to the hot potato, after they were supposed to explode, this error will occur:

[[TTT/2] Hot Potato!] gamemodes/terrortown/entities/weapons/weapon_ttt_hotpotato.lua:164: attempt to call method 'Detonate' (a nil value)
1. unknown - gamemodes/terrortown/entities/weapons/weapon_ttt_hotpotato.lua:164

Timer Failed! [Bot03_PotatoTooHot][@gamemodes/terrortown/entities/weapons/weapon_ttt_hotpotato.lua (line 162)]
Thanks for getting it down to something very specific. I'll see if I can fix the issue with this information.
SkyDivingL  [개발자] 2021년 5월 26일 오전 11시 47분 
The Stig 님이 먼저 게시:
@SkyDivingL I've found the problem: TFA Guns. From my testing, the hot potato failed to work every time a bot was holding a TFA gun, but worked fine otherwise.

You were right! If someone is holding one of your overwatch guns when given a potato, they switch to the potato but immediately switch back.

What I did to (hopefully) fix this is to strip all weapons from the target rather than just the equipment 1 item. This circumvents that weird non-switch issue.

I wish I could think of a more elegant solution to the problem, but I don't understand the weapon not properly switching in the first place, so this will have to do.

I've updated the addon. Let me know if it's still busted!
Malivil 2021년 5월 26일 오후 1시 51분 
Does the player get their weapons back if they give the hot potato away?
SkyDivingL  [개발자] 2021년 5월 26일 오후 3시 47분 
Malivil 님이 먼저 게시:
Does the player get their weapons back if they give the hot potato away?
If all works well, yes. Weapons are stripped but returned with the same ammo.
The Stig 2021년 5월 26일 오후 8시 12분 
@SkyDivingL From my testing, it all works! Thanks so much for all that.
Malivil 2021년 5월 27일 오전 4시 40분 
SkyDivingL 님이 먼저 게시:
Malivil 님이 먼저 게시:
Does the player get their weapons back if they give the hot potato away?
If all works well, yes. Weapons are stripped but returned with the same ammo.

That's awesome, good job =)
< >
전체 댓글 20개 중 1~15개 표시 중
페이지당 표시 개수: 1530 50