Download

Dynamic Input Function Overrides?

Please note that my mind set is coming from a system That I Implemented in Torque 3D. It consist of binding a General Naming Convention for the base game inputs and over writing the function calls using packages in game. Looking something like below:

Mapping



//CONTROL WITH CONTROLER
rpgMoveMap.bind(gamepad, dpadl,                          RPG_L_BTN);
rpgMoveMap.bind(gamepad, dpadu,                          RPG_U_BTN);
rpgMoveMap.bind(gamepad, dpadd,                          RPG_D_BTN);
rpgMoveMap.bind(gamepad, dpadr,                          RPG_R_BTN);

rpgMoveMap.bind( gamepad, thumbrx, "D", "-0.05 0.05",    RPG_YAW_X );
rpgMoveMap.bind( gamepad, thumbry, "D", "-0.05 0.05",    RPG_PITCH_Y );
rpgMoveMap.bind( gamepad, thumblx, "D", "-0.05 0.05",    RPG_MOVE_X );
rpgMoveMap.bind( gamepad, thumbly, "D", "-0.05 0.05",    RPG_MOVE_Y );

rpgMoveMap.bind( gamepad, btn_l,                         RPG_L1_Trigger);
rpgMoveMap.bind( gamepad, btn_r,                         RPG_R1_Trigger);

rpgMoveMap.bind( gamepad, triggerl,                      RPG_L2_Trigger);
rpgMoveMap.bind( gamepad, triggerr,                      RPG_R2_Trigger);

rpgMoveMap.bind( gamepad, btn_lt,                        RPG_L3_Trigger);
rpgMoveMap.bind( gamepad, btn_rt,                        RPG_R3_Trigger);

rpgMoveMap.bind( gamepad, btn_back,                      RPG_Select );
rpgMoveMap.bind( gamepad, btn_start,                     RPG_Start );

rpgMoveMap.bind( gamepad, btn_a,                         RPG_A_BTN );
rpgMoveMap.bind( gamepad, btn_b,                         RPG_B_BTN );
rpgMoveMap.bind( gamepad, btn_x,                         RPG_X_BTN );
rpgMoveMap.bind( gamepad, btn_y,                         RPG_Y_BTN );



//Package Excert 1




package KeyMapBattleMode
{

function RPG_U_BTN(%val)
{
   if($_DEBUG_BTNS&&%val)echo("RPG_U_BTN");
}

function RPG_D_BTN(%val)
{
   if($_DEBUG_BTNS&&%val)echo("RPG_D_BTN");
   if(%val){
   }
}
...
...
...
};//package



//Package Excert 2




package CarControls
{

function RPG_U_BTN(%val)
{
   if($_DEBUG_BTNS&&%val)echo("RPG_U_BTN");
}

function RPG_D_BTN(%val)
{
   if($_DEBUG_BTNS&&%val)echo("RPG_D_BTN");
   if(%val){
   }
}
...
...
...
};//package



