Edited by CompahQ, 05 August 2012 - 03:58 AM.
Solved, I'm a derp
Started by CompahQ, Aug 04 2012 11:14 PM
4 replies to this topic
#1
Posted 04 August 2012 - 11:14 PM
Hello, everyone! I'm trying to add a button configuration option to a game I'm making, but I'm not exactly sure how to do it. Right now, I have an object and under the step event it checks if any key is pressed, and then sets a variable to keyboard_lastkey. This gives me a "Variable Name Expected" error, though, so I'm not sure what to do. Any ideas?
#2
Posted 04 August 2012 - 11:45 PM
keyboard_lastkey is already a variable that holds the keycode of the last key pressed. You can't change it, though. If you are using your own variable, call it something different
#3
Posted 04 August 2012 - 11:50 PM
Well, I'm trying to set a different variable to be equal to the keyboard_lastkey variable. It gives me an error though, so I'm not sure what to do.
#4
Posted 04 August 2012 - 11:57 PM
for your [create]:
lst=0;then for your [step]
if keyboard_check_pressed(vk_anykey) then
{ lst = keyboard_lastkey; }
Edited by SlipknLov, 05 August 2012 - 12:52 AM.
#5
Posted 05 August 2012 - 03:57 AM
Thanks for the help everyone, but as it turns out, the problem was because I had the key stored as a constant. I feel kind of stupid.
Anyway, I changed it to being a variable instead and it works just fine. Thanks again!
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











