Hi skeeboe,
Here is mine. It works for my setup. I think you need to check what your "(fe.game_info( Info.Control )" actually contains in your setup. That's what I needed to change to get it working here...
I also added the option to switch it to 4-way when it's actually a 2-way stick game.
And I only set it when entering a game. When leaving a game I don't switch at all, because in my Layout it doesn't matter if it's 4-way or 8-way.
///////////////////////////////////////////////////
//
// Attract-Mode Frontend - JoyTray plugin
//
// For use with the Ultimarc ServoStik
//
///////////////////////////////////////////////////
//
// The UserConfig class identifies plugin settings that can be configured
// from Attract-Mode's configuration menu
//
class UserConfig </ help="Integration plug-in for use with the JoyTray software provided by Ultimarc: http://www.ultimarc.com" /> {
</ label="Command", help="Path to the JoyTray executable", order=1 />
command="C:/Program Files (x86)/JoyTray/JoyTray.exe";
}
local config=fe.get_config(); // get user config settings corresponding to the UserConfig class above
//
// Copy the configured values from uconfig so we can use them
// whenever the transition callback function gets called
//
fe.add_transition_callback( "joytray_plugin_transition" );
function joytray_plugin_transition( ttype, var, ttime ) {
if ( ScreenSaverActive )
return false;
switch ( ttype )
{
case Transition.ToGame:
if (fe.game_info( Info.Control ) == "joystick (4-way),joystick (4-way)")
fe.plugin_command_bg( config["command"], "-servo joy4way" );
else if (fe.game_info( Info.Control ) == "joystick (2-way),joystick (2-way)")
fe.plugin_command_bg( config["command"], "-servo joy4way" );
else
fe.plugin_command_bg( config["command"], "-servo joy8way" );
break;
// case Transition.FromGame:
// fe.plugin_command_bg( config["command"], "-servo joy8way" );
// break;
}
return false; // must return false
}