| Mirage Source http://miragesource.net/forums/ |
|
| CheckInput2()? http://miragesource.net/forums/viewtopic.php?f=210&t=354 |
Page 1 of 1 |
| Author: | Loraunt [ Sun Aug 06, 2006 1:53 am ] |
| Post subject: | CheckInput2()? |
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". |
|
| Author: | Liz [ Sun Aug 06, 2006 1:59 am ] |
| Post subject: | |
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. |
|
| Author: | Dragoons Master [ Sun Aug 06, 2006 2:54 am ] |
| Post subject: | |
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 |
|
| Author: | Leighland [ Mon Aug 07, 2006 11:53 pm ] |
| Post subject: | |
Maybe had plans for it's use with a certain feature and forgot to add the feature, or just simply left it out? |
|
| Author: | Robin [ Wed Aug 09, 2006 7:16 pm ] |
| Post subject: | |
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. |
|
| Author: | Belier13 [ Wed Aug 09, 2006 10:30 pm ] |
| Post subject: | |
Maybe it was a backup of CheckInput that Shan forgot to remove? Maybe yes maybe no |
|
| Author: | Godlord [ Fri Mar 09, 2007 6:15 pm ] |
| Post subject: | |
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. |
|
| Author: | William [ Fri Mar 09, 2007 6:26 pm ] |
| Post subject: | |
It doesnt look the same, I dont think it uses constants, too bored to look now thought. |
|
| Author: | DarkX [ Tue May 08, 2007 4:01 pm ] |
| Post subject: | |
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. |
|
| Author: | Lea [ Sat Jul 21, 2007 4:18 am ] |
| Post subject: | Re: CheckInput2()? |
CheckInput2 polls the keyboard for keypresses, and was probably at one point called every game loop. CheckInput uses the events raised by the keyboard to execute only when needed. |
|
| Author: | FrankJScott [ Fri Jan 12, 2024 6:58 am ] |
| Post subject: | Top Rated Product Guide |
Please try Google before asking about Great Product Guide 85975a9 |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|