(Wow, it was I that made this thread. I don't even remember it. Anyways...) having trouble editing...
That's interesting the way you did it. You may know more than I do so bare with me.
In the game I'm working on, I have a script that handles inputs in this fashion:
C#:
[REDACTED]
The code here was written during the beginning of development so it's probably flawed but it works well. This is how I access the inputs:
Code:
[REDACTED]
What I have here works on both in CEMU and on Hardware but in the past I have had trouble with CEMU getting certain inputs to work.
Here's some things to check:
The Emulated Controllers options sometime give me input errors. Since I play Tekken I swap the face[?] buttons to match the ps3 and flip flopping between these
cause some issues when playing other games.
With the Controllers options you may have to re-add the api. I'd try them all.
I kind of ran out of steam here. Let me know if there is something I missed. I'll be sure to take another look.
The areas marked with *, You have to set in the Player settings at least 1 wiimote to get it to work. This took me forever to figure out.
(Wow, it was I that made this thread. I don't even remember it. Anyways...) having trouble editing...
That's interesting the way you did it. You may know more than I do so bare with me.
In the game I'm working on, I have a script that handles inputs in this fashion:
C#:
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.WiiU;
public class GameInputManager : MonoBehaviour{
public static GameInputManager instance; // Probably not the best idea but it works for me.
bool modifiers; // Options for altering inputs like swapping the A and B buttons. This isn't important...
// WiiU
public GamePad _gamepad = GamePad.access;
public bool _all, _of, _the, _games, _inputs;
void Awake(){
instance = this; // Probably not the best idea but it works for me.
_gamepad.StopMotor(); // Following the example in the reference guide.
}
void Update(){
// [some unimportant stuff]
if(Application.isEditor) TestInputs(); else WiiuInputs(); // The Main Deal.
if(A_Setup.instance.gameSetupDone) GameInput.UpdateInput(); // Inputs during gameplay.
}
// I never got around to moving these to the top. I'm pretty much rewriting the script but I'm trying to keep everything in order.
enum WiiUControllerIndex { GAMEPAD = 0, PROCONTROLLER = 1 }; // For swapping between inputs during gameplay. *MORE ON THIS ON THE OUTSIDE.
WiiUControllerIndex _wiiuControllerIndex = WiiUControllerIndex.GAMEPAD;
void WiiuInputs(){
GamePadState _state = _gamepad.state;
ProControllerState _proControllerState = Remote.Access(0).state.pro; // *MORE ON THIS ON THE OUTSIDE.
/*
code to swap between different controllers during gameplay.
not too important
*/
switch(_wiiuControllerIndex){
case WiiUControllerIndex.GAMEPAD:
if(_state.gamePadErr == GamePadError.None){
_all = _gamepad.state.IsTriggered(GamePadButton.Up);
_of = _gamepad.state.IsTriggered(GamePadButton.Down);
_the = _gamepad.state.IsTriggered(GamePadButton.Left);
_games = _gamepad.state.IsTriggered(GamePadButton.Right);
_inputs = _gamepad.state.IsPressed(GamePadButton.Up);
} else ; // not inportant for context
break;
case WiiUControllerIndex.PROCONTROLLER:
_all = _proControllerState.IsTriggered(ProControllerButton.Up);
_of = _proControllerState.IsTriggered(ProControllerButton.Down);
_the = _proControllerState.IsTriggered(ProControllerButton.Left);
_games = _proControllerState.IsTriggered(ProControllerButton.Right);
_inputs = _proControllerState.IsPressed(ProControllerButton.Up);
break;
}
}
// other functions and stuff
}
The code here was written during the beginning of development so it's probably flawed but it works well. This is how I access the inputs:
Code:
GameInputManager m_input;
void Start(){ m_input = GameInputManager.instance; } // Can't use lambda [=>] with this unity version. Irritating...
if(m_input._gamepadSystem_Pause) FUNCTION();
What I have here works on both in CEMU and on Hardware but in the past I have had trouble with CEMU getting certain inputs to work.
Here's some things to check: View attachment 496794
The Emulated Controllers options sometime give me input errors. Since I play Tekken I swap the face[?] buttons to match the ps3 and flip flopping between these
cause some issues when playing other games.
With the Controllers options you may have to re-add the api. I'd try them all.
I kind of ran out of steam here. Let me know if there is something I missed. I'll be sure to take another look.
The areas marked with *, You have to set in the Player settings at least 1 wiimote to get it to work. This took me forever to figure out.
I haven’t tested the game on retail hw yet but it’s weird because for example, touch/click works and I can move through UI navigation (with left joystick), but the rest of the inputs don’t work on the emulator and I don’t see the issue anywhere. :/
I haven’t tested the game on retail hw yet but it’s weird because for example, touch/click works and I can move through UI navigation (with left joystick), but the rest of the inputs don’t work on the emulator and I don’t see the issue anywhere. :/
Sorry I wasn't able to help but let me try something. I'm going to do a little experiment.
Edit:
Code:
...
public static bool ExtremeTest(InputTest input){
GamePadState state = GamePad.access.state;
#if [REDACTED]
switch(input){
case InputTest.A: return [REDACTED];
case InputTest.B: return [REDACTED];
case InputTest.C: return [REDACTED];
case InputTest.D: return [REDACTED];
case InputTest.E: return [REDACTED];
case InputTest.F: return [REDACTED];
case InputTest.G: return [REDACTED];
}
#endif
return false;
}
}
public enum InputTest{ A, B, C, D, E, F, G }
I have put together a bit of a simulation of your input code (which is more fantastic and compact than what I have going on) and everything works in CEMU, except for the X button.
Now I'm going to try it on actual hardware to see if it'll do the same thing.
Final Edit:
Same thing on hardware. But I also noticed that a C Input in my also doesn't work.
Stealth Edit:
False alarm. In game inputs C and Touch [X & Y on the gamepad] were swapped in CEMU for some reason. Touch is supposed to be the gamepad's touch screen but I have it mapped to the NORTH button for debugging.
But what still stands is the gamepad B button isn't being detected.
Sorry I wasn't able to help but let me try something. I'm going to do a little experiment.
Edit:
Code:
...
public static bool ExtremeTest(InputTest input){
GamePadState state = GamePad.access.state;
#if UNITY_WIIU
switch(input){
case InputTest.A: return state.IsPressed(GamePadButton.A);
case InputTest.B: return state.IsPressed(GamePadButton.B);
case InputTest.C: return state.IsPressed(GamePadButton.X);
case InputTest.D: return state.IsPressed(GamePadButton.Y);
case InputTest.E: return state.IsPressed(GamePadButton.ZL);
case InputTest.F: return state.IsPressed(GamePadButton.ZR);
case InputTest.G: return state.IsPressed(GamePadButton.Plus);
}
#endif
return false;
}
}
public enum InputTest{ A, B, C, D, E, F, G }
I have put together a bit of a simulation of your input code (which is more fantastic and compact than what I have going on) and everything works in CEMU, except for the X button.
Now I'm going to try it on actual hardware to see if it'll do the same thing.
Final Edit:
Same thing on hardware. But I also noticed that a C Input in my also doesn't work.
Stealth Edit:
False alarm. In game inputs C and Touch [X & Y on the gamepad] were swapped in CEMU for some reason. Touch is supposed to be the gamepad's touch screen but I have it mapped to the NORTH button for debugging.
But what still stands is the gamepad B button isn't being detected.
Sorry I wasn't able to help but let me try something. I'm going to do a little experiment.
Edit:
Code:
...
public static bool ExtremeTest(InputTest input){
GamePadState state = GamePad.access.state;
#if UNITY_WIIU
switch(input){
case InputTest.A: return state.IsPressed(GamePadButton.A);
case InputTest.B: return state.IsPressed(GamePadButton.B);
case InputTest.C: return state.IsPressed(GamePadButton.X);
case InputTest.D: return state.IsPressed(GamePadButton.Y);
case InputTest.E: return state.IsPressed(GamePadButton.ZL);
case InputTest.F: return state.IsPressed(GamePadButton.ZR);
case InputTest.G: return state.IsPressed(GamePadButton.Plus);
}
#endif
return false;
}
}
public enum InputTest{ A, B, C, D, E, F, G }
I have put together a bit of a simulation of your input code (which is more fantastic and compact than what I have going on) and everything works in CEMU, except for the X button.
Now I'm going to try it on actual hardware to see if it'll do the same thing.
Final Edit:
Same thing on hardware. But I also noticed that a C Input in my also doesn't work.
Stealth Edit:
False alarm. In game inputs C and Touch [X & Y on the gamepad] were swapped in CEMU for some reason. Touch is supposed to be the gamepad's touch screen but I have it mapped to the NORTH button for debugging.
But what still stands is the gamepad B button isn't being detected.
- on build my inputs were not working due to JIT compile in AOT-Only mode in that exact script which makes it to be disabled by unity. Using odin serializer to have AOT runtime references fixed the issue and input went back to normal ^^
Hey guys! I've already managed to make two homebrew ports for WiiU using Unity but I had problems like the game crashes when calling a generic method (and only solution for this is to get rid of genericness).
Right now I'm trying to port another game made with Unity but it crashes instantly when launching on WiiU/Cemu.
Do you know any other reasons why the game might crash?
(I use CafeSDK 2.12.13 and Unity 2017.4.40f1)
Hey guys! I've already managed to make two homebrew ports for WiiU using Unity but I had problems like the game crashes when calling a generic method (and only solution for this is to get rid of genericness).
Right now I'm trying to port another game made with Unity but it crashes instantly when launching on WiiU/Cemu.
Do you know any other reasons why the game might crash?
(I use CafeSDK 2.12.13 and Unity 2017.4.40f1)
I know some time back I had an issue with Cemu crashing because files had square brackets in the name. The weird thing is that on the Wii U it wouldn't crash but the game would hang because a resource wouldn't load because of the file name.
Sometimes for me Cemu crashes but the Wii U won't and that's usually because in Unity I would have a minor error and Cemu would flip out on launch.
I know some time back I had an issue with Cemu crashing because files had square brackets in the name. The weird thing is that on the Wii U it wouldn't crash but the game would hang because a resource wouldn't load because of the file name.
Sometimes for me Cemu crashes but the Wii U won't and that's usually because in Unity I would have a minor error and Cemu would flip out on launch.
It's only ±150 MB.
The previous ones at least loaded and I could understand at which moment the game crashes in order to fix it in the code.
But the current one is doesn't even boot.
It's only ±150 MB.
The previous ones at least loaded and I could understand at which moment the game crashes in order to fix it in the code.
But the current one is doesn't even boot.
Hey guys! I've already managed to make two homebrew ports for WiiU using Unity but I had problems like the game crashes when calling a generic method (and only solution for this is to get rid of genericness).
Right now I'm trying to port another game made with Unity but it crashes instantly when launching on WiiU/Cemu.
Do you know any other reasons why the game might crash?
(I use CafeSDK 2.12.13 and Unity 2017.4.40f1)
The issue is mainly due to AOT. if you make a simple log catcher, you will see that WiiU can't handle any generic method or type not pre-defined. This means that if you are using void TriggerEvent<T> that defines a UnityEvent<T>, for example, you need to make a definition for every type of every event you make like TriggerStringEvent that uses UnityEvent<string>.
This doesn't happen on other platforms because they can handle these things by using IL2CPP but wii u doesn't as Unity didn't support that backend. Btw, this issue also happens on platforms like PlayStation Vita and PlayStation 3. It's a pain to debug as Dictionaries, List, unity events and types need to have a defined type. You can't initialize types dynamically either, btw. I have tons of generic stuff in my game core and I spent days just fixing those AOT calls. The easiest way to debug them is having a devkit but as you are using Cemu as debugger, make a log catcher and keep saving them by input/time and use those as debugging tool.
Edit: Oh, I forgot to say that even if 2017.4 LTS works, the most stable version is 2017.1.3p3. You will save time by using that version instead as 2017.4.40LTS leads to random crashes even using latest CAFE SDK.
It wasn't too long ago we saw our first glimpse of Courage Reborn, another Twilight Princess PC port in the works based on last year's decompilation efforts. With...
Seemingly out of nowhere a PC port for Pokemon Platinum has surfaced online, bundled alongside the source code for those interested in building and developing it for...
After much speculation, Nintendo has finally followed their competitors in announcing price increases for their hardware.
You can find a breakdown of what's changing...
Airing last night with very little in the way of warning, a brand new Nintendo Direct was aired. Running for 15 minutes in total, it took a moment to celebrate the...
With very little in the way of announcement, Valve has today increased the price of the Steam Deck but some fairly considerable margins. Both of the available models...
As a part of their Financial Results Briefing for the previous year, Nintendo president Shuntaro Furukawa took to the floor to answer key questions around the Switch...
Earlier this year, Sony announced major price increases for the PS5, PS5 Pro, and PlayStation Portal. Now the company is raising prices again, this time for...
We are once again here to tell you about a game leaking before its release, but for once, it's not one published by Nintendo. The game files for Microsoft's upcoming...
Continuing with the great news of Pokémon Platinum getting a native unofficial PC port just a few days ago, today, yet another classic title from the franchise has...
The latest in a growing number of native PC ports, Paper Mario ReCut got its first pre-release build earlier this week. Based on the N64 recompilation toolchain, the...
With very little in the way of announcement, Valve has today increased the price of the Steam Deck but some fairly considerable margins. Both of the available models...
It wasn't too long ago we saw our first glimpse of Courage Reborn, another Twilight Princess PC port in the works based on last year's decompilation efforts. With...
After much speculation, Nintendo has finally followed their competitors in announcing price increases for their hardware.
You can find a breakdown of what's changing...
Airing last night with very little in the way of warning, a brand new Nintendo Direct was aired. Running for 15 minutes in total, it took a moment to celebrate the...
Seemingly out of nowhere a PC port for Pokemon Platinum has surfaced online, bundled alongside the source code for those interested in building and developing it for...
Earlier this year, Sony announced major price increases for the PS5, PS5 Pro, and PlayStation Portal. Now the company is raising prices again, this time for...
As a part of their Financial Results Briefing for the previous year, Nintendo president Shuntaro Furukawa took to the floor to answer key questions around the Switch...
The latest in a growing number of native PC ports, Paper Mario ReCut got its first pre-release build earlier this week. Based on the N64 recompilation toolchain, the...
A whole hour of PlayStation content is on the way, thanks to the latest State of Play showcase. Headlining the stream will be Marvel's Wolverine, alongside a...
For the first time in 13 years, the Call of Duty series will again return to Nintendo's consoles. Set to launch on the 23rd of October, the latest release, Modern...