Announcement

Collapse
No announcement yet.

Scaleform Front End Menu System

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

    #16
    Setting the bShowHardwareMouseCursor to true just makes the OS cursor show up, which is fine too. I only included the custom MouseCursor class to show how to use ActionScript to take care of updating the UI and because it's common to want a custom mouse cursor for your game. If you'd rather just use the OS cursor, I don't think there's anything wrong with that.

    Comment


      #17
      Can you explain the save system that is included with the source what states does it save?

      Comment


        #18
        Got things working Mavrik73... Thanks a lot for your help!

        Comment


          #19
          Originally posted by Phen0mM0dz View Post
          Can you explain the save system that is included with the source what states does it save?
          It's a simplified version of the Save Game States Gem on the UDN. It saves every actor in the level that implements the SaveGameStateInterface class to an array of JSON formatted strings. The Basic Save Game Tutorial on my site goes into greater detail about how it works and what I modified from the Gem, but basically I left out the code that saves Kismet and Matinee for simplicity's sake and adapted it to work for non UT type games (games that extend UDK classes and not UT classes).

          Comment


            #20
            Originally posted by John J View Post
            Got things working Mavrik73... Thanks a lot for your help!
            Good to hear John, good luck!

            Comment


              #21
              Originally posted by John J View Post
              Great tutorial but for some reason I can't get the mouse to show up.
              After some experimentation on different machines, I discovered that there was a concurrency bug in the original tutorial. There was a race between loading the actual image of the cursor and instantiating an object of the MenuCursor class. If the image wasn't loaded by the time the MenuCursor object got created, the image never got attached to the object and the mouse wouldn't show up. I fixed this by using an event listener to wait for the image to load before creating the MenuCursor object and as far as I can tell, it seems to be working properly now. Thanks, John, for bringing this to my attention.

              Comment


                #22
                can please someone upload the source files of the classes used in the tutorial?
                it would be very helpful

                thanks much

                Comment


                  #23
                  Originally posted by milerk View Post
                  can please someone upload the source files of the classes used in the tutorial?
                  There is a link to the source files on the first page of the tutorials, but I'll re-link it here for you:

                  ScaleformMenuTutorial.zip

                  Comment


                    #24
                    thanks i missed that but
                    for now i have few problems with that

                    Code:
                    function SetMouseCoords(GFxObject LastCursorMC)
                    {
                    	MouseCoords.X = LastCursorMC.GetFloat("x");
                    	MouseCoords.Y = LastCursorMC.GetFloat("y");
                    }
                    for me these getFloat("x") functions fired on cursorMC were always returning 0, even if the cursor movieclip wasn't null

                    and second problem is with the configuration file
                    Code:
                    [ScaleformMenu.SFMFrontEndOptionsMenu]
                    +ResolutionList="800x600"
                    +ResolutionList="1024x768"
                    i somehow couldnt populate the ResolutionList array with these strings, array was always empty in the game and after running the game string quotations disappeared in the config file, but it happened only to that array,
                    other properties i had in config file were loaded properly

                    does anybody know how to fix these problems? thanks

                    edit:

                    removing the ' + ' before variables fixed the second problem

                    Comment


                      #25
                      Off the top of my head, I'd say that you could be passing in the cursor object from the new screen to the SetMouseCoords function instead of the cursor object from the previous screen. As the tutorial mentions, whenever a new cursor is created in ActionScript, its coords are 0, 0. You should be passing in the cursor from the previous menu to set the mouse coords for the cursor in the new menu. Other than that, I couldn't tell you what else might be wrong without a little more information.

                      Comment


                        #26
                        no, its a different thing, something is probably wrong with the connection between them in unrealscript and actionscript,
                        in the cursor class i placed
                        Code:
                        private function MoveMouse(evt:MouseEvent):void
                        {
                        	x = evt.stageX;
                        	y = evt.stageY;
                        	ExternalInterface.call("onMouseMove", x, y);
                        }
                        onMouseMove function, so everytime i move the mouse it logs its position

                        Code:
                        event onMouseMove(float x, float y)
                        {
                               `log("UDK POS" @ MC_Cursor.GetFloat("x") @ MC_Cursor.GetFloat("y"));
                               `log("CSS POS" @ x @ y);   
                        }
                        UDK's are always 0 (however CSS are ok and i see the cursor moving on the screen), also MC_Cursor.SetFloat("x") either doesnt work

                        im initializing the cursor inside the Start function
                        MC_Cursor = GetVariableObject("Cursor");
                        also in actionscript it is
                        public var Cursor:mMouseCursor; (initialized in the scene movieclip constructor)
                        so these names should be okay, MC_Cursor is not null but i cant really do anything with it ;/

                        and also all the class files are linked to their swf movies as in the tutorial

                        Comment


                          #27
                          Is this a typo or is this actually how this variable is declared?:

                          Originally posted by milerk View Post
                          public var Cursor:mMouseCursor;
                          I only ask because the capitalization is a little off from ActionScript convention (class names usually start with a capital letter) and I wanted to make sure that that's how you actually have it written. Also, it looks like the variable in ActionScript is named "Cursor" and not "cursor" as in the tutorial, is that right? Unlike Unrealscript, ActionScript is case sensitive, so if the capitalization of the variable name in Unrealscript doesn't match the variable name in Actionscript, maybe that could possibly cause the problem you're seeing depending on how the GetVariableObject function works. Just a thought, but it might be worth looking into.

                          Originally posted by milerk View Post
                          also MC_Cursor.SetFloat("x") either doesnt work
                          MC_Cursor.SetFloat("x") won't work because you need a second argument: MC_Cursor.SetFloat("x", 5.3). Probably just a typo, but I wanted to check.

                          Comment


                            #28
                            yep the setFloat its just a typo, mMouseCursor is a class im using for the cursor, ill check with changing it tomorrow (im on a phone right now) also I will create some textfields, movieclips on the stage and see if I can initialize them in uscript. thanks for your help and the tutorial


                            @edit

                            i can only connect with unrealscript these textfields that were created and placed on a stage,
                            is it possible that the Start function is fired before the library is loaded?

                            @edit2

                            cursor will only work if i put Cursor movie clip on every menu stage,
                            looks like the GetVariableObject() works only to the objects that are on the stage, objects initialized later, like in scene class constructors wont work for me at least

                            i see now that my cursor after importing to UDK loses its alpha channel,
                            the cursor i see moving has a white background (in flash i dont see the background)
                            whats up with that?

                            Comment


                              #29
                              Originally posted by milerk View Post
                              i can only connect with unrealscript these textfields that were created and placed on a stage,
                              is it possible that the Start function is fired before the library is loaded?
                              I don't think so, but you could test it by making an Unrealscript function to log something and calling it from both the ActionScript CreateCursor function and the UnrealScript Start function to see which is firing first.

                              Originally posted by milerk View Post
                              cursor will only work if i put Cursor movie clip on every menu stage,
                              looks like the GetVariableObject() works only to the objects that are on the stage, objects initialized later, like in scene class constructors wont work for me at least
                              An older version of the tutorial had this issue on some machine's due to asynchronous loading, but the latest version waits until the library swf is loaded before trying to use the cursor object it contains. I've tested it on several machines and with a couple of different projects and haven't seen any problems. If you're still having this issue, there might be a problem with how you have the resource sharing set up.

                              Originally posted by milerk View Post
                              i see now that my cursor after importing to UDK loses its alpha channel,
                              the cursor i see moving has a white background (in flash i dont see the background)
                              whats up with that?
                              I've never seen that with any of the menus I've tested, so something might be wrong with either the image or some settings. Maybe try going over the steps for using images and make sure everything is set correctly.

                              Libraries can be a pain in Flash, so another test you could do is get rid of the library swf and just plug everything into each scene. That would cause each swf to be bigger, so you probably don't want to do that as a final solution, but it might help you track down where the problem is.

                              Comment


                                #30
                                This tutorial calls for a Visual Studio plug-in. How can I follow this tutorial without Visual Studio because I don't want to buy it. I'm a beginner and am using a trial version of CS6 Flash pro with the November 2012 latest release of UDK. Thanks.

                                Comment

                                Working...
                                X