Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CheckInput2()?
#1
I'm working on a specific new feature I believe most of you would enjoy to have in your game or or engine. I'm not going to tell you what it is yet, but I was wondering if the CheckInput2() function is used in MSE Build 1? I've searched for it being called in all the modules and forms but can't seem to find a reason for it being there. If you know that its unused or know anything about it please let me know so I can release the tutorial for my "feature".
Reply
#2
I'm not sure, but I think it isn't used. If you haven't found a call to it then it probably isn't used.
Reply
#3
It is not used, I don't know why but it's not. I opened a blank MSE client and searched for "CheckInput2" and found only "Sub CheckInput2()" so it is not called/requested anytime, anywhere, no idea why. Maybe Shan knows why Smile
Reply
#4
Maybe had plans for it's use with a certain feature and forgot to add the feature, or just simply left it out?
Reply
#5
I think the code from CheckInput2 is at the top of Sub Gameloop, although I'm not sure. Maybe the code was transferred, and the sub was never destroyed.
Reply
#6
Maybe it was a backup of CheckInput that Shan forgot to remove?

Maybe yes maybe no
Reply
#7
If it looks the same as CheckInput then just remove it. Looks it a little bit different then start reading it and try to find out what it does. Does it look really different then it should be another way.
Reply
#8
It doesnt look the same, I dont think it uses constants, too bored to look now thought.
Reply
#9
I know this is a old post but
Code:
Sub CheckInput2()
    If GettingMap = False Then
        If GetKeyState(VK_RETURN) < 0 Then
            Call CheckMapGetItem
        End If
        If GetKeyState(VK_CONTROL) < 0 Then
            ControlDown = True
        Else
            ControlDown = False
        End If
        If GetKeyState(VK_UP) < 0 Then
            DirUp = True
            DirDown = False
            DirLeft = False
            DirRight = False
        Else
            DirUp = False
        End If
        If GetKeyState(VK_DOWN) < 0 Then
            DirUp = False
            DirDown = True
            DirLeft = False
            DirRight = False
        Else
            DirDown = False
        End If
        If GetKeyState(VK_LEFT) < 0 Then
            DirUp = False
            DirDown = False
            DirLeft = True
            DirRight = False
        Else
            DirLeft = False
        End If
        If GetKeyState(VK_RIGHT) < 0 Then
            DirUp = False
            DirDown = False
            DirLeft = False
            DirRight = True
        Else
            DirRight = False
        End If
        If GetKeyState(VK_SHIFT) < 0 Then
            ShiftDown = True
        Else
            ShiftDown = False
        End If
    End If
End Sub
^^^^^CheckInput2() seems like it holds all of the real falses of Checkinput such as Shiftdown = false so you walk instead of run so on and so fourth (It's the version of the player walking not running.) I might be wrong though.
Code:
Sub CheckInput(ByVal KeyState As Byte, ByVal KeyCode As Integer, ByVal Shift As Integer)
    If GettingMap = False Then
        If KeyState = 1 Then
            If KeyCode = vbKeyReturn Then
                Call CheckMapGetItem
            End If
            If KeyCode = vbKeyControl Then
                ControlDown = True
            End If
            If KeyCode = vbKeyUp Then
                DirUp = True
                DirDown = False
                DirLeft = False
                DirRight = False
            End If
            If KeyCode = vbKeyDown Then
                DirUp = False
                DirDown = True
                DirLeft = False
                DirRight = False
            End If
            If KeyCode = vbKeyLeft Then
                DirUp = False
                DirDown = False
                DirLeft = True
                DirRight = False
            End If
            If KeyCode = vbKeyRight Then
                DirUp = False
                DirDown = False
                DirLeft = False
                DirRight = True
            End If
            If KeyCode = vbKeyShift Then
                ShiftDown = True
            End If
        Else
            If KeyCode = vbKeyUp Then DirUp = False
            If KeyCode = vbKeyDown Then DirDown = False
            If KeyCode = vbKeyLeft Then DirLeft = False
            If KeyCode = vbKeyRight Then DirRight = False
            If KeyCode = vbKeyShift Then ShiftDown = False
            If KeyCode = vbKeyControl Then ControlDown = False
        End If
    End If
End Sub
^^^^^^^CheckInput() holds all of the if Shiftdown = true then call running. It's just paralelle to the other; CheckInput2 was probably CheckInput at one point, the ShiftDown = running else walk(CheckInput seems like a better version of CheckInput2), and Shann just left it in as a precaution, or forgot to remove it. I got bored and removed CI2 and there is no negative sideffect without so far.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)