Forum rules - please read before posting.

more about AC and OUYA

Hey Chris.

I'm finally building Bolt Riley for OUYA .

First, I'm using a script that's a little improvement over Tim Grapumann's script that's currently available.

Feel free to take it and integrate the changes I've made into AC. 
1. the mouse moves instead of snaps into where the stick is.
2. the cursor cycle didn't work properly. now it does. (using the mouse button 1 simulation)

i have some issues -
3. the MENU button doesn't open the main menu as it should (i.e. simulating Escape)
4. if i manually open the menu button through clicking it, the input code doesn't work and the cursor doesn't move with the left stick axis that simulates the mouse. 
ideally , when a menu is on, the left stick axis should cycle between the menu items and not move the cursor at all, but right now, it doesn't do either. maybe there's some missing functionality calling the OuyaIntgration class when a menu is on?



Oded

Comments

  • edited March 2015
  • Thanks for the contribution!  The Menu button may need a modification in PlayerInput, so I'll look at that.

    So far as navigating menus goes, AC only has a very basic keypress-navigation for menus when Input method is set to Keyboard Or Controller.  I believe it's a different story for Unity UI, however, which has it's own system for navigating elements from inputs.  Have a try - it could be that the existing OUYA code already integrates well with Unity UI, so long as the EventSystem is set up correctly.
  • I'm trying out the keyboard controller input.
    1 first thing i notice is that the game is totally not playable in the editor now because if the control. when the mouse is over the window the goes wild and sticks to one of the corners. 
    2. i noticed similar behavior with the cursor using the controller on ouy.
    first, the axis are reverse. when i move the stick down the cursor goes all the way up to the top of the screen. it's like it's sensitivity is on maximum or there's some loop that causes it to behave like that. i don't know if it's because of the ouyaintegration class or what. it also happens with the right stick axis instead of the left stick.
    3. the menu control seems to react to the controller but not as expected . the left sticke's horizontal axis controls it  when you move it left and right instead of vertically up and down. 
    also i think there's a problem with the way it determines the dead zone because it registers all my left movements but only some of the right ones.
    4. with no mouse interface, the ouya's touchpad doesn't work anymore/

     ideally i would be able to keep the mouse control as is but someone add the fnuctionality of the controller to the menus (after fixin the axis movement orinetation) even when in the mouse control scheme.
  • Again, I would recommend looking into a Unity UI for your menu, as it's much better suited to keyboard-based navigation.
  • 3. MENU not working fixed - 

    looks like line 509 in PlayerMenu.cs need to be changed to use the PlayerInput wrapper:

    instead of  Input.
    if (Input.GetButtonDown (menu.toggleKey))

    it should change to something like 
    if (playerInput.InputGetButtonDown (menu.toggleKey))
    however I don't know how to access the playerInput component from the PlayerMenu class. 





  • ps. I will certainly try and change the UI from ongui to Unity UI asap - I'll need to figure out the most efficient way to do so.
  • for now i changed the line in my code to 

    if (OuyaIntegration.GetButtonDown (menu.toggleKey))

    It's opening the menu!

    now the question is how to get the menu items to react to the controller. I guess first step might be redoing the menu in Unity UI and finding out where in the code you chech for controller input and make it also react to controller when in mouse and keyboard mode?

    can you point me in the right direction?
  • Correction - i did change it to  
    if (playerInput.InputGetButtonDown (menu.toggleKey))
    and it does work. i don't remember why it didn't work previously but now it does.

    no. now how do i make the cursor react to the ouya controller input like it does on the game? i'm suspecting there's somewhere there in either the playermenu.cs or in playercursor that it looks for the mouse cursor position insteda of the wrapper's position.
  • and now i upgraded to the latest AC 1.42c and playerInput is no longer available in that file.
  • edited March 2015
    using 1.42c.  it's line 659 in PlayerMenu.cs 
  • I've fixed the menu issue for 1.43.

    The mouse position is read from the PlayerInput's InputMousePosition function, and this includes the Ouya code.  Your game's Input method must be set to Mouse And Keyboard, though.
  • did it fix just the menu opening issue or also receiving the input when the menu is open? because when it is open, in mouse and keyboard mode, the cursor doesn't respond to the controller stick. just to the touchpad. 

    need me to make a video to explain?

    i wound like it if 
    1. the cursor would still move using the Ouyaintegratoin scrips when the menus are open.
    2. when in mouse and keyboard mode, if on ouya, modal menus like these would behave like menus behave when controlling a game with a controller. (less important but would be realy nice to have)
  • I was referring to the menu opening issue.  Yes, a video would be helpful.

    The priority here is to get mouse movement working with menus.  And this wasn't working before you edited OuyaIntegration either?  I can't understand why it wouldn't work if it was working when menus weren't on - the same code is used.
  • maybe something slipped away. in the inverse mouse position or something. i don't know. I'll try to follow the logic path in the code . i'll make a video tomorrow.
  • I am thinking of moving to Unity UI and using another 3rd party plugin to control that. I'll keep you posted it that worked instead.
  • I'm moving my UI to unity UI so i can control it easier with the controller.
    It's sort of sometimes working  - because, the way you coded it, it that the menu system loads all the UI panels, and disables the panels canvas component. But because the other menus's canvases are available their navigation order is also available.

    (see screenshot)
    image

    this screwes up the controller interface with OUYA (and i suspect also when using a controller control optoin in AC - i didn't check)

    any way to work around this?

  • this is how the menu navigation order should look. (i've manually disabled all 4 menus.)
    image


  • I can't recall why now, but I'm pretty sure I opted to disable the canvas component, rather than the root object, for a reason.  I wasn't aware that Unity would still consider it "enabled" however.  Thanks for the alert, I'll have to consider what to do about it.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.