Announcement

Collapse
No announcement yet.

Simple Lan Connection Menu

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

    Simple Lan Connection Menu

    hey yo

    heres a quick and dirty way to make a scaleform menu to connect over a LAN.
    it isnt a detailed explination of everything involved in making a menu, there is plenty of info about that already.

    Flash:

    place a TextInput with an instance name of ip_mc (properties).
    a Button called join_mc.
    a Button called host_mc

    Actionscript
    Code:
    import flash.external.ExternalInterface;
    
    // variable to hold the hosts ip address
    var ip:String;
    
    // client ///////
    // call Joining function when join button is clicked
    join_mc.addEventListener("click", this, "joining");
    
    function joining() {
     ip = ip_mc.text; // make ip variable whatevers typed into the TextInput
     
    // call JoinFunction in unreal script and send ip
    ExternalInterface.call("JoinFunction", ip); 
    }
    
    // Host////////////////
    // call hosting function when host button is clicked
    host_mc.addEventListener("click", this, "hosting");
    
    function hosting() { 
    // call HostFunction in unreal script
    ExternalInterface.call("HostFunction"); 
    }
    Unreal Script
    Code:
    class GFxTeglegFrontEnd extends GFxMoviePlayer;
    
    
    //join a game
    function JoinFunction(string ip)
    {
    //open the ip address in the textinput
    ConsoleCommand("open "$ip);
    }
    
    // Host a game
    function HostFunction()
    {
    //open a map as a listen server, change DM-Deck to your map
    ConsoleCommand("open DM-Deck?Listen");
    }
    theres probably other functions you need to include in GFxTeglegFrontEnd to make it work, only the connection functions are shown here.

    have fun

    #2
    Nice tut. Will include it in the Getting Started post.

    Comment


      #3
      So to create a lan match we would only create a normal match on udk and oter people can join?

      Comment


        #4
        pressing host starts a match as a listen server by using the console command open mapname?Listen
        i know nothing of the technical side of udk multiplayer yet.
        iv only just worked out how to connect.

        to test it on 1 pc:
        open 2 instances of udk, start a server (host) game on 1.
        the other (client) use ip address 127.0.1

        Comment


          #5
          For anyone who might try this. Note that if you are having problems with this, before assuming it's scaleform related there are port requirements for UDK.

          To do a simple test you can use the console command to connect to an existing server:

          Code:
          open ipaddresstarget:port
          
          open 127.0.0.1:7777
          Make sure you have started a server, either by using the server startup line or by using what tegleg said above.

          Comment


            #6
            Thanks for this tutorial it's been helpful in getting some multiplayer happening haven't figured it all out 100% yet but I'm getting there.

            Comment


              #7
              I'm having a problem with what tegleg said. I opened two ints of udk game, but when I host a game on the first and type in open 127.0.0.1 on the second one it loads the main menu on the second one. do I need to do PIE or something?

              Comment


                #8
                Cook your map and launch using unreal frontend

                Comment


                  #9
                  or use the correct address
                  127.0.1

                  Comment


                    #10
                    I finally gotten around to implementing and I have question about the flash script.

                    Should the Flash script be on the frame or the button instance? Sorry sounds simple but can't seem to get flash to communicate with my SWF in UDK.

                    Thanks!

                    Comment

                    Working...
                    X