Announcement

Collapse
No announcement yet.

Join/Connect to Local Server Button Not Working - Please help!

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

    Join/Connect to Local Server Button Not Working - Please help!

    Hi,

    Recently I've been attempting to create simple "host" and "join" buttons through flash and udk following this tutorial:

    http://forums.epicgames.com/threads/...onnection-Menu

    As I'm not a coder, I've been trying to adapt the instructions there to kismet. I have the host button working, but not the join button.

    This is my actionscript and a picture of my menu interface:



    Code:
    import flash.external.ExternalInterface;
    import flash.system.fscommand;
    
    // variable to hold the hosts ip address
    var ip:String;
    
    // client ///////
    // call Joining function when join button is clicked
    join_mc.addEventListener(MouseEvent.CLICK, joining);
    
    function joining(evt:MouseEvent):void{
     ip = ip_mc.text; // make ip variable whatevers typed into the TextInput
     //ExternalInterface.call("JoinFunction", ip);
     fscommand("join");
    }
    As you can see I've commented out the externalinterface call for now in favour of using an fscommand via kismet. Testing the SWF on its own and hitting ctrl+alt+v tells me the string variable is enabled and working, but UDK doesn't seem to recognise it. Here is my kismet attempt:



    The fscommand "join" connects to a console command. I tried using the "open "$ip" found in the unrealscript tutorial I posted earlier (without the quotation marks), as well as open ip, but it just says in the console there is no map called that.

    So! From what I understand, the problem is that UDK isn't recognising the ip variable typed into the box? I've read a bit about GFxGetVariable nodes in kismet, but have no idea how to connect the dots. Any help would be much appreciated!

    #2
    Still trying to figure this out using invoke actionscript and get variable nodes, but no luck. This is what I've got at the moment:



    The two fscommands on the left side are create game and exit, and those both work fine.

    The invoke actionscript node is calling the "joining" function that's in my actionscript, the getVariable node is set to ip (with the result being the string variable, ip), and the bottom fscommand is "join" with the console command "open ip". It's still just saying map ip does not exist.

    I feel like I'm close, but..I don't know. Please help.

    Comment


      #3
      To launch a network game using only fscommands and Kismet, there are a few ways you can do this.

      1. Combine the two strings ("open" & the IP address) in ActionScript, then send this as an argument of an fscommand. Example:

      Code:
      fscommand("join", "open " + ip); // where ip is the string variable containing the IP address entered into a textfield (ip = ipTextField.text)
      Be sure "open " includes a space after the word open. The final output would be something like "open 127.0.0.1"

      Then set up your Kismet like so:



      2. Create your own concat string node in Kismet, that will allows you to combine the string "open" with the ip string. Here's a tutorial on how to make your own concat string Kismet node:

      http://udn.epicgames.com/Three/Devel...ismetNode.html

      Here is the AS3:

      Code:
      // variable to hold the hosts ip address
      var ip:String;
      
      // client ///////
      // call Joining function when join button is clicked
      join_mc.addEventListener(MouseEvent.CLICK, joining);
      
      function joining(evt:MouseEvent):void
      {
          ip = ip_mc.text; // make ip variable whatever is typed into the TextInput "ip_mc"
          fscommand("join", ip);
      }
      Here is the Kismet setup:



      BE SURE the Str Value of the join string variable above is "open " - that's the word open, with a space after it. Leave the Str Value of the IP variable blank, as well as leaving the ConsoleCommand Str variable's Str Value blank.

      Comment


        #4
        I tried the first method and it seems to be working. Thank you so much! Also, the introduction to your fonts tutorial made me laugh. So excited for those fonts.

        Comment

        Working...
        X