Hi, I know there are probably places that list examples, but I wanted to get what you guys think is the best way to have a customizable player control setup for a game made with MMF1.5?
The only game I've ever made that had any sort of option like that was Necropolis Rising's Keyboard or Joystick option, and then that was very basic like "Set player control to Joystick 1" or whatever it was because the necro had a default 8 direction movement to him.
What I wanted to do with Hasslevania 2 is to have it so that the player can either use a gamepad or a keyboard, and if he uses a keyboard he can map the controls out however he wants at the beginning. I'm guessing an .ini file is pretty manditory for this, which is cool, but what would you have to do- load that same .ini file up at the start of each frame to see what keypress does what?
Sorry I don't know the best way myself, but the good news is that I am trying to make people's lives controlling the game easier later on.
--
"Del Duio has received 0 trophies. Click here to see them all."
"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"
DXF Games, coming next: Hasslevania 2- This Space for Rent!
DaVince This fool just HAD to have a custom rating
Registered 04/09/2004
Points 7998
11th December, 2007 at 11:26:20 -
Use a custom controller object like Control X (is this even available for MMF2?), I'd say.
My favourite system was halflife's. It had a table of all the keystrokes in-game, and you could click one, and it would flash, and you'd press a buton. That button would then be logged.
Using Control X is your best bet.
Additionally, Control X has names for all the keys, so you can customise the tutorials and text. For instance, suppose a character called Dave says:
"And you can double-jump off walls! Jump up to this wall with :JUMPKEY: and tap it again to push away from it!"
You can make a system which looks for text like :JUMPKEY: in the current paragraph of a string object and replaces it with the assigned key, such as 'SHIFT'. So the text would show up as:
"And you can double-jump off walls! Jump up to this wall with SHIFT and tap it again to push away from it!"
And yes, you're spot on with the INI. I used to do this:
[controls]
up = 31
down = 33
shoot = 69
that kinda thing, using the values from Control X (note: those above values aren't real, i typed any old thing).
That's cool about the whole :JUMPKEY: thing for texts, that would come in handy I'll bet.
Your number you made up for your .ini file look like ASC values Dines, like "ENTER"'s value is 13 and I think "A" is 65. It's been a long time so I could be off.
Thanks guys!
--
"Del Duio has received 0 trophies. Click here to see them all."
"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"
DXF Games, coming next: Hasslevania 2- This Space for Rent!
Dont most gamepads come with a button emulator? Like say you could set button 1 on the gamepad to type d on the screen. mine came with one.
"last one left to die, please turn out the light."
The human child body template used in my avatar was made by Show Kaizer who can be found on rmxp.org forums.