I've got three input sets defined:
SetList = TitleScreenInput # MainGameInput # CreditsInput
Each one of these is defined in their separate config files (i.e., TitleScreen.ini, MainGame.ini, and Credits.ini). When I switch to the main game, I call:
I've tested the return value of this one, and it does return orxSTATUS_SUCCESS. However, I find that only my TitleScreenInput is being processed. If I change the order of input sets in the SetList = ... line, and put MainGameInput first, then the MainGame input gets processed. That is, it seems like Orx is only processing the first (default) input set on the SetList line, regardless of whether I call orxInput_SelectSet() or not.
...and it shows that I do have MainGameInput selected. However, if I add a key input to TitleScreenInput that isn't in MainGameInput, the key still gets processed, even though MainGameInput is supposed to be the one selected.
Which version of orx are you using?
I'm currently back to France for two weeks as my father passed away at the beginning of the week, so I might not be able to do any testing/debugging right away. Sorry for the delay.
Otherwise...ooof, that's terrible news to hear. You have my condolences. Honestly, take whatever time off you need; I know I for one was just posting here to get my question down in print before I forgot about it. You'd mentioned being away for personal reasons, so I didn't expect any immediate answers. Go ahead and take that time with your family; we'll be here when you get back.
I'll try to have a look to the input module in the coming days, at least that will keep my mind from wandering in places I don't want it to go.
Are all your input sets in files that are loaded before init (ie. included from the main config file)? If not, are you loading them with orxInput_Load()? Is there any inheritance between your input sets?
If you still have the issue, could you send your files for me to try directly? (You can PM me if you want to keep it private.)
However, this might tie into something I've noticed in the past, and had been meaning to ask about. In all my Orx projects thus far, I get a number of warnings about inputs already being bound. For example:
As I say, this happens in every project I make; it seems as though the engine is binding my inputs twice. However, in my current project, I'm only declaring the one set of inputs (which becomes the default set), and not calling orxInput_SelectSet() or orxInput_Load(). So I'm not sure why Orx is giving the warning above, or whether this may be causing my problems with orxInput_SelectSet().
Will do. I've got my own OrxToLua.cpp file that (not surprisingly) exports a lot of Orx's functionality to Lua. Perhaps that has something else to do with the problem? Anyway, after I've finished this little game (just a silly project for some friends for Easter), I'll throw together an example project where I get the warnings.
As for your LUA wrapper, do you think it's something that would benefit other users? If so, if you want to share it, I'd be happy to give you access to the svn and the wiki. No pressure though!
Anyway, when I pass along this sample input-problem project, you can have a look at it and tell me what you think.
I was calling orxInput_Load(orxSTRING_EMPTY) in my app's Init() function; I think I read somewhere (a tutorial on the wiki?) that this was necessary during startup. Is this perhaps only for Orx plugins, as opposed to stand-along applications?
Anyway, I removed the orxInput_Load() call, and now I no longer get the "already bound to input" warnings. Case closed.
So yes, when a project is using the launcher, as the inputs will be initialized just after orx.ini is loaded and before the user's plugin is initialized. One might need to manually load his config file and then reload the inputs.