So i had a idea on how to do hosting and joining with UMG but i’m still kind of new to UE4 and i have a question. So i have a Button that when clicked Executes a console command “open Level1?listen” and that works just fine. Then i have a Join button that when click takes you to a editable text where you type a ip and that textbox is set as a variable. What i’m trying to do is send the numbers typed in the editable text to a execute console command to join that ip. But when i tried it out it did not work. can you guys check and see if i did something wrong or if this even will work at all.
I’m not sure what you mean. I’m packaging the project to test this out on my desktop and that is when the error appears. So my blueprint looks fine the way it is?
when loading new map make sure you don’t have any widgets on the screen - remove this widget from the viewport before loading new map. I’ve done the same thing yestarday, and here’s my blueprint which is working - make sure you are playing on standalone game or cooked game.
Ok i found out where i messed up in this. First i did not have it open the map it should of (facepalm) second i forgot to add a space after “open” in the append. Here is what it looks like working.
The way i have this setup is. There is a host and a join button. When one player clicks host it runs a Console command “open Level1?listen”. That runs the game as a listen server on that players ip. Then for other players to connect they click join and they see the “Ip Address” text box. They enter the players ip that host the server and click enter. Upon clicking enter that code in the blueprint above activates. Sending the player to the map then opening the Ip Address that they typed into the box. This is a basic system for now and hopefully it helped someone out.
Now i want to try to take this further and i have been working on it since my last post but i need some help. I want some way for this system to detect if the ip typed is hosting a game or not. Will i be able to do this with Booleans. For example, I type in a ip that is not hosting a game and a message pops up telling me so. I have most of this setup but i cannot figure out how to cast between widgets. I tried putting a bool in the “host” button event and having it set to true that changes a branch in the join blueprint to allow to play to join. But that doesn’t seem to work. How can i make the bool change from False to True when a game is being hosted on that ip?.
10 bucks straight on the hand for the guy who makes this simple system work for me im struggling since weeks i dont know what i do different than whats shown here
And that should be all you need to do. It will not work in the editor you will need to Package your project and open two versions of it on your desktop. Let me know if you have any further trouble.
There has to be a game hosted on the Ip you are trying to join. and since you are running both instances of the game on your internet you need to use 127.0.0.1 to connect. Also make sure you put a space after open in the append that is what messed me up for a little while.