Roblox / Core-Scripts

All of ROBLOX's core client scripts.
Apache License 2.0
255 stars 182 forks source link

Invalid value for enum KeyCode #130

Closed TheSneak closed 4 years ago

TheSneak commented 9 years ago

This occurs in the following places:

einsteinK commented 9 years ago

Pretty sure that's an internal error, when getting the .KeyCode of an InputObject while the key that's pressed doesn't have a proper KeyCode. (Same error happens when setting .KeyCode = nil, or BasePart.FormFactor = nil)

TheSneak commented 9 years ago

Nowhere in my rbxlx file is KeyCode found, nor FormFactor. This error seems to happen with certain non-US keyboard inputs. When it happens, it happens repeatedly to the same user. Following is my error log. Notice that the error occurred in two sets of three times, one at each line as described in the bug report:

Invalid value for enum KeyCode

Timestamp: 3/18/2015 12:32:45 PM
Player: anonplr528873
CoreGui.RobloxGui.CoreScripts/ChatScript2, line 1379

Timestamp: 3/18/2015 12:32:45 PM
Player: anonplr528873
CoreGui.RobloxGui.CoreScripts/ChatScript2, line 1162

Timestamp: 3/18/2015 12:32:45 PM
Player: anonplr528873
CoreGui.RobloxGui.CoreScripts/ChatScript2, line 993

Timestamp: 3/18/2015 12:32:58 PM
Player: anonplr528873
CoreGui.RobloxGui.CoreScripts/ChatScript2, line 1162

Timestamp: 3/18/2015 12:32:58 PM
Player: anonplr528873
CoreGui.RobloxGui.CoreScripts/ChatScript2, line 1379

Timestamp: 3/18/2015 12:32:58 PM
Player: anonplr528873
CoreGui.RobloxGui.CoreScripts/ChatScript2, line 993
einsteinK commented 9 years ago

Yes, probably due to the "weird" keyboard, non-recognised keys are being used. While trying to get the .KeyCode, it probably errors due to that reason.

TheSneak commented 9 years ago

User Maelstronomer in the roblox developer forum says this is caused by mac keyboards: http://developer.roblox.com/forum/client-bug-reports/14730-what-s-up-with-the-chat-scripts#158667

Quenty commented 9 years ago

I can confirm there is precedent for this glitch with invalid keycode enumerators being passed on Macs.

TheSneak—off topic, but—what API are you using to track errors?

TheSneak commented 9 years ago

I'm connecting to the Error event in ScriptContext, then passing those errors to a personal bug tracker via HttpService.

einsteinK commented 9 years ago

I already gave a possible (and highly probable) explaination on another issue, I'll repeat it here:

> Instance.new'Part'.Shape=nil
17:03:59.764 - Invalid value for enum Shape
17:03:59.764 - Script 'Instance.new'Part'.Shape=nil', Line 1
17:03:59.765 - Stack End

That code is some code I wrote replicating the error that this issue is all about. The error happens whenever you try to access InputObject.KeyCode. (That is, if the key it should return isn't a valid one, as is the case with some key on mac). My guess is that when this key is pressed, instead of setting the KeyCode to the Invalid one, it sets it internally to nil/null/void/whatever. When indexing .KeyCode I assume it tries to set the KeyCode internally to nil, resulting to this error.

Of course I can't know for sure, this just seems a possible way of explaining this.

MerelyRBLX commented 9 years ago

TrainedDoorman is seeing a bunch of these errors in GA.

image

einsteinK commented 9 years ago

Seems like he has a lot of Mac users

TrainedDoorman commented 9 years ago

These are events in the past 30 minutes. There are hundreds more than this. I can email them to anyone who wants to view more.

einsteinK commented 9 years ago

Can you figure out who makes them happen, and which OS they use? I assume this is mac-related, as all those errors happened in the past only for those players.

ghost commented 8 years ago

@TheSneak @Quenty @MerelyRBLX @einsteinK @TrainedDoorman Is this still a problem for mac users?

TrainedDoorman commented 8 years ago

@BinaryResolved I still get a few along with other CoreGui issues. errors

ghost commented 8 years ago

@TrainedDoorman Thanks for the info, I don't own a mac but I will see what I can do.

TheSneak commented 8 years ago

Note the varying sources of this error:

CoreGui.RobloxGui.Modules.Settings.SettingsHub, line 1069
CoreGui.RobloxGui.Modules.Chat, line 997    
CoreGui.RobloxGui.Modules.Chat, line 1597
CoreGui.RobloxGui.Modules.Chat, line 1036
CoreGui.RobloxGui.Modules.Settings.Utility, line 629
CoreGui.RobloxGui.Modules.Settings.SettingsHub, line 514
CoreGui.RobloxGui.Modules.Settings.Utility, line 635
CoreGui.RobloxGui.Modules.Settings.Utility, line 1804
CoreGui.RobloxGui.Modules.BackpackScript, line 797

Edit: Added more known sources

ghost commented 8 years ago

If you look at TrainedDoorman's picture you can see the same error happens in more then just those 4 lines. I am setting up a mac osx in virtualbox right now. Hopefully that will work and I can work on finding a fix.

ghost commented 8 years ago

@TheSneak What OS version on mac are you using? E.G, Mavericks, Yosemite, El Capitan?

TheSneak commented 8 years ago

My OS (Win 7) never causes the error. These errors are from the server logs of my games. I can't say which OS/version is responsible.

ghost commented 8 years ago

Ok. I'm still setting up a osx environment, I'll keep you up to date. When I get started.

TheSneak commented 8 years ago

On a tangent, if you get ROBLOX running in a VM, I'd be interested to know how. My attempts have been unsuccessful.

ghost commented 8 years ago

Will do, all my attempts to get Yosemite running in a VM have failed. I may end up borrowing a friends mac.

ghost commented 8 years ago

@TheSneak How far did you get to running ROBLOX on a VM? I got the osx installed and running, I got ROBLOX downloaded and installed, I'm just trying to figure out how to sort out the out of date drivers error. Is this how far you got?

ghost commented 8 years ago

@TrainedDoorman Would it be possible for you to email me that list of errors in the coregui scripts?

TheSneak commented 8 years ago

@BinaryResolved I got the VM running and installed roblox player. I could even run roblox player, but interacting with it with a mouse was impossible. Rendering glitches were out of control.

ghost commented 8 years ago

@TheSneak Ah, I am still trying to get it to work. I won't need to do much with the mouse. All I need to be able to do is open up a baseplate in studio mode and try to find a fix. Did you have any trouble with your graphic drivers being out of date when running in VM?

TheSneak commented 8 years ago

@BinaryResolved No, that wasn't a problem for me. The VM I used was Windows (Probably 7)

ghost commented 8 years ago

@TheSneak Ok, I'm running VM on windows 10 but the osx graphics are utterly terrible when being ran in VM. I'm trying to clear them up a bit.

ghost commented 8 years ago

I can't get it to run ROBLOX studio properly. I've tried everything I could find and do. Sorry that I couldn't help. Someone else that has access to a mac will have to debug and fix this. Sorry again.

ghost commented 8 years ago

Might fix it, http://devforum.roblox.com/t/enum-keycode-deprecations/24415

TheSneak commented 8 years ago

No, still not fixed.

cliffchapmanrbx commented 4 years ago

Hi there, thank you for your feedback. We're going to be closing this repository as we've chosed the Roblox Dev Forum as our venue for developer feedback. Please feel free to migrate your feedback to a DevForum post if you feel it is still relevant.