(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.
The PlayStation 5 scene has received a massive breakthrough with the public release of Relapse, a new exploit chain developed by Nathan Fargo in collaboration with...
The 2007 Nintendo Wii classic Super Mario Galaxy has reportedly been 100% decompiled by the SMGCommunity under the project codename Petari, and now a standalone PC...
It's that time again. Prepare your Switch updates! Or prepare to forgive your sister's nephew's dog for updating your Switch a few weeks ago. Atmosphere v1.12.0 has...
Are you tired of waiting for Nintendo to release a definitive version of their GameCube classic on a console that's sold more than four units? Then step right up! A...
You'd have to be living under a rock to have not noticed the recent boom in static recompilation and decompilation projects - it seems like every day, multiple...
The in-progress Switch port of the 2013 Rockstar Games Grand Theft Auto V has been forced to end progress after Take-Two Interactive has threatened legal action...
Well that didn't take long. Right on the heels of the latest Atmosphere update, Nintendo fire back with a firmware update of their own. Bumping both the Switch and...
A court has ordered Reddit r/SwitchPirates moderator James Williams (of ArchBox fame) must pay Nintendo $4.5 million in a default judgment for copyright infringement...
Two native Switch homebrew ports of The Legend of Zelda: The Wind Waker have turned up, and GBAtemp member @forgotten-865 has gathered both into one thread...
After adding support for Pokemon Crystal last month, the gen1recomp team are back again with the first third generation entries. Arriving amidst recent updates, both...
You'd have to be living under a rock to have not noticed the recent boom in static recompilation and decompilation projects - it seems like every day, multiple...
According to Bill van Zyll, Vice President & General Manager at Nintendo Latin America, he says the company has no plans to end production of physical games...
Are you tired of waiting for Nintendo to release a definitive version of their GameCube classic on a console that's sold more than four units? Then step right up! A...
The in-progress Switch port of the 2013 Rockstar Games Grand Theft Auto V has been forced to end progress after Take-Two Interactive has threatened legal action...
Ken Kutaragi, the engineer behind the original PlayStation and known as the "Father of PlayStation", says he understands why some are frustrated with Sony's decision...
PlayStation 6's RAM and storage alone will cost Sony over $680 USD per console according to KeplerL2 (an industry insider with a good track record). Of course this is...
It's been a long road to get here; but Grand Theft Auto VI is just one month away - releasing November 19th. The launch trailer dropped earlier this week; but with...
The PlayStation 5 scene has received a massive breakthrough with the public release of Relapse, a new exploit chain developed by Nathan Fargo in collaboration with...
Denuvo appears to have been updated and the hypervisor bypass that has been used to crack dozens of games no longer works if recent reports are to be believed.
The...
The anonymous GTA VI leaker known as Cyberleek is now threatening to release a full playable build of Rockstar's upcoming Grand Theft Auto VI according to a statement...