-
Remap controls?
I've been following the Control X Example file found on Nivram's website in order to make the controls for my game remappable and so far it works very well.
However, my problem lies with the number of keys being able to remap. In the events editor, when mapping keys with the Control X object, the only mappable keys are: UP, DOWN, LEFT, RIGHT, FIRE1, FIRE2, FIRE3, FIRE4.
How do I go on if I want to be able to remap more keys than that? Cause im currently still short of three remappable keys that I cant seem to do anything about.
I can currently remap the actions for: UP, DOWN, LEFT, RIGHT, SHOOT, JUMP, AIM, SWITCH WEAPONS on my game, but I also need these to be remappable: SWITCH ITEM, BOMB, DUCK.
Any ideas on how to proceed?
-
Thanks for the examplefile salamander!
Will check it out and try to implement it into my game.
If I have any questions or encounter any problems ill ask in this thread again.
-
Sweet. Thanks for the tip Snail.
I've never used the INI object before, or the more advanced INI++ object (I think its called?). But I've read that those are good for storing stuff like saves, stats etc in seperate files?
Def gonna check them out once my game reaches a more advanced stage.
Oh and btw, im looking forward to your Android tutorial(s) on YouTube! Your tutorials are really helpful. Kudos to you for making them.
-
im going to bump this thread.
i tried out salamander's example file and it works great. thanks for that!
im just wondering: how can I transfer over the controls from one frame to another with the list object? i dont see any option for making the object Global or anything.
also, if i want the controls to remain the same the next time i start up the game, do i need an ini-file for this?
im pretty bad at programming stuff with those objects and i've never used the ini-file before.
-
2 Attachment(s)
okay, so ive slightly modified salamander's example file in order to be able to bring the different key-remaps to other frames.
im currently using counters that read the state of each action (UP,DOWN,LEFT,RIGHT,SHOOT etc etc.). counters that read the Keyboard Object's states (each key on the keyboard has a unique number).
it all works well, but there's one thing that i cant seem to fix.
in my previous events, i used to read the specific player's joystick state for different actions.
example:
*PLAYER 1 JOYSTICK MOVED: LEFT+UP
=Look up, slightly to the left
however, now when i've added the counters instead of reading the joystick state (where you can combine directions, like the example),
i can only read one key at a time: example:
*KEYBOARD OBJECT: REPEAT WHILE KEY VALUE ("Counter for UP") IS PRESSED
*KEYBOARD OBJECT: REPEAT WHILE KEY VALUE ("Counter for LEFT") IS PRESSED
=Look up, slightly to the left (Does not work properly)
is there any way of combining the two into one read, just like with the Player1 joystick state? UP+LEFT instead of UP and LEFT.
Attachment 13691
-
i use control x and key mapping in nearly every program i do. - i only every use an array to store my saved values.
I always use global values called (press left, press right,press up, etc) and change that value with its keycode - NOT in a list, read for ini, etc
the globals are obviously global throughout the entire game, and can be altered anytime during game play by changing its value.. even disabling a key for a time if needed.
up and left together DOES work. put it after any single press checks.
-
does anyone else have the same problem as me when trying to remap controls to the numeric keys? example: 8 for UP, 4 for LEFT, 6 for RIGHT, 5 for DOWN
im currently using salamanders method of remapping controls, and it seems like when trying to look in different directions (often while shooting at the same time) with the numeric keys bugs it out and makes the directions often not respond at all.
i also tried to remap my controls using my old method with the Control X object and the same problem seems to occur there aswell.
is there something with the numeric keys that clickteam fusion 2.5 doesnt like or what?
-
there is nothing wrong with them
-
seems as if my game didnt like salamander's input-configuration-style.
so i instead went back to my previous way of changing the key-layout with the ControlX object and added player 3s and 4s buttons to act as buttons for player 1 and 2 aswell. so i simply could expand the buttonlayout further (since player 3 and 4 are not used anyways).