Announcement

Collapse
No announcement yet.

Need to Have Second Player Activate CLIK Widgets on Main and Pause Menus

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Need to Have Second Player Activate CLIK Widgets on Main and Pause Menus

    Hey Gang,

    So I have a 4-player game who all share the same viewport. Both my main menu and pause menu use CLIK widgets with AS 3.0. The first player interacts with the menus just fine. But any other player cannot activate a CLIK widget. The other players can move between widgets, correctly highlighting which widget the player has selected. But actually clicking/pressing a widget does not respond to any other player's input.

    Any help would be greatly appreciated.

    Thank you,
    Dom

    #2
    you can use GetALocalPlayerController(); and grab the first player reference use that to pass in any values to the widgets... also just pass in a var of the playerID of the playercontroller that initiates the change for the value in the widget. I can't say what your issue is cause it's kinda confusing but that would work if your first player has spawned the hud and is controlling it.

    Comment


      #3
      Hey,

      Thanks for the response. To clarify a little more: I can have up to 4 players in the game at one time. At any time, they should be able to toggle the pause menu and interact with it as needed.

      Currently, all players can successfully toggle the pause menu on and off with the start button of the controller. However, only the 1st player can interact with the pause menu. The CLIK widgets do not respond to any of the other players' input.

      So with that being said, I was wondering how to use what you suggested by manually passing value to the widgets. From my understanding, I thought the widget callbacks could only be activated when an event is triggered? If you could just expound a little more, that would be super helpful!

      Thanks So Much,
      Dom

      Comment


        #4
        An event is being triggered since the hud is being spawned from all players meaning that input from all controllers work. To access the hud though you can go through the first player object by sending it commands to modify the hud.

        So knowing that all inputs work you can route the input from all your playercontroller's custom playerinput class to any function in the first playercontroller or any object that has control of the hud, All you need to do is pass an int variable of the playerID into the object so it knows where the command is coming from.

        Lets say your custom player input class took in a function for pressing start:


        Code:
        exec function PressStart(){
        	CustomGameMenuSystem(WorldInfo.Game).ChangeMenu(playerID,"enter");
        }
        This example would access a function in the WorldInfo.Game which controls the hud

        Code:
        function ChangeMenu(int PlayerID, string keyCommand){
                //Modify the hud and keep track of which player issued the command
        	if (PlayerID == 1){
        		movieGUI.p1StartButton.GotoAndStop("61");
        	}
        	else if (PlayerID == 2){
        		movieGUI.p2StartButton.GotoAndStop("61");
        	}
        }

        - this example just goes to frame 61 of a simple movieclip object but you can use settext setbool on the widget or send a command to actionscript to run any functions in there.

        Comment


          #5
          Also by sending the player id, you can route all the information back to the appropriate playercontroller when you need to

          Comment

          Working...
          X