Package switch system:




 function changeToPackage(%newOne)
{
	$lastPackage = $activeKeyPackage;
	$activeKeyPackage = %newOne;
	switch($lastPackage)
	{
	   
      case $KEY::NullMode:
         deactivatePackage(KeyMapNull);
         if($_DEBUG_BTNS)echo("deactivate: KeyMapNull");
         rpgMoveMap.pop();
      case $KEY::TitleMode:
         deactivatePackage(KeyMapTitleScreen);
         if($_DEBUG_BTNS)echo("deactivate: KeyMapTitleScreen");
         rpgMoveMap.pop();
      case $KEY::RPGMode:
         deactivatePackage(KeyMapRPGMode);
         if($_DEBUG_BTNS)echo("deactivate: KeyMapRPGMode");
         rpgMoveMap.pop();
      case $KEY::PauseMode:
         deactivatePackage(KeyMapPauseMenuMain); 
         if($_DEBUG_BTNS)echo("deactivate: KeyMapPauseMenuMain");
         rpgMoveMap.pop();
      case $KEY::GOMode:
         deactivatePackage(KeyMapGameOverScreen); 
         if($_DEBUG_BTNS)echo("deactivate: KeyMapGameOverScreen");
         rpgMoveMap.pop();
      case $KEY::QBARMode:
         deactivatePackage(KeyMapQBarMode); 
         if($_DEBUG_BTNS)echo("deactivate: KeyMapQBarMode");
         rpgMoveMap.pop();
      case $KEY::EventNavigation:
         deactivatePackage(KeyMapEventNavigation); 
         if($_DEBUG_BTNS)echo("deactivate: KeyMapEventNavigation");
         rpgMoveMap.pop();
      case $KEY::KeyMapItemStoreOptions:
         deactivatePackage(KeyMapItemStoreOptions); 
         if($_DEBUG_BTNS)echo("deactivate: KeyMapItemStoreOptions");
         rpgMoveMap.pop();
      case $KEY::KeyMapItemStoreSelectList:
         deactivatePackage(KeyMapItemStoreSelectList); 
         if($_DEBUG_BTNS)echo("deactivate: KeyMapItemStoreSelectList");
         rpgMoveMap.pop();
      case $KEY::KeyMapItemStoreTotal:
         deactivatePackage(KeyMapItemStoreTotal); 
         if($_DEBUG_BTNS)echo("deactivate: KeyMapItemStoreTotal");
         rpgMoveMap.pop();
      case $KEY::KeyMapItemStoreSellSelectList:
         deactivatePackage(KeyMapItemStoreSellSelectList); 
         if($_DEBUG_BTNS)echo("deactivate: KeyMapItemStoreSellSelectList");
         rpgMoveMap.pop();
      case $KEY::KeyMapItemStoreSellTotal:
         deactivatePackage(KeyMapItemStoreSellTotal); 
         if($_DEBUG_BTNS)echo("deactivate: KeyMapItemStoreSellTotal");
         rpgMoveMap.pop();
      case $KEY::KeyMapSaveGame:
         deactivatePackage(KeyMapSaveGame); 
         if($_DEBUG_BTNS)echo("deactivate: KeyMapSaveGame");
         rpgMoveMap.pop();
      case $KEY::KeyMapInnStoreOptions:
         deactivatePackage(KeyMapInnStoreOptions); 
         if($_DEBUG_BTNS)echo("deactivate: KeyMapInnStoreOptions");
         rpgMoveMap.pop();
      case $KEY::CutSceenControls:
         deactivatePackage(CutSceenControls); 
         if($_DEBUG_BTNS)echo("deactivate: CutSceenControls");
         rpgMoveMap.pop();
      case $KEY::CarControls:
         deactivatePackage(CarControls); 
         if($_DEBUG_BTNS)echo("deactivate: CarControls");
         rpgMoveMap.pop();
      case $KEY::KeyMapBattleMode:
         deactivatePackage(KeyMapBattleMode); 
         if($_DEBUG_BTNS)echo("deactivate: KeyMapBattleMode");
         rpgMoveMap.pop();
      case $KEY::KeyMapWorldEDTMode:
         deactivatePackage(KeyMapWorldEDTMode); 
         if($_DEBUG_BTNS)echo("deactivate: KeyMapWorldEDTMode");
         rpgMoveMap.pop();
         
      default :
         error("------INVALID MAP SENT----------");
         
	}
	
	switch($activeKeyPackage)
	{
      case $KEY::NullMode:
         activatePackage(KeyMapNull);
         if($_DEBUG_BTNS)echo("activate: KeyMapNull");
         rpgMoveMap.push();
      case $KEY::TitleMode:
         activatePackage(KeyMapTitleScreen);
         if($_DEBUG_BTNS)echo("activate: KeyMapTitleScreen");
         rpgMoveMap.push();
      case $KEY::RPGMode:
         activatePackage(KeyMapRPGMode);
         if($_DEBUG_BTNS)echo("activate: KeyMapRPGMode");
         rpgMoveMap.push();
      case $KEY::PauseMode:
         activatePackage(KeyMapPauseMenuMain); 
         if($_DEBUG_BTNS)echo("activate: KeyMapPauseMenuMain");
         rpgMoveMap.push();
      case $KEY::GOMode:
         activatePackage(KeyMapGameOverScreen); 	
         if($_DEBUG_BTNS)echo("activate: KeyMapGameOverScreen");
         rpgMoveMap.push();
      case $KEY::QBARMode:
         activatePackage(KeyMapQBarMode); 	
         if($_DEBUG_BTNS)echo("activate: KeyMapQBarMode");
         rpgMoveMap.push();
      case $KEY::EventNavigation:
         activatePackage(KeyMapEventNavigation);  	
         if($_DEBUG_BTNS)echo("activate: KeyMapEventNavigation");   
         rpgMoveMap.push();
      case $KEY::KeyMapItemStoreOptions:
         activatePackage(KeyMapItemStoreOptions); 
         if($_DEBUG_BTNS)echo("activate: KeyMapItemStoreOptions");
         rpgMoveMap.push();
      case $KEY::KeyMapItemStoreSelectList:
         activatePackage(KeyMapItemStoreSelectList); 
         if($_DEBUG_BTNS)echo("activate: KeyMapItemStoreSelectList");
         rpgMoveMap.push();
      case $KEY::KeyMapItemStoreTotal:
         activatePackage(KeyMapItemStoreTotal); 
         if($_DEBUG_BTNS)echo("activate: KeyMapItemStoreTotal");
         rpgMoveMap.push();
      case $KEY::KeyMapItemStoreSellSelectList:
         activatePackage(KeyMapItemStoreSellSelectList); 
         if($_DEBUG_BTNS)echo("activate: KeyMapItemStoreSellSelectList");
         rpgMoveMap.push();
      case $KEY::KeyMapItemStoreSellTotal:
         activatePackage(KeyMapItemStoreSellTotal); 
         if($_DEBUG_BTNS)echo("activate: KeyMapItemStoreSellTotal");
         rpgMoveMap.push();
      case $KEY::KeyMapSaveGame:
         activatePackage(KeyMapSaveGame); 
         if($_DEBUG_BTNS)echo("activate: KeyMapSaveGame");
         rpgMoveMap.push();
      case $KEY::KeyMapInnStoreOptions:
         activatePackage(KeyMapInnStoreOptions); 
         if($_DEBUG_BTNS)echo("activate: KeyMapInnStoreOptions");
         rpgMoveMap.push();
      case $KEY::CutSceenControls:
         activatePackage(CutSceenControls); 
         if($_DEBUG_BTNS)echo("activate: CutSceenControls");
         rpgMoveMap.push();
      case $KEY::CarControls:
         activatePackage(CarControls); 
         if($_DEBUG_BTNS)echo("activate: CarControls");
         rpgMoveMap.push();
      case $KEY::KeyMapBattleMode:
         activatePackage(KeyMapBattleMode); 
         if($_DEBUG_BTNS)echo("activate: KeyMapBattleMode");
         rpgMoveMap.push();
      case $KEY::KeyMapWorldEDTMode:
         activatePackage(KeyMapWorldEDTMode); 
         if($_DEBUG_BTNS)echo("activate: KeyMapWorldEDTMode");
         rpgMoveMap.push();
         
      default :
         error("------INVALID MAP SENT----------");
	   
	}
}



I’m not sure what I could do to achieve this in Unreal outside of using Function Pointers to redirect inputs to different processing function types. Which doesn’t seem as clean as packages.

Anything someone can point me to